Skip to content

Commit 110524d

Browse files
deltakoshDavid Catuhe
andauthored
Fix Billboard individual mode in RH (#16878)
Co-authored-by: David Catuhe <[email protected]>
1 parent cebc2f7 commit 110524d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/dev/core/src/Meshes/transformNode.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1211,7 +1211,9 @@ export class TransformNode extends Node {
12111211
// Get camera view matrix
12121212
TmpVectors.Matrix[1].copyFrom(camera.getViewMatrix());
12131213

1214-
if (this.getScene().useRightHandedSystem) {
1214+
const isRH = this.getScene().useRightHandedSystem;
1215+
1216+
if (isRH) {
12151217
// This operation is necessary to cancel out the scaling component of the matrix without decomposing it.
12161218
// It's a trick to extract only the rotation part.
12171219
TmpVectors.Matrix[1].multiplyToRef(TransformNode._TmpRHRestore, TmpVectors.Matrix[1]);
@@ -1238,6 +1240,10 @@ export class TransformNode extends Node {
12381240
eulerAngles.z = 0;
12391241
}
12401242

1243+
if (isRH) {
1244+
eulerAngles.y += Math.PI; // Yaw correction
1245+
}
1246+
12411247
Matrix.RotationYawPitchRollToRef(eulerAngles.y, eulerAngles.x, eulerAngles.z, TmpVectors.Matrix[0]);
12421248
}
12431249
this._worldMatrix.setTranslationFromFloats(0, 0, 0);

0 commit comments

Comments
 (0)