Skip to content

instancedMesh: fix getWorldMatrix in case billboardMode of source mesh enabled #16641

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 20, 2025

Conversation

kzhsw
Copy link
Contributor

@kzhsw kzhsw commented May 20, 2025

The _currentLOD of InstancedMesh would be _sourceMesh if LOD of source mesh not enabled, but if billboardMode of source mesh enabled, getWorldMatrix would incorrectly use the billboardMode of the sourceMesh to compute world matrix. This commit would add a check in getWorldMatrix to skip this if _currentLOD is _sourceMesh.

Forum post: https://forum.babylonjs.com/t/billboardmode-of-sourcemesh-changes-instance-rotation/58469
Playground: https://playground.babylonjs.com/#1RQ8OR

…h enabled

The `_currentLOD` of InstancedMesh would be `_sourceMesh` if LOD of source mesh not enabled, but if billboardMode of source mesh enabled, `getWorldMatrix` would incorrectly use the billboardMode of the `sourceMesh` to compute world matrix.
This commit would add a check in `getWorldMatrix` to skip this if `_currentLOD` is `_sourceMesh`.

Forum post: <https://forum.babylonjs.com/t/billboardmode-of-sourcemesh-changes-instance-rotation/58469>
Playground: <https://playground.babylonjs.com/#1RQ8OR>
@bjsplat
Copy link
Collaborator

bjsplat commented May 20, 2025

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@deltakosh deltakosh enabled auto-merge (squash) May 20, 2025 00:53
@bjsplat
Copy link
Collaborator

bjsplat commented May 20, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented May 20, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented May 20, 2025

@deltakosh deltakosh merged commit 5259acc into BabylonJS:master May 20, 2025
17 checks passed
@kzhsw kzhsw deleted the patch-1 branch May 20, 2025 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants