Nikolay Suslov 4 years ago
parent
commit
adf62e1e6e
2 changed files with 13 additions and 4 deletions
  1. 5 3
      public/vwf/model/aframe/aframe-master.js
  2. 8 1
      public/vwf/view/aframe.js

+ 5 - 3
public/vwf/model/aframe/aframe-master.js

@@ -63504,13 +63504,15 @@ TextGeometry.prototype.computeBoundingSphere = function () {
     this.boundingSphere = new THREE.Sphere()
   }
   //LIVECODING.SPACE changes!!! FIX - move to LCS codebase  
-  var positions = this.attributes.position?.array
-  var itemSize = this.attributes.position?.itemSize
-  if (!positions || !itemSize || positions?.length < 2) {
+  if(this.attributes.position) {
+  var positions = this.attributes.position.array
+  var itemSize = this.attributes.position.itemSize
+  if (!positions || !itemSize || positions.length < 2) {
     this.boundingSphere.radius = 0
     this.boundingSphere.center.set(0, 0, 0)
     return
   }
+}
   utils.computeSphere(positions, this.boundingSphere)
   if (isNaN(this.boundingSphere.radius)) {
     console.error('THREE.BufferGeometry.computeBoundingSphere(): ' +

+ 8 - 1
public/vwf/view/aframe.js

@@ -802,7 +802,7 @@ define(["module", "vwf/view"], function (module, view) {
         //console.log(axes);
         let el = document.querySelector('#avatarControl');
         let position = new THREE.Vector3();
-        el.object3D.getWorldPosition(position);
+        el.object3D.localToWorld(position);//getWorldPosition(position);
         let vel = new THREE.Vector3(axes[0], 0, -axes[1]);
         el.object3D.position.add(getMovementVector(el,vel));
     }
@@ -1097,6 +1097,13 @@ define(["module", "vwf/view"], function (module, view) {
     
         // gearvr.setAttribute('gearvr-controls', 'hand', 'right');
 
+        el.setAttribute('teleport-controls', { 
+            cameraRig: '#avatarControlParent',
+            teleportOrigin: '#avatarControl',
+            startEvents: 'teleportstart',
+            endEvents: 'teleportend'
+        });
+
         el.setAttribute('gearvrcontrol', {});
         avatarControl.appendChild(el);