Skip to content

Commit b5e485b

Browse files
committed
fix(soba): correctly track billboard group rotation
1 parent dd0836f commit b5e485b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

libs/soba/abstractions/src/lib/billboard.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export class NgtsBillboard {
5757
if (!follow || !group) return;
5858

5959
// save previous rotation in case we're locking an axis
60-
const prevRotation = group.rotation.clone();
60+
const prevRotation = inner.rotation.clone();
6161

6262
// always face the camera
6363
group.updateMatrix();
@@ -66,9 +66,9 @@ export class NgtsBillboard {
6666
camera.getWorldQuaternion(inner.quaternion).premultiply(q.invert());
6767

6868
// readjust any axis that is locked
69-
if (lockX) group.rotation.x = prevRotation.x;
70-
if (lockY) group.rotation.y = prevRotation.y;
71-
if (lockZ) group.rotation.z = prevRotation.z;
69+
if (lockX) inner.rotation.x = prevRotation.x;
70+
if (lockY) inner.rotation.y = prevRotation.y;
71+
if (lockZ) inner.rotation.z = prevRotation.z;
7272
});
7373
}
7474
}

0 commit comments

Comments
 (0)