Bladeren bron

fix of update

Nikolay Suslov 7 jaren geleden
bovenliggende
commit
6490e0f2d2

+ 2 - 0
lib/nodejs/reflector.js

@@ -212,9 +212,11 @@ function OnConnection( socket ) {
                     client.emit( 'message', message );
                 }
             }
+                if(global.instances[ namespace ]){
             if ( global.instances[ namespace ].pendingList.pending ) {
                 global.instances[ namespace ].pendingList.push( message );
             }
+        }
         }, 50 );
 
     }

+ 35 - 19
support/client/lib/vwf/model/aframe.js

@@ -349,9 +349,9 @@ define(["module", "vwf/model", "vwf/utility"], function (module, model, utility)
                             aframeObject.setAttribute('material', {'side': propertyValue});
                             break;
 
-                        case "look-controls-enabled":
-                            aframeObject.setAttribute('look-controls', 'enabled', propertyValue);
-                            break;
+                        // case "look-controls-enabled":
+                        //     aframeObject.setAttribute('look-controls', 'enabled', propertyValue);
+                        //     break;
                         case "wasd-controls":
                             aframeObject.setAttribute('wasd-controls', 'enabled', propertyValue);
                             break;
@@ -613,8 +613,16 @@ define(["module", "vwf/model", "vwf/utility"], function (module, model, utility)
                     value = propertyValue;
                     switch (propertyName) {
 
-                        case "userHeight":
-                            aframeObject.setAttribute('camera', 'userHeight', propertyValue);
+                        case "user-height":
+                            aframeObject.setAttribute('user-height', propertyValue);
+                            break;
+
+                            case "look-controls-enabled":
+                            aframeObject.setAttribute('look-controls-enabled', propertyValue);
+                            break;
+
+                            case "wasd-controls-enabled":
+                            aframeObject.setAttribute('wasd-controls-enabled', propertyValue);
                             break;
 
                         // case "active":
@@ -750,18 +758,18 @@ define(["module", "vwf/model", "vwf/utility"], function (module, model, utility)
                         case "repeat":
                             value = aframeObject.getAttribute('repeat');
 
-                        case "look-controls-enabled":
-                            var look = aframeObject.getAttribute('look-controls-enabled');
-                            if (look !== null && look !== undefined) {
-                                value = aframeObject.getAttribute('look-controls').enabled;
-                            }
-                            break;
-                        case "wasd-controls":
-                            var wasd = aframeObject.getAttribute('wasd-controls');
-                            if (wasd !== null && wasd !== undefined) {
-                                value = aframeObject.getAttribute('wasd-controls').enabled;
-                            }
-                            break;
+                        // case "look-controls-enabled":
+                        //     var look = aframeObject.getAttribute('look-controls-enabled');
+                        //     if (look !== null && look !== undefined) {
+                        //         value = aframeObject.getAttribute('look-controls').enabled;
+                        //     }
+                        //     break;
+                        // case "wasd-controls":
+                        //     var wasd = aframeObject.getAttribute('wasd-controls');
+                        //     if (wasd !== null && wasd !== undefined) {
+                        //         value = aframeObject.getAttribute('wasd-controls').enabled;
+                        //     }
+                        //     break;
 
                         case "visible":
                             value = aframeObject.getAttribute('visible');
@@ -918,9 +926,17 @@ define(["module", "vwf/model", "vwf/utility"], function (module, model, utility)
 
 
                     switch (propertyName) {
-                        case "userHeight":
-                            value = aframeObject.getAttribute('camera').userHeight;
+                        case "user-height":
+                            value = aframeObject.getAttribute('user-height');
                             break;
+                        case "look-controls-enabled":
+                            value = aframeObject.getAttribute('look-controls-enabled');
+                            break;
+
+                        case "wasd-controls-enabled":
+                            value = aframeObject.getAttribute('wasd-controls-enabled');
+                            break;
+
                     }
 
                     //    switch (propertyName) {

+ 16 - 12
support/client/lib/vwf/view/aframe.js

@@ -91,7 +91,7 @@ define(["module", "vwf/view"], function (module, view) {
                     }
                 }
 
-                if (this.wmrright == true) {
+                if (this.wmrleft == true) {
                     console.log("CREATE WMR LEFT HERE!!");
                     if (AFRAME.utils.device.checkHasPositionalTracking()) {
                         let nodeName = 'wmrvr-left-' + self.kernel.moniker();
@@ -279,20 +279,23 @@ define(["module", "vwf/view"], function (module, view) {
             let rotation = el.getAttribute('rotation');
 
             let lastRotation = self.nodes[avatarName].selfTickRotation;
+            let lastPosition = self.nodes[avatarName].selfTickPosition;
 
-            let currentPosition = node.aframeObj.getAttribute('position');
-            let currentRotation = node.aframeObj.getAttribute('rotation');
+           // let currentPosition = node.aframeObj.getAttribute('position');
+            //let currentRotation = node.aframeObj.getAttribute('rotation');
 
-            if (position && rotation && currentPosition && currentRotation && lastRotation) {
-                if (compareCoordinates(position, currentPosition) || compareCoordinates(rotation, lastRotation)) {
+            if (position && rotation && lastRotation && lastPosition) {
+                if (compareCoordinates(position, lastPosition) || compareCoordinates(rotation, lastRotation)) {
                     console.log("not equal!!");
 
-                    vwf_view.kernel.setProperty(avatarName, "rotation", AFRAME.utils.coordinates.stringify(rotation));
-                    vwf_view.kernel.setProperty(avatarName, "position", AFRAME.utils.coordinates.stringify(position));
+                    vwf_view.kernel.callMethod(avatarName, "updateVRControl", [position, rotation]);
+                   // vwf_view.kernel.setProperty(avatarName, "position", AFRAME.utils.coordinates.stringify(position));
+                    //vwf_view.kernel.setProperty(avatarName, "rotation", AFRAME.utils.coordinates.stringify(rotation));
                 }
             }
 
             self.nodes[avatarName].selfTickRotation = Object.assign({}, el.getAttribute('rotation'));
+            self.nodes[avatarName].selfTickPosition = Object.assign({}, el.getAttribute('position'));
 
         }
     }
@@ -305,12 +308,13 @@ define(["module", "vwf/view"], function (module, view) {
         let controlEl = document.createElement('a-camera');
         // controlEl.setAttribute('avatar', '');
         controlEl.setAttribute('id', 'avatarControl');
-        controlEl.setAttribute('wasd-controls', {});
-        controlEl.setAttribute('look-controls', {});
-        controlEl.setAttribute('look-controls', 'userHeight', 1.6)
+        controlEl.setAttribute('wasd-controls-enabled', true);
+        controlEl.setAttribute('look-controls-enabled', true);
+        controlEl.setAttribute('user-height', 1.6);
         controlEl.setAttribute('gamepad-controls', {});
+        //controlEl.setAttribute('gearvr-controls',{});
         controlEl.setAttribute('camera', 'active', true);
-        controlEl.setAttribute('camera', 'userHeight', 1.6);
+       // controlEl.setAttribute('camera', 'userHeight', 1.6);
        // controlEl.setAttribute('camera', 'near', 0.51);
 
         aScene.appendChild(controlEl);
@@ -425,7 +429,7 @@ define(["module", "vwf/view"], function (module, view) {
         wmrvr.setAttribute('id', 'wmrvrcontrol' + hand);
         wmrvr.setAttribute('windows-motion-controls', '');
         wmrvr.setAttribute('windows-motion-controls', 'hand', hand);
-        wmrvr.setAttribute('wmrvrcontrol', {'hand': hand});
+        //wmrvr.setAttribute('wmrvrcontrol', {'hand': hand});
         sceneEl.appendChild(wmrvr);
     }
 

+ 2 - 2
support/client/lib/vwf/view/aframeComponent.js

@@ -150,10 +150,10 @@ define(["module", "vwf/view"], function (module, view) {
                     'rotation': {}
                 }
             }
-           self.nodes[nodeID].interpolate.position.lastTick = self.nodes[nodeID].interpolate.position.selfTick;
+            self.nodes[nodeID].interpolate.position.lastTick = (self.nodes[nodeID].interpolate.position.selfTick);
             self.nodes[nodeID].interpolate.position.selfTick = getPosition(nodeID);
 
-            self.nodes[nodeID].interpolate.rotation.lastTick = self.nodes[nodeID].interpolate.rotation.selfTick;
+            self.nodes[nodeID].interpolate.rotation.lastTick = (self.nodes[nodeID].interpolate.rotation.selfTick);
             self.nodes[nodeID].interpolate.rotation.selfTick = getRotation(nodeID);
             //console.log(self.nodes[nodeID].interpolate.rotation.selfTick);
             //self.nodes[nodeID].lastTickTransform = self.nodes[nodeID].selfTickTransform;

+ 1 - 1
support/client/lib/vwf/view/editor-new.js

@@ -1302,7 +1302,7 @@ define([
                                                         $text: "Active",
                                                         onclick: function (e) {
                                                             let camera = document.querySelector('#' + this._currentNode);
-                                                            camera.setAttribute('active', true);
+                                                            camera.setAttribute('camera', 'active', true);
                                                         }
 
                                                     }

+ 6 - 1
support/proxy/vwf.example.com/aframe/acamera.vwf.yaml

@@ -3,4 +3,9 @@
 extends: http://vwf.example.com/aframe/aentity.vwf
 type: "a-camera"
 properties:
-  userHeight:
+  user-height:
+  far:
+  fov:
+  look-controls-enabled:
+  near:
+  wasd-controls-enabled:

+ 3 - 3
support/proxy/vwf.example.com/aframe/avatar.js

@@ -88,10 +88,10 @@ this.createAvatarBody = function (modelSrc) {
                         "id": 'camera-' + this.id,
                         "extends": "http://vwf.example.com/aframe/acamera.vwf",
                         "properties": {
-                            "position": "0 0 0",
+                            "position": "0 0 -0.5",
                             "look-controls-enabled": false,
-                            "wasd-controls": false,
-                            "userHeight": 0,
+                            "wasd-controls-enabled": false,
+                            "user-height": 0
                         }
                     },
                     "myCursor":

+ 10 - 13
support/proxy/vwf.example.com/aframe/gearvrcontroller.js

@@ -18,13 +18,14 @@ this.simpleDef = {
                 "depth": 0.1
             }
         },
-        // "interpolation":
-        //     {
-        //         "extends": "http://vwf.example.com/aframe/interpolation-component.vwf",
-        //         "type": "component",
-        //         "properties": {
-        //         }
-        //     }
+        "interpolation":
+            {
+                "extends": "http://vwf.example.com/aframe/interpolation-component.vwf",
+                "type": "component",
+                "properties": {
+                    "enabled": true
+                }
+            }
     }
 }
 
@@ -73,11 +74,7 @@ this.createController = function (modelSrc) {
         "extends": "http://vwf.example.com/aframe/interpolation-component.vwf",
         "type": "component",
         "properties": {
-            "enabled": true,
-            "duration": 50,
-            "deltaPos": 0,
-            "deltaRot": 0
-        }
+   }
     }
 
 
@@ -87,7 +84,7 @@ this.createController = function (modelSrc) {
 }
 
 
-this.updateAvatarVRControl = function(position, rotation){
+this.updateVRControl = function(position, rotation){
 
     this.rotation = rotation;
     this.position = position;

+ 4 - 5
support/proxy/vwf.example.com/aframe/wmrvrcontroller.js

@@ -17,12 +17,14 @@ this.simpleDef = {
                 "width": 0.1,
                 "depth": 0.1
             }
+
         },
         "interpolation":
             {
                 "extends": "http://vwf.example.com/aframe/interpolation-component.vwf",
                 "type": "component",
                 "properties": {
+                    "enabled": true
                 }
             }
     }
@@ -73,10 +75,7 @@ this.createController = function (modelSrc) {
         "extends": "http://vwf.example.com/aframe/interpolation-component.vwf",
         "type": "component",
         "properties": {
-            "enabled": true,
-            "duration": 50,
-            "deltaPos": 0,
-            "deltaRot": 0
+            "enabled": true
         }
     }
 
@@ -87,7 +86,7 @@ this.createController = function (modelSrc) {
 }
 
 
-this.updateAvatarVRControl = function(position, rotation){
+this.updateVRControl = function(position, rotation){
 
     this.rotation = rotation;
     this.position = position;