repo: janusweb action: commit revision: path_from: revision_from: 76b213bbacf22077767eed08f50fcbb645746e18: path_to: revision_to:
commit 76b213bbacf22077767eed08f50fcbb645746e18 Author: James BaicoianuDate: Mon Oct 1 17:46:10 2018 -0700 Implemented janusbase.hasPhysicsChangedOrientation() diff --git a/scripts/janusbase.js b/scripts/janusbase.js
--- a/scripts/janusbase.js
+++ b/scripts/janusbase.js
@@ -518,9 +518,14 @@ console.log('got collider', collider, collision_id);
var changes = this.frameupdates;
return (changes['rotation'] || changes['rotation_dir'] || !this.lastframevalues.rotation.equals(this.properties.rotation));
}
- this.hasPhysicsChangedOrientation = function() {
- return false; // TODO
- }
+ this.hasPhysicsChangedOrientation = (function() {
+ // Scratch variable
+ var euler = new THREE.Euler();
+ return function() {
+ euler..setFromQuaternion(this.properties.orientation);
+ return !euler.equals(this.properties.rotation);
+ }
+ })();
this.resetFrameUpdates = function() {
this.frameupdates['xdir'] = false;
this.frameupdates['ydir'] = false;
-----END OF PAGE-----