From 763b3fe780956c55dfd0e6234b04cb61912a9fe8 Mon Sep 17 00:00:00 2001 From: Noeri Huisman <8823461+mrxz@users.noreply.github.com> Date: Mon, 8 Apr 2024 22:10:14 +0200 Subject: [PATCH] Ensure a-entity rotation Euler has YXZ order even without rotation component (#5513) Co-authored-by: Noeri Huisman --- src/components/rotation.js | 3 +-- src/core/a-entity.js | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/rotation.js b/src/components/rotation.js index d6db75e035..93a363083b 100644 --- a/src/components/rotation.js +++ b/src/components/rotation.js @@ -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 () { diff --git a/src/core/a-entity.js b/src/core/a-entity.js index d4fb702b77..c5cc5522c2 100644 --- a/src/core/a-entity.js +++ b/src/core/a-entity.js @@ -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;