Skip to content

Commit 763b3fe

Browse files
authored
Ensure a-entity rotation Euler has YXZ order even without rotation component (#5513)
Co-authored-by: Noeri Huisman <mrxz@users.noreply.github.com>
1 parent f2b7a83 commit 763b3fe

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/components/rotation.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ module.exports.Component = registerComponent('rotation', {
1010
update: function () {
1111
var data = this.data;
1212
var object3D = this.el.object3D;
13-
object3D.rotation.set(degToRad(data.x), degToRad(data.y), degToRad(data.z));
14-
object3D.rotation.order = 'YXZ';
13+
object3D.rotation.set(degToRad(data.x), degToRad(data.y), degToRad(data.z), 'YXZ');
1514
},
1615

1716
remove: function () {

src/core/a-entity.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class AEntity extends ANode {
3232
this.isEntity = true;
3333
this.isPlaying = false;
3434
this.object3D = new THREE.Group();
35+
this.object3D.rotation.order = 'YXZ';
3536
this.object3D.el = this;
3637
this.object3DMap = {};
3738
this.parentEl = null;

0 commit comments

Comments
 (0)