Skip to content

Commit

Permalink
Ensure a-entity rotation Euler has YXZ order even without rotation co…
Browse files Browse the repository at this point in the history
…mponent (#5513)

Co-authored-by: Noeri Huisman <mrxz@users.noreply.github.com>
  • Loading branch information
mrxz and mrxz committed Apr 8, 2024
1 parent f2b7a83 commit 763b3fe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/components/rotation.js
Expand Up @@ -10,8 +10,7 @@ module.exports.Component = registerComponent('rotation', {
update: function () {
var data = this.data;
var object3D = this.el.object3D;
object3D.rotation.set(degToRad(data.x), degToRad(data.y), degToRad(data.z));
object3D.rotation.order = 'YXZ';
object3D.rotation.set(degToRad(data.x), degToRad(data.y), degToRad(data.z), 'YXZ');
},

remove: function () {
Expand Down
1 change: 1 addition & 0 deletions src/core/a-entity.js
Expand Up @@ -32,6 +32,7 @@ class AEntity extends ANode {
this.isEntity = true;
this.isPlaying = false;
this.object3D = new THREE.Group();
this.object3D.rotation.order = 'YXZ';
this.object3D.el = this;
this.object3DMap = {};
this.parentEl = null;
Expand Down

0 comments on commit 763b3fe

Please sign in to comment.