diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2025-05-06 18:13:24 +0300 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2025-05-06 22:35:14 +0300 |
commit | 5e8f871aea8f5a4393ab8f9080c227ea1bf46c21 (patch) | |
tree | 68f5ac5cd44c0ed5c4fa027aa301cea85781b900 | |
parent | b3d1a1cb1600ca34994050a14cdfe9e474e57d43 (diff) |
Apply 1/100th scale to the vertex positions
-rw-r--r-- | indra/newview/gltf/llgltfloader.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/indra/newview/gltf/llgltfloader.cpp b/indra/newview/gltf/llgltfloader.cpp index 15ed5f40ed..08d396d1e2 100644 --- a/indra/newview/gltf/llgltfloader.cpp +++ b/indra/newview/gltf/llgltfloader.cpp @@ -338,8 +338,16 @@ bool LLGLTFLoader::populateModelFromMesh(LLModel* pModel, const LL::GLTF::Mesh& for (U32 i = 0; i < prim.getVertexCount(); i++) { + // Apply scaling directly to the vertex positions as they're read from the file + const float DIRECT_SCALE = 0.01f; // 1/100th scale + GLTFVertex vert; - vert.position = glm::vec3(prim.mPositions[i][0], prim.mPositions[i][1], prim.mPositions[i][2]); + vert.position = glm::vec3( + prim.mPositions[i][0] * DIRECT_SCALE, + prim.mPositions[i][1] * DIRECT_SCALE, + prim.mPositions[i][2] * DIRECT_SCALE + ); + vert.normal = glm::vec3(prim.mNormals[i][0], prim.mNormals[i][1], prim.mNormals[i][2]); vert.uv0 = glm::vec2(prim.mTexCoords0[i][0], -prim.mTexCoords0[i][1]); vertices.push_back(vert); |