using static_cast<float> in ImportMesh to support assimp with double-precision (#1391)
using aiVector3t<float> in ImportMesh to support assimp with double-precision Co-authored-by: surrim <root@surrim.org>
This commit is contained in:
@@ -147,13 +147,17 @@ MeshGL ImportMesh(const std::string& filename, bool forceCleanup) {
|
||||
for (size_t i = 0; i < scene->mNumMeshes; ++i) {
|
||||
const aiMesh* mesh_i = scene->mMeshes[i];
|
||||
for (size_t j = 0; j < mesh_i->mNumVertices; ++j) {
|
||||
const aiVector3D vert = mesh_i->mVertices[j];
|
||||
const aiVector3t<float> vert = mesh_i->mVertices[j];
|
||||
if (isYup)
|
||||
mesh_out.vertProperties.insert(mesh_out.vertProperties.end(),
|
||||
{vert.z, vert.x, vert.y});
|
||||
mesh_out.vertProperties.insert(
|
||||
mesh_out.vertProperties.end(),
|
||||
{static_cast<float>(vert.z), static_cast<float>(vert.x),
|
||||
static_cast<float>(vert.y)});
|
||||
else
|
||||
mesh_out.vertProperties.insert(mesh_out.vertProperties.end(),
|
||||
{vert.x, vert.y, vert.z});
|
||||
mesh_out.vertProperties.insert(
|
||||
mesh_out.vertProperties.end(),
|
||||
{static_cast<float>(vert.z), static_cast<float>(vert.x),
|
||||
static_cast<float>(vert.y)});
|
||||
}
|
||||
for (size_t j = 0; j < mesh_i->mNumFaces; ++j) {
|
||||
const aiFace face = mesh_i->mFaces[j];
|
||||
|
||||
Reference in New Issue
Block a user