Skip to content

Commit

Permalink
Update world matrix before position/orientation
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo committed May 30, 2023
1 parent 44efc3a commit d6a8384
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/bit-systems/audio-emitter-system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const getAudioPosition = (() => {
eid = eid.eid;
}
const obj = APP.world.eid2obj.get(eid)!;
obj.updateMatrixWorld();
obj.matrixWorld.decompose(_position, _quaternion, _scale);
position.copy(_position);
}
Expand All @@ -51,6 +52,7 @@ export const getAudioOrientation = (() => {
eid = eid.eid;
}
const obj = APP.world.eid2obj.get(eid)!;
obj.updateMatrixWorld();
obj.matrixWorld.decompose(_position, _quaternion, _scale);
orientation.set(0, 0, -1).applyQuaternion(_quaternion);
}
Expand Down

0 comments on commit d6a8384

Please sign in to comment.