repo: janusweb
action: commit
revision: 
path_from: 
revision_from: 1d96781972d6cdb607e4f51057362860fa7fcdf6:
path_to: 
revision_to: 
git.thebackupbox.net
janusweb
git clone git://git.thebackupbox.net/janusweb
commit 1d96781972d6cdb607e4f51057362860fa7fcdf6
Author: James Baicoianu 
Date:   Sat Oct 21 03:16:58 2017 -0700

    Use room.spawnpoint object

diff --git a/scripts/janusplayer.js b/scripts/janusplayer.js
index a279a29a7f51467ae3e50b63a68caccae02d1a54..
index ..7aad4ff9033b80586c021f29a43e496b564e38c0 100644
--- a/scripts/janusplayer.js
+++ b/scripts/janusplayer.js
@@ -376,16 +376,8 @@ elation.require(['engine.things.player', 'janusweb.external.JanusVOIP', 'ui.butt
       if (!ev || ev.value == 1) {
         var room = this.engine.client.janusweb.currentroom;
         if (room) {
-          var pos = room.playerstartposition;
-          // If startpos is < 3 elements, pad it with 0s
-          if (pos.length < 3) {
-            var len = pos.length;
-            pos.length = 3;
-            pos.fill(0, len, 3);
-          }
-          this.properties.position.fromArray(room.playerstartposition);
-          this.properties.orientation.copy(room.playerstartorientation);
-          this.properties.orientation.multiply(new THREE.Quaternion().setFromEuler(new THREE.Euler(0,Math.PI,0)));
+          this.properties.position.copy(room.spawnpoint.position);
+          this.properties.orientation.copy(room.spawnpoint.quaternion);
           this.head.properties.orientation.copy(this.properties.startcameraorientation);
           this.properties.velocity.set(0,0,0);
           this.objects.dynamics.angular.set(0,0,0);

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