Skip to content

Commit

Permalink
KJSL: support deviceorientation
Browse files Browse the repository at this point in the history
  • Loading branch information
kevleyski committed Jul 30, 2024
1 parent 1ecceff commit c030398
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ void main() {
}

// WebXR has animation loop but if that's not available we simulate that instead
if (this.webVREffect) {
if (this.webVREffect && this.webVREffect.isPresenting) {
this.webVREffect.render(this.scene, this.camera);
}

Expand Down Expand Up @@ -651,6 +651,15 @@ void main() {
this.animationFrameId_ = this.requestAnimationFrame(this.animate_);
if (this.orbitcontrols.update()) {
this.renderer.render(this.scene, this.camera);
if (this.webVREffect) {
this.webVREffect.isPresenting = false;
}
} else if (this.webVREffect) {
// this.controls3d.orbit.target.setX(this.camera.quaternion.x);
// this.controls3d.orbit.target.setY(this.camera.quaternion.y);
// this.controls3d.orbit.target.setZ(this.camera.quaternion.z);
this.controls3d.orbit.update();
this.webVREffect.isPresenting = true;
}
}

Expand Down

0 comments on commit c030398

Please sign in to comment.