Skip to content

Commit

Permalink
Only apply position and orientation of spatial anchor space to anchor…
Browse files Browse the repository at this point in the history
…ed entity (#5633)
  • Loading branch information
mrxz authored Jan 20, 2025
1 parent b700ca6 commit c854fd5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/anchored.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ module.exports.Component = registerComponent('anchored', {
refSpace = xrManager.getReferenceSpace();

pose = frame.getPose(this.anchor.anchorSpace, refSpace);
object3D.matrix.elements = pose.transform.matrix;
object3D.matrix.decompose(object3D.position, object3D.rotation, object3D.scale);
// Apply position and orientation, leave scale as-is (see aframevr/aframe#5630)
object3D.position.copy(pose.transform.position);
object3D.quaternion.copy(pose.transform.orientation);
},

createAnchor: async function createAnchor (position, quaternion) {
Expand Down

0 comments on commit c854fd5

Please sign in to comment.