repo: janusweb
action: commit
revision: 
path_from: 
revision_from: 87d81a5526b6f64bc61c1ba10f1cdb99f149655c:
path_to: 
revision_to: 
git.thebackupbox.net
janusweb
git clone git://git.thebackupbox.net/janusweb
commit 87d81a5526b6f64bc61c1ba10f1cdb99f149655c
Author: James Baicoianu 
Date:   Sun May 13 21:56:02 2018 -0700

    Added 'object' parameter to use raw Three.js objects

diff --git a/scripts/janusbase.js b/scripts/janusbase.js
index 3bc9092f5e5ae0994ebb95127d11a3e9e3071198..
index ..d46ce9c030138f41035711a78fe43069c85dbb37 100644
--- a/scripts/janusbase.js
+++ b/scripts/janusbase.js
@@ -29,6 +29,7 @@ elation.require(['engine.things.generic', 'utils.template'], function() {
         locked:   { type: 'boolean', default: false },
         rotate_axis: { type: 'string', default: '0 1 0', set: this.updateRotationSpeed },
         rotate_deg_per_sec: { type: 'float', default: 0, set: this.updateRotationSpeed },
+        object: { type: 'object' },
         onclick: { type: 'object' },
         anim_id: { type: 'string', set: this.updateAnimation },
         anim_transition_time: { type: 'float', default: .2 },
@@ -64,6 +65,14 @@ elation.require(['engine.things.generic', 'utils.template'], function() {
       this.handleFrameUpdates = elation.bind(this, this.handleFrameUpdates);
       this.created = false;
     }
+    this.createObject3D = function() {
+      if (this.object && this.object instanceof THREE.Object3D) {
+        this.properties.position.copy(this.object.position);
+        this.properties.orientation.copy(this.object.quaternion);
+        return this.object;
+      }
+      return new THREE.Object3D();
+    }
     this.createChildren = function() {
       if (typeof this.create == 'function') {
         this.create();

-----END OF PAGE-----