Explorar o código

work on objects intersection

Nikolay Suslov %!s(int64=4) %!d(string=hai) anos
pai
achega
b82216afd9

+ 2 - 1
public/defaults/proxy/aframe/aentity.js

@@ -96,10 +96,11 @@ this.sendOSC = function (msg) {
 // }
 
 
-this.intersectEventMethod = function () {
+this.intersectEventMethod = function (point) {
     //intersect method
 }
 
+
 this.clearIntersectEventMethod = function () {
     //clearIntersect method
 }

+ 5 - 1
public/defaults/proxy/aframe/aentity.vwf.json

@@ -48,7 +48,11 @@
   },
   "methods": {
     "getRandomColor": {},
-    "intersectEventMethod": {},
+    "intersectEventMethod": {
+      "parameters": [
+        "point"
+      ]
+    },
     "clearIntersectEventMethod": {},
     "hitstartEventMethod": {},
     "hitendEventMethod": {},

+ 2 - 1
public/defaults/worlds/aframe2/index.vwf.json

@@ -184,7 +184,8 @@
           "type": "application/javascript"
         },
         "intersectEventMethod": {
-          "body": "    this.material.opacity = 0.7\n",
+          "parameters": ["point"],
+          "body": "    this.material.opacity = 0.7; \n console.log(point) \n",
           "type": "application/javascript"
         },
         "clearIntersectEventMethod": {

+ 3 - 0
public/drivers/model/aframe/addon/aframe-interpolation.js

@@ -115,6 +115,9 @@ AFRAME.registerComponent('interpolation', {
     this.restorePositionTransforms();
     this.restoreRotationTransforms();
     this.restoreScaleTransforms();
+
+    this.el.object3D.updateMatrixWorld( true );
+
   },
 
   restorePositionTransforms: function () {