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 5f5dbeb commit 1ecceff
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .run/360.html.run.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="360.html" type="JavascriptDebugType" nameIsGenerated="true" engineId="708d076b-dac0-4405-adc1-3adc6351942b" uri="http://localhost:63342/videojs-vr/examples/360.html?https://sharkoder.metacdn.com/streams/whaleshark/8Kev/manifest.mpd" useBuiltInWebServerPort="true">
<configuration default="false" name="360.html" type="JavascriptDebugType" nameIsGenerated="true" uri="http://localhost:63342/videojs-vr/examples/360.html" useBuiltInWebServerPort="true">
<method v="2" />
</configuration>
</component>
6 changes: 3 additions & 3 deletions src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,9 @@ void main() {
}

this.animationFrameId_ = this.requestAnimationFrame(this.animate_);
this.orbitcontrols.update();
if (this.orbitcontrols.update()) {
this.renderer.render(this.scene, this.camera);
}
}

handleResize_() {
Expand Down Expand Up @@ -1209,8 +1211,6 @@ void main() {
self.renderController(controller);
});
}

this.orbitcontrols.update();
this.renderer.render(this.scene, this.camera);
}

Expand Down
4 changes: 3 additions & 1 deletion vendor/three/DeviceOrientationControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,13 @@ class DeviceOrientationControls extends EventDispatcher {

lastQuaternion.copy( scope.object.quaternion );
scope.dispatchEvent( _changeEvent );

return true;
}

}

return false;

};

this.dispose = function () {
Expand Down

0 comments on commit 1ecceff

Please sign in to comment.