Nikolay Suslov 6 years ago
parent
commit
a6b1a7295a

+ 3 - 1
public/defaults/proxy/vwf.example.com/aframe/aentity.vwf.yaml

@@ -9,7 +9,9 @@ properties:
   position:
     set: |
       var position = this.translationFromValue( value ); // parse incoming value
-      if ( ! goog.vec.Vec3.equals( this.position || goog.vec.Vec3.create(), position ) ) {
+      if(!position || !this.position){
+        this.position = goog.vec.Vec3.create();
+      } else if ( ! goog.vec.Vec3.equals( this.position || goog.vec.Vec3.create(), position ) ) {
         this.position = position;
         this.positionChanged( position);
       }  

+ 5 - 4
public/defaults/proxy/vwf.example.com/aframe/avatar.js

@@ -63,7 +63,7 @@ this.createAvatarBody = function (nodeDef, modelSrc) {
             "myHead": {
                 "extends": "http://vwf.example.com/aframe/aentity.vwf",
                 "properties": {
-                    "position": "0 1.6 0.7",
+                    "position": [0, 1.6, 0.7],
                     "visible": true
                 },
                 children: {
@@ -99,7 +99,7 @@ this.createAvatarBody = function (nodeDef, modelSrc) {
                         "id": 'camera-' + this.id,
                         "extends": "http://vwf.example.com/aframe/acamera.vwf",
                         "properties": {
-                            "position": "0 0 -0.7",
+                            "position": [0, 0, -0.7],
                             "look-controls-enabled": false,
                             "wasd-controls-enabled": false,
                             "user-height": 0
@@ -228,7 +228,7 @@ this.createAvatarBody = function (nodeDef, modelSrc) {
         "extends": "http://vwf.example.com/aframe/interpolation-component.vwf",
         "type": "component",
         "properties": {
-            "enabled": false
+            "enabled": true
         }
     }
 
@@ -269,7 +269,8 @@ this.followAvatarControl = function (position, rotation) {
 //debugger;
 
    // this.position = AFRAME.utils.coordinates.stringify(position);
-   this.position = position;
+    this.position = goog.vec.Vec3.createFromValues(position.x, position.y, position.z);
+
     let myRot = AFRAME.utils.coordinates.parse(this.rotation);
     let myHeadRot = AFRAME.utils.coordinates.parse(this.avatarNode.myHead.rotation);
     let myBodyRot = AFRAME.utils.coordinates.parse(this.avatarNode.myBody.rotation);

+ 3 - 3
public/vwf/model/aframe/addon/aframe-interpolation.js

@@ -196,7 +196,7 @@ AFRAME.registerComponent('interpolation', {
 
     if (last && now) {
 
-      let comp = this.matCmp(last, now, this.deltaPos);
+      let comp = this.vecCmp(last, now, this.deltaPos);
 
       if (!comp) {
 
@@ -206,8 +206,8 @@ AFRAME.registerComponent('interpolation', {
           goog.vec.Vec3.create()
         );
 
-        console.log(this.node.id);
-        console.log(step + ' : ' + interp);
+       // console.log(this.node.id);
+        //console.log(step + ' : ' + interp);
 
         // var lastV = (new THREE.Vector3()).copy(last);
         // var nowV = (new THREE.Vector3()).copy(now);

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

@@ -305,7 +305,7 @@ define(["module", "vwf/view"], function (module, view) {
                         "displayName": 'Avatar ' + randId(),
                         "sharing": { audio: true, video: true },
                         "selectMode": false,
-                        "position": "0 1.6 0"
+                        "position": [0, 1.6, 0]
                     }
                 }
 
@@ -535,6 +535,7 @@ define(["module", "vwf/view"], function (module, view) {
         return rotation
     }
 
+
     function updateAvatarPosition() {
 
         let delta = 0.0001;