repo: janusweb
action: commit
revision: 
path_from: 
revision_from: 76b213bbacf22077767eed08f50fcbb645746e18:
path_to: 
revision_to: 
git.thebackupbox.net
janusweb
git clone git://git.thebackupbox.net/janusweb
commit 76b213bbacf22077767eed08f50fcbb645746e18
Author: James Baicoianu 
Date:   Mon Oct 1 17:46:10 2018 -0700

    Implemented janusbase.hasPhysicsChangedOrientation()

diff --git a/scripts/janusbase.js b/scripts/janusbase.js
index cfa6e8b8379bd405e51c471e58a7600b6ca287f9..
index ..c307ebe75c36d8fb44fcd88ba1e4482d7e1d4948 100644
--- 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-----