David Catuhe 8 vuotta sitten
vanhempi
commit
0782dca165

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 3621 - 3622
dist/preview release/babylon.d.ts


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 13 - 13
dist/preview release/babylon.js


+ 21 - 8
dist/preview release/babylon.max.js

@@ -52557,7 +52557,8 @@ var BABYLON;
                     'THUMBSTICK_Y',
                     'TOUCHPAD_TOUCH_X',
                     'TOUCHPAD_TOUCH_Y'
-                ]
+                ],
+                pointingPoseMeshName: 'POINTING_POSE'
             };
             _this.onTrackpadChangedObservable = new BABYLON.Observable();
             _this.controllerType = BABYLON.PoseEnabledControllerType.WINDOWS;
@@ -52717,13 +52718,10 @@ var BABYLON;
             var childMesh = null;
             for (var i = 0; i < meshes.length; i++) {
                 var mesh = meshes[i];
-                if (mesh.id === WindowsMotionController.MODEL_ROOT_NODE_NAME) {
-                    // There may be a parent mesh to perform the RH to LH matrix transform.
+                if (!mesh.parent) {
                     // Exclude controller meshes from picking results
                     mesh.isPickable = false;
                     // Handle root node, attach to the new parentMesh
-                    if (mesh.parent && mesh.parent.name === WindowsMotionController.GLTF_ROOT_TRANSFORM_NAME)
-                        mesh = mesh.parent;
                     childMesh = mesh;
                     break;
                 }
@@ -52734,7 +52732,7 @@ var BABYLON;
                 loadedMeshInfo = this.createMeshInfo(parentMesh);
             }
             else {
-                BABYLON.Tools.Warn('No node with name ' + WindowsMotionController.MODEL_ROOT_NODE_NAME + ' in model file.');
+                BABYLON.Tools.Warn('Could not find root node in model file.');
             }
             return loadedMeshInfo;
         };
@@ -52805,6 +52803,11 @@ var BABYLON;
                         ')');
                 }
             }
+            // Pointing Ray
+            loadedMeshInfo.pointingPoseNode = getChildByName(rootNode, this._mapping.pointingPoseMeshName);
+            if (!loadedMeshInfo.pointingPoseNode) {
+                BABYLON.Tools.Warn('Missing pointing pose mesh with name: ' + this._mapping.pointingPoseMeshName);
+            }
             return loadedMeshInfo;
             // Look through all children recursively. This will return null if no mesh exists with the given name.
             function getChildByName(node, name) {
@@ -52815,6 +52818,18 @@ var BABYLON;
                 return node.getChildMeshes(true, function (n) { return n.name == name; })[0];
             }
         };
+        WindowsMotionController.prototype.getForwardRay = function (length) {
+            if (length === void 0) { length = 100; }
+            if (!(this._loadedMeshInfo && this._loadedMeshInfo.pointingPoseNode)) {
+                return _super.prototype.getForwardRay.call(this, length);
+            }
+            var m = this._loadedMeshInfo.pointingPoseNode.getWorldMatrix();
+            var origin = m.getTranslation();
+            var forward = new BABYLON.Vector3(0, 0, -1);
+            var forwardWorld = BABYLON.Vector3.TransformNormal(forward, m);
+            var direction = BABYLON.Vector3.Normalize(forwardWorld);
+            return new BABYLON.Ray(origin, direction, length);
+        };
         WindowsMotionController.prototype.dispose = function () {
             _super.prototype.dispose.call(this);
             this.onTrackpadChangedObservable.clear();
@@ -52822,8 +52837,6 @@ var BABYLON;
         WindowsMotionController.MODEL_BASE_URL = 'https://controllers.babylonjs.com/microsoft/';
         WindowsMotionController.MODEL_LEFT_FILENAME = 'left.glb';
         WindowsMotionController.MODEL_RIGHT_FILENAME = 'right.glb';
-        WindowsMotionController.MODEL_ROOT_NODE_NAME = 'RootNode';
-        WindowsMotionController.GLTF_ROOT_TRANSFORM_NAME = 'root';
         WindowsMotionController.GAMEPAD_ID_PREFIX = 'Spatial Controller (Spatial Interaction Source) ';
         WindowsMotionController.GAMEPAD_ID_PATTERN = /([0-9a-zA-Z]+-[0-9a-zA-Z]+)$/;
         return WindowsMotionController;

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 3621 - 3622
dist/preview release/babylon.module.d.ts


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 13 - 13
dist/preview release/babylon.worker.js


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 492 - 493
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 13 - 13
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


+ 21 - 8
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js

@@ -52557,7 +52557,8 @@ var BABYLON;
                     'THUMBSTICK_Y',
                     'TOUCHPAD_TOUCH_X',
                     'TOUCHPAD_TOUCH_Y'
-                ]
+                ],
+                pointingPoseMeshName: 'POINTING_POSE'
             };
             _this.onTrackpadChangedObservable = new BABYLON.Observable();
             _this.controllerType = BABYLON.PoseEnabledControllerType.WINDOWS;
@@ -52717,13 +52718,10 @@ var BABYLON;
             var childMesh = null;
             for (var i = 0; i < meshes.length; i++) {
                 var mesh = meshes[i];
-                if (mesh.id === WindowsMotionController.MODEL_ROOT_NODE_NAME) {
-                    // There may be a parent mesh to perform the RH to LH matrix transform.
+                if (!mesh.parent) {
                     // Exclude controller meshes from picking results
                     mesh.isPickable = false;
                     // Handle root node, attach to the new parentMesh
-                    if (mesh.parent && mesh.parent.name === WindowsMotionController.GLTF_ROOT_TRANSFORM_NAME)
-                        mesh = mesh.parent;
                     childMesh = mesh;
                     break;
                 }
@@ -52734,7 +52732,7 @@ var BABYLON;
                 loadedMeshInfo = this.createMeshInfo(parentMesh);
             }
             else {
-                BABYLON.Tools.Warn('No node with name ' + WindowsMotionController.MODEL_ROOT_NODE_NAME + ' in model file.');
+                BABYLON.Tools.Warn('Could not find root node in model file.');
             }
             return loadedMeshInfo;
         };
@@ -52805,6 +52803,11 @@ var BABYLON;
                         ')');
                 }
             }
+            // Pointing Ray
+            loadedMeshInfo.pointingPoseNode = getChildByName(rootNode, this._mapping.pointingPoseMeshName);
+            if (!loadedMeshInfo.pointingPoseNode) {
+                BABYLON.Tools.Warn('Missing pointing pose mesh with name: ' + this._mapping.pointingPoseMeshName);
+            }
             return loadedMeshInfo;
             // Look through all children recursively. This will return null if no mesh exists with the given name.
             function getChildByName(node, name) {
@@ -52815,6 +52818,18 @@ var BABYLON;
                 return node.getChildMeshes(true, function (n) { return n.name == name; })[0];
             }
         };
+        WindowsMotionController.prototype.getForwardRay = function (length) {
+            if (length === void 0) { length = 100; }
+            if (!(this._loadedMeshInfo && this._loadedMeshInfo.pointingPoseNode)) {
+                return _super.prototype.getForwardRay.call(this, length);
+            }
+            var m = this._loadedMeshInfo.pointingPoseNode.getWorldMatrix();
+            var origin = m.getTranslation();
+            var forward = new BABYLON.Vector3(0, 0, -1);
+            var forwardWorld = BABYLON.Vector3.TransformNormal(forward, m);
+            var direction = BABYLON.Vector3.Normalize(forwardWorld);
+            return new BABYLON.Ray(origin, direction, length);
+        };
         WindowsMotionController.prototype.dispose = function () {
             _super.prototype.dispose.call(this);
             this.onTrackpadChangedObservable.clear();
@@ -52822,8 +52837,6 @@ var BABYLON;
         WindowsMotionController.MODEL_BASE_URL = 'https://controllers.babylonjs.com/microsoft/';
         WindowsMotionController.MODEL_LEFT_FILENAME = 'left.glb';
         WindowsMotionController.MODEL_RIGHT_FILENAME = 'right.glb';
-        WindowsMotionController.MODEL_ROOT_NODE_NAME = 'RootNode';
-        WindowsMotionController.GLTF_ROOT_TRANSFORM_NAME = 'root';
         WindowsMotionController.GAMEPAD_ID_PREFIX = 'Spatial Controller (Spatial Interaction Source) ';
         WindowsMotionController.GAMEPAD_ID_PATTERN = /([0-9a-zA-Z]+-[0-9a-zA-Z]+)$/;
         return WindowsMotionController;

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 492 - 493
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.module.d.ts