David Catuhe 5 年之前
父节点
当前提交
95b3c5d0b4
共有 30 个文件被更改,包括 386 次插入50 次删除
  1. 45 0
      dist/preview release/babylon.d.ts
  2. 1 1
      dist/preview release/babylon.js
  3. 89 15
      dist/preview release/babylon.max.js
  4. 1 1
      dist/preview release/babylon.max.js.map
  5. 92 0
      dist/preview release/babylon.module.d.ts
  6. 43 0
      dist/preview release/documentation.d.ts
  7. 0 1
      dist/preview release/loaders/babylon.glTF1FileLoader.js
  8. 1 1
      dist/preview release/loaders/babylon.glTF1FileLoader.js.map
  9. 1 1
      dist/preview release/loaders/babylon.glTF1FileLoader.min.js
  10. 0 1
      dist/preview release/loaders/babylon.glTF2FileLoader.js
  11. 1 1
      dist/preview release/loaders/babylon.glTF2FileLoader.js.map
  12. 1 1
      dist/preview release/loaders/babylon.glTF2FileLoader.min.js
  13. 0 1
      dist/preview release/loaders/babylon.glTFFileLoader.js
  14. 1 1
      dist/preview release/loaders/babylon.glTFFileLoader.js.map
  15. 1 1
      dist/preview release/loaders/babylon.glTFFileLoader.min.js
  16. 0 1
      dist/preview release/loaders/babylon.objFileLoader.js
  17. 1 1
      dist/preview release/loaders/babylon.objFileLoader.js.map
  18. 1 1
      dist/preview release/loaders/babylon.objFileLoader.min.js
  19. 0 1
      dist/preview release/loaders/babylon.stlFileLoader.js
  20. 1 1
      dist/preview release/loaders/babylon.stlFileLoader.js.map
  21. 1 1
      dist/preview release/loaders/babylon.stlFileLoader.min.js
  22. 0 3
      dist/preview release/loaders/babylonjs.loaders.js
  23. 1 1
      dist/preview release/loaders/babylonjs.loaders.js.map
  24. 2 2
      dist/preview release/loaders/babylonjs.loaders.min.js
  25. 88 0
      dist/preview release/viewer/babylon.module.d.ts
  26. 6 6
      dist/preview release/viewer/babylon.viewer.js
  27. 2 2
      dist/preview release/viewer/babylon.viewer.max.js
  28. 2 0
      src/XR/features/WebXRControllerPhysics.ts
  29. 2 3
      src/scene.ts
  30. 2 1
      tests/validation/config.json

+ 45 - 0
dist/preview release/babylon.d.ts

@@ -35096,6 +35096,8 @@ declare module BABYLON {
         cameraToUseForPointers: Nullable<Camera>;
         /** @hidden */
         readonly _isScene: boolean;
+        /** @hidden */
+        _blockEntityCollection: boolean;
         /**
          * Gets or sets a boolean that indicates if the scene must clear the render buffer before rendering a frame
          */
@@ -69064,6 +69066,35 @@ declare module BABYLON {
              */
             restitution?: number;
         };
+        /**
+         * Should the headset get its own impostor
+         */
+        enableHeadsetImpostor?: boolean;
+        /**
+         * Optional parameters for the headset impostor
+         */
+        headsetImpostorParams?: {
+            /**
+             * The type of impostor to create. Default is sphere
+             */
+            impostorType: number;
+            /**
+             * the size of the impostor. Defaults to 10cm
+             */
+            impostorSize?: number | {
+                width: number;
+                height: number;
+                depth: number;
+            };
+            /**
+             * Friction definitions
+             */
+            friction?: number;
+            /**
+             * Restitution
+             */
+            restitution?: number;
+        };
     }
     /**
      * Add physics impostor to your webxr controllers,
@@ -69084,6 +69115,8 @@ declare module BABYLON {
         private _lastTimestamp;
         private _delta;
         private _controllers;
+        private _headsetImpostor?;
+        private _headsetMesh?;
         private _tmpVector;
         private _tmpQuaternion;
         /**
@@ -69107,6 +69140,18 @@ declare module BABYLON {
             restitution?: number;
         }): void;
         /**
+         * Get the physics impostor of a specific controller.
+         * The impostor is not attached to a mesh because a mesh for each controller is not obligatory
+         * @param controller the controller or the controller id of which to get the impostor
+         * @returns the impostor or null
+         */
+        getImpostorForController(controller: WebXRInputSource | string): Nullable<PhysicsImpostor>;
+        /**
+         * Get the headset impostor, if enabled
+         * @returns the impostor
+         */
+        getHeadsetImpostor(): PhysicsImpostor | undefined;
+        /**
          * attach this feature
          * Will usually be called by the features manager
          *

文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/babylon.js


文件差异内容过多而无法显示
+ 89 - 15
dist/preview release/babylon.max.js


文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/babylon.max.js.map


+ 92 - 0
dist/preview release/babylon.module.d.ts

@@ -36186,6 +36186,8 @@ declare module "babylonjs/scene" {
         cameraToUseForPointers: Nullable<Camera>;
         /** @hidden */
         readonly _isScene: boolean;
+        /** @hidden */
+        _blockEntityCollection: boolean;
         /**
          * Gets or sets a boolean that indicates if the scene must clear the render buffer before rendering a frame
          */
@@ -72770,8 +72772,10 @@ declare module "babylonjs/XR/features/WebXRBackgroundRemover" {
 declare module "babylonjs/XR/features/WebXRControllerPhysics" {
     import { WebXRAbstractFeature } from "babylonjs/XR/features/WebXRAbstractFeature";
     import { WebXRInputSource } from "babylonjs/XR/webXRInputSource";
+    import { PhysicsImpostor } from "babylonjs/Physics/physicsImpostor";
     import { WebXRInput } from "babylonjs/XR/webXRInput";
     import { WebXRSessionManager } from "babylonjs/XR/webXRSessionManager";
+    import { Nullable } from "babylonjs/types";
     /**
      * Options for the controller physics feature
      */
@@ -72810,6 +72814,35 @@ declare module "babylonjs/XR/features/WebXRControllerPhysics" {
              */
             restitution?: number;
         };
+        /**
+         * Should the headset get its own impostor
+         */
+        enableHeadsetImpostor?: boolean;
+        /**
+         * Optional parameters for the headset impostor
+         */
+        headsetImpostorParams?: {
+            /**
+             * The type of impostor to create. Default is sphere
+             */
+            impostorType: number;
+            /**
+             * the size of the impostor. Defaults to 10cm
+             */
+            impostorSize?: number | {
+                width: number;
+                height: number;
+                depth: number;
+            };
+            /**
+             * Friction definitions
+             */
+            friction?: number;
+            /**
+             * Restitution
+             */
+            restitution?: number;
+        };
     }
     /**
      * Add physics impostor to your webxr controllers,
@@ -72830,6 +72863,8 @@ declare module "babylonjs/XR/features/WebXRControllerPhysics" {
         private _lastTimestamp;
         private _delta;
         private _controllers;
+        private _headsetImpostor?;
+        private _headsetMesh?;
         private _tmpVector;
         private _tmpQuaternion;
         /**
@@ -72853,6 +72888,18 @@ declare module "babylonjs/XR/features/WebXRControllerPhysics" {
             restitution?: number;
         }): void;
         /**
+         * Get the physics impostor of a specific controller.
+         * The impostor is not attached to a mesh because a mesh for each controller is not obligatory
+         * @param controller the controller or the controller id of which to get the impostor
+         * @returns the impostor or null
+         */
+        getImpostorForController(controller: WebXRInputSource | string): Nullable<PhysicsImpostor>;
+        /**
+         * Get the headset impostor, if enabled
+         * @returns the impostor
+         */
+        getHeadsetImpostor(): PhysicsImpostor | undefined;
+        /**
          * attach this feature
          * Will usually be called by the features manager
          *
@@ -108328,6 +108375,8 @@ declare module BABYLON {
         cameraToUseForPointers: Nullable<Camera>;
         /** @hidden */
         readonly _isScene: boolean;
+        /** @hidden */
+        _blockEntityCollection: boolean;
         /**
          * Gets or sets a boolean that indicates if the scene must clear the render buffer before rendering a frame
          */
@@ -142296,6 +142345,35 @@ declare module BABYLON {
              */
             restitution?: number;
         };
+        /**
+         * Should the headset get its own impostor
+         */
+        enableHeadsetImpostor?: boolean;
+        /**
+         * Optional parameters for the headset impostor
+         */
+        headsetImpostorParams?: {
+            /**
+             * The type of impostor to create. Default is sphere
+             */
+            impostorType: number;
+            /**
+             * the size of the impostor. Defaults to 10cm
+             */
+            impostorSize?: number | {
+                width: number;
+                height: number;
+                depth: number;
+            };
+            /**
+             * Friction definitions
+             */
+            friction?: number;
+            /**
+             * Restitution
+             */
+            restitution?: number;
+        };
     }
     /**
      * Add physics impostor to your webxr controllers,
@@ -142316,6 +142394,8 @@ declare module BABYLON {
         private _lastTimestamp;
         private _delta;
         private _controllers;
+        private _headsetImpostor?;
+        private _headsetMesh?;
         private _tmpVector;
         private _tmpQuaternion;
         /**
@@ -142339,6 +142419,18 @@ declare module BABYLON {
             restitution?: number;
         }): void;
         /**
+         * Get the physics impostor of a specific controller.
+         * The impostor is not attached to a mesh because a mesh for each controller is not obligatory
+         * @param controller the controller or the controller id of which to get the impostor
+         * @returns the impostor or null
+         */
+        getImpostorForController(controller: WebXRInputSource | string): Nullable<PhysicsImpostor>;
+        /**
+         * Get the headset impostor, if enabled
+         * @returns the impostor
+         */
+        getHeadsetImpostor(): PhysicsImpostor | undefined;
+        /**
          * attach this feature
          * Will usually be called by the features manager
          *

+ 43 - 0
dist/preview release/documentation.d.ts

@@ -35096,6 +35096,8 @@ declare module BABYLON {
         cameraToUseForPointers: Nullable<Camera>;
         /** @hidden */
         readonly _isScene: boolean;
+        /** @hidden */
+        _blockEntityCollection: boolean;
         /**
          * Gets or sets a boolean that indicates if the scene must clear the render buffer before rendering a frame
          */
@@ -69064,6 +69066,35 @@ declare module BABYLON {
              */
             restitution?: number;
         };
+        /**
+         * Should the headset get its own impostor
+         */
+        enableHeadsetImpostor?: boolean;
+        /**
+         * Optional parameters for the headset impostor
+         */
+        headsetImpostorParams?: {
+            /**
+             * The type of impostor to create. Default is sphere
+             */
+            impostorType: number;
+            /**
+             * the size of the impostor. Defaults to 10cm
+             */
+            impostorSize?: number | {
+                width: number;
+                height: number;
+                depth: number;
+            };
+            /**
+             * Friction definitions
+             */
+            friction?: number;
+            /**
+             * Restitution
+             */
+            restitution?: number;
+        };
     }
     /**
      * Add physics impostor to your webxr controllers,
@@ -69084,6 +69115,8 @@ declare module BABYLON {
         private _lastTimestamp;
         private _delta;
         private _controllers;
+        private _headsetImpostor?;
+        private _headsetMesh?;
         private _tmpVector;
         private _tmpQuaternion;
         /**
@@ -69107,6 +69140,16 @@ declare module BABYLON {
             restitution?: number;
         }): void;
         /**
+         * Get the physics impostor of a specific controller.
+         * The impostor is not attached to a mesh because a mesh for each controller is not obligatory
+         * @param controller the controller or the controller id of which to get the impostor
+         */
+        getImpostorForController(controller: WebXRInputSource | string): Nullable<PhysicsImpostor>;
+        /**
+         * Get the headset impostor, if enabled
+         */
+        getHeadsetImpostor(): PhysicsImpostor | undefined;
+        /**
          * attach this feature
          * Will usually be called by the features manager
          *

+ 0 - 1
dist/preview release/loaders/babylon.glTF1FileLoader.js

@@ -3194,7 +3194,6 @@ var GLTFFileLoader = /** @class */ (function () {
                 Array.prototype.push.apply(container.animationGroups, result.animationGroups);
                 Array.prototype.push.apply(container.materials, materials);
                 Array.prototype.push.apply(container.textures, textures);
-                container.removeAllFromScene();
                 return container;
             });
         });

文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/loaders/babylon.glTF1FileLoader.js.map


文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/loaders/babylon.glTF1FileLoader.min.js


+ 0 - 1
dist/preview release/loaders/babylon.glTF2FileLoader.js

@@ -4446,7 +4446,6 @@ var GLTFFileLoader = /** @class */ (function () {
                 Array.prototype.push.apply(container.animationGroups, result.animationGroups);
                 Array.prototype.push.apply(container.materials, materials);
                 Array.prototype.push.apply(container.textures, textures);
-                container.removeAllFromScene();
                 return container;
             });
         });

文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/loaders/babylon.glTF2FileLoader.js.map


文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/loaders/babylon.glTF2FileLoader.min.js


+ 0 - 1
dist/preview release/loaders/babylon.glTFFileLoader.js

@@ -7006,7 +7006,6 @@ var GLTFFileLoader = /** @class */ (function () {
                 Array.prototype.push.apply(container.animationGroups, result.animationGroups);
                 Array.prototype.push.apply(container.materials, materials);
                 Array.prototype.push.apply(container.textures, textures);
-                container.removeAllFromScene();
                 return container;
             });
         });

文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/loaders/babylon.glTFFileLoader.js.map


文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/loaders/babylon.glTFFileLoader.min.js


+ 0 - 1
dist/preview release/loaders/babylon.objFileLoader.js

@@ -585,7 +585,6 @@ var OBJFileLoader = /** @class */ (function () {
                     }
                 }
             });
-            container.removeAllFromScene();
             return container;
         });
     };

文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/loaders/babylon.objFileLoader.js.map


文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/loaders/babylon.objFileLoader.min.js


+ 0 - 1
dist/preview release/loaders/babylon.stlFileLoader.js

@@ -275,7 +275,6 @@ var STLFileLoader = /** @class */ (function () {
     STLFileLoader.prototype.loadAssetContainer = function (scene, data, rootUrl, onError) {
         var container = new babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_0__["AssetContainer"](scene);
         this.importMesh(null, scene, data, rootUrl, container.meshes, null, null);
-        container.removeAllFromScene();
         return container;
     };
     STLFileLoader.prototype._isBinary = function (data) {

文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/loaders/babylon.stlFileLoader.js.map


文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/loaders/babylon.stlFileLoader.min.js


+ 0 - 3
dist/preview release/loaders/babylonjs.loaders.js

@@ -814,7 +814,6 @@ var OBJFileLoader = /** @class */ (function () {
                     }
                 }
             });
-            container.removeAllFromScene();
             return container;
         });
     };
@@ -1627,7 +1626,6 @@ var STLFileLoader = /** @class */ (function () {
     STLFileLoader.prototype.loadAssetContainer = function (scene, data, rootUrl, onError) {
         var container = new babylonjs_Misc_tools__WEBPACK_IMPORTED_MODULE_0__["AssetContainer"](scene);
         this.importMesh(null, scene, data, rootUrl, container.meshes, null, null);
-        container.removeAllFromScene();
         return container;
     };
     STLFileLoader.prototype._isBinary = function (data) {
@@ -8373,7 +8371,6 @@ var GLTFFileLoader = /** @class */ (function () {
                 Array.prototype.push.apply(container.animationGroups, result.animationGroups);
                 Array.prototype.push.apply(container.materials, materials);
                 Array.prototype.push.apply(container.textures, textures);
-                container.removeAllFromScene();
                 return container;
             });
         });

文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/loaders/babylonjs.loaders.js.map


文件差异内容过多而无法显示
+ 2 - 2
dist/preview release/loaders/babylonjs.loaders.min.js


+ 88 - 0
dist/preview release/viewer/babylon.module.d.ts

@@ -36186,6 +36186,8 @@ declare module "babylonjs/scene" {
         cameraToUseForPointers: Nullable<Camera>;
         /** @hidden */
         readonly _isScene: boolean;
+        /** @hidden */
+        _blockEntityCollection: boolean;
         /**
          * Gets or sets a boolean that indicates if the scene must clear the render buffer before rendering a frame
          */
@@ -72770,8 +72772,10 @@ declare module "babylonjs/XR/features/WebXRBackgroundRemover" {
 declare module "babylonjs/XR/features/WebXRControllerPhysics" {
     import { WebXRAbstractFeature } from "babylonjs/XR/features/WebXRAbstractFeature";
     import { WebXRInputSource } from "babylonjs/XR/webXRInputSource";
+    import { PhysicsImpostor } from "babylonjs/Physics/physicsImpostor";
     import { WebXRInput } from "babylonjs/XR/webXRInput";
     import { WebXRSessionManager } from "babylonjs/XR/webXRSessionManager";
+    import { Nullable } from "babylonjs/types";
     /**
      * Options for the controller physics feature
      */
@@ -72810,6 +72814,35 @@ declare module "babylonjs/XR/features/WebXRControllerPhysics" {
              */
             restitution?: number;
         };
+        /**
+         * Should the headset get its own impostor
+         */
+        enableHeadsetImpostor?: boolean;
+        /**
+         * Optional parameters for the headset impostor
+         */
+        headsetImpostorParams?: {
+            /**
+             * The type of impostor to create. Default is sphere
+             */
+            impostorType: number;
+            /**
+             * the size of the impostor. Defaults to 10cm
+             */
+            impostorSize?: number | {
+                width: number;
+                height: number;
+                depth: number;
+            };
+            /**
+             * Friction definitions
+             */
+            friction?: number;
+            /**
+             * Restitution
+             */
+            restitution?: number;
+        };
     }
     /**
      * Add physics impostor to your webxr controllers,
@@ -72830,6 +72863,8 @@ declare module "babylonjs/XR/features/WebXRControllerPhysics" {
         private _lastTimestamp;
         private _delta;
         private _controllers;
+        private _headsetImpostor?;
+        private _headsetMesh?;
         private _tmpVector;
         private _tmpQuaternion;
         /**
@@ -72853,6 +72888,16 @@ declare module "babylonjs/XR/features/WebXRControllerPhysics" {
             restitution?: number;
         }): void;
         /**
+         * Get the physics impostor of a specific controller.
+         * The impostor is not attached to a mesh because a mesh for each controller is not obligatory
+         * @param controller the controller or the controller id of which to get the impostor
+         */
+        getImpostorForController(controller: WebXRInputSource | string): Nullable<PhysicsImpostor>;
+        /**
+         * Get the headset impostor, if enabled
+         */
+        getHeadsetImpostor(): PhysicsImpostor | undefined;
+        /**
          * attach this feature
          * Will usually be called by the features manager
          *
@@ -108328,6 +108373,8 @@ declare module BABYLON {
         cameraToUseForPointers: Nullable<Camera>;
         /** @hidden */
         readonly _isScene: boolean;
+        /** @hidden */
+        _blockEntityCollection: boolean;
         /**
          * Gets or sets a boolean that indicates if the scene must clear the render buffer before rendering a frame
          */
@@ -142296,6 +142343,35 @@ declare module BABYLON {
              */
             restitution?: number;
         };
+        /**
+         * Should the headset get its own impostor
+         */
+        enableHeadsetImpostor?: boolean;
+        /**
+         * Optional parameters for the headset impostor
+         */
+        headsetImpostorParams?: {
+            /**
+             * The type of impostor to create. Default is sphere
+             */
+            impostorType: number;
+            /**
+             * the size of the impostor. Defaults to 10cm
+             */
+            impostorSize?: number | {
+                width: number;
+                height: number;
+                depth: number;
+            };
+            /**
+             * Friction definitions
+             */
+            friction?: number;
+            /**
+             * Restitution
+             */
+            restitution?: number;
+        };
     }
     /**
      * Add physics impostor to your webxr controllers,
@@ -142316,6 +142392,8 @@ declare module BABYLON {
         private _lastTimestamp;
         private _delta;
         private _controllers;
+        private _headsetImpostor?;
+        private _headsetMesh?;
         private _tmpVector;
         private _tmpQuaternion;
         /**
@@ -142339,6 +142417,16 @@ declare module BABYLON {
             restitution?: number;
         }): void;
         /**
+         * Get the physics impostor of a specific controller.
+         * The impostor is not attached to a mesh because a mesh for each controller is not obligatory
+         * @param controller the controller or the controller id of which to get the impostor
+         */
+        getImpostorForController(controller: WebXRInputSource | string): Nullable<PhysicsImpostor>;
+        /**
+         * Get the headset impostor, if enabled
+         */
+        getHeadsetImpostor(): PhysicsImpostor | undefined;
+        /**
          * attach this feature
          * Will usually be called by the features manager
          *

文件差异内容过多而无法显示
+ 6 - 6
dist/preview release/viewer/babylon.viewer.js


文件差异内容过多而无法显示
+ 2 - 2
dist/preview release/viewer/babylon.viewer.max.js


+ 2 - 0
src/XR/features/WebXRControllerPhysics.ts

@@ -143,6 +143,7 @@ export class WebXRControllerPhysics extends WebXRAbstractFeature {
      * Get the physics impostor of a specific controller.
      * The impostor is not attached to a mesh because a mesh for each controller is not obligatory
      * @param controller the controller or the controller id of which to get the impostor
+     * @returns the impostor or null
      */
     public getImpostorForController(controller: WebXRInputSource | string): Nullable<PhysicsImpostor> {
         let id = typeof controller === "string" ? controller : controller.uniqueId;
@@ -155,6 +156,7 @@ export class WebXRControllerPhysics extends WebXRAbstractFeature {
 
     /**
      * Get the headset impostor, if enabled
+     * @returns the impostor
      */
     public getHeadsetImpostor() {
         return this._headsetImpostor;

+ 2 - 3
src/scene.ts

@@ -152,7 +152,6 @@ export class Scene extends AbstractScene implements IAnimatable {
     /** @hidden */
     public readonly _isScene = true;
 
-    
     /** @hidden */
     public _blockEntityCollection = false;
 
@@ -2440,7 +2439,7 @@ export class Scene extends AbstractScene implements IAnimatable {
             return;
         }
 
-        newMaterial._indexInSceneMaterialArray = this.materials.length;        
+        newMaterial._indexInSceneMaterialArray = this.materials.length;
         this.materials.push(newMaterial);
         this.onNewMaterialAddedObservable.notifyObservers(newMaterial);
     }
@@ -2464,7 +2463,7 @@ export class Scene extends AbstractScene implements IAnimatable {
         if (this._blockEntityCollection) {
             return;
         }
-        
+
         if (this.geometriesByUniqueId) {
             this.geometriesByUniqueId[newGeometry.uniqueId] = this.geometries.length;
         }

+ 2 - 1
tests/validation/config.json

@@ -9,7 +9,8 @@
         {
             "title": "Sprite maps",
             "playgroundId": "#ARLADE#22",
-            "referenceImage": "sprite-maps.png"
+            "referenceImage": "sprite-maps.png",            
+            "excludeFromAutomaticTesting": true
         },              
         {
             "title": "Point light shadows",