Skip to content

Commit

Permalink
Merge pull request #1499 from CesiumGS/fix-instanced-translations
Browse files Browse the repository at this point in the history
Add missing scale factor to instanced translations
  • Loading branch information
kring authored Aug 16, 2024
2 parents c7066a5 + 5130b8b commit 346daef
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

### ? - ?

##### Fixes :wrench:

- Fixed a bug introduced in the previous release that caused instanced tilesets to render incorrectly.

### v2.7.1 - 2024-08-01

##### Fixes :wrench:
Expand Down
5 changes: 3 additions & 2 deletions Source/CesiumRuntime/Private/CesiumGltfComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1937,8 +1937,9 @@ static void loadInstancingData(
if (translationAccessor.status() == AccessorViewStatus::Valid) {
for (int64_t i = 0; i < count; ++i) {
glm::dvec3 translation(translationAccessor[i]);
instanceTransforms[i] =
glm::translate(instanceTransforms[i], translation);
instanceTransforms[i] = glm::translate(
instanceTransforms[i],
translation * CesiumPrimitiveData::positionScaleFactor);
}
}
} else {
Expand Down

0 comments on commit 346daef

Please sign in to comment.