Skip to content

Commit

Permalink
add compatibility with aframe 1.6.0 for the addBehavior hack we use t…
Browse files Browse the repository at this point in the history
…o register a tick function with the render loop for the focus element transition animation
  • Loading branch information
vincentfretin committed Aug 31, 2024
1 parent 3cf8194 commit 67d16c7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/editor/lib/EditorControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@ THREE.EditorControls = function (_object, domElement) {
this.transitionCamQuaternionEnd = new THREE.Quaternion();
this.transitionSpeed = 0.001;
this.fakeComponent = {
isPlaying: true,
name: 'inspector-editor-controls',
el: { isPlaying: true },
isPlaying: true,
tick: (t, delta) => {
if (scope.enabled === false) return;
if (this.transitioning) {
Expand Down Expand Up @@ -149,7 +150,12 @@ THREE.EditorControls = function (_object, domElement) {
}
};
// Register the tick function with the render loop
AFRAME.scenes[0].addBehavior(this.fakeComponent);
const sceneEl = AFRAME.scenes[0];
if (sceneEl.componentOrder) {
// aframe 1.6.0 an above
sceneEl.componentOrder.push(this.fakeComponent.name);
}
sceneEl.addBehavior(this.fakeComponent);

this.pan = function (delta) {
var distance;
Expand Down

0 comments on commit 67d16c7

Please sign in to comment.