瀏覽代碼

Merge branch 'master' into resize-editor

Alejandro Toledo 5 年之前
父節點
當前提交
e62bbaf5e9
共有 27 個文件被更改,包括 892 次插入152 次删除
  1. 103 15
      dist/preview release/babylon.d.ts
  2. 2 2
      dist/preview release/babylon.js
  3. 184 7
      dist/preview release/babylon.max.js
  4. 1 1
      dist/preview release/babylon.max.js.map
  5. 200 30
      dist/preview release/babylon.module.d.ts
  6. 118 20
      dist/preview release/documentation.d.ts
  7. 1 1
      dist/preview release/inspector/babylon.inspector.bundle.js
  8. 2 8
      dist/preview release/inspector/babylon.inspector.bundle.max.js
  9. 1 1
      dist/preview release/inspector/babylon.inspector.bundle.max.js.map
  10. 14 5
      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. 14 5
      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. 3 0
      dist/preview release/loaders/babylonjs.loaders.d.ts
  17. 14 5
      dist/preview release/loaders/babylonjs.loaders.js
  18. 1 1
      dist/preview release/loaders/babylonjs.loaders.js.map
  19. 1 1
      dist/preview release/loaders/babylonjs.loaders.min.js
  20. 6 0
      dist/preview release/loaders/babylonjs.loaders.module.d.ts
  21. 200 30
      dist/preview release/viewer/babylon.module.d.ts
  22. 12 8
      dist/preview release/viewer/babylon.viewer.js
  23. 2 2
      dist/preview release/viewer/babylon.viewer.max.js
  24. 6 0
      dist/preview release/viewer/babylonjs.loaders.module.d.ts
  25. 0 5
      inspector/src/components/actionTabs/tabs/propertyGrids/variantsPropertyGridComponent.tsx
  26. 2 0
      src/Lights/Shadows/cascadedShadowGenerator.ts
  27. 1 1
      src/Meshes/thinInstanceMesh.ts

+ 103 - 15
dist/preview release/babylon.d.ts

@@ -47090,31 +47090,35 @@ declare module BABYLON {
         /**
         /**
          * The name of the anchor system feature
          * The name of the anchor system feature
          */
          */
-        static ANCHOR_SYSTEM: string;
+        static readonly ANCHOR_SYSTEM: string;
         /**
         /**
          * The name of the background remover feature
          * The name of the background remover feature
          */
          */
-        static BACKGROUND_REMOVER: string;
+        static readonly BACKGROUND_REMOVER: string;
         /**
         /**
          * The name of the hit test feature
          * The name of the hit test feature
          */
          */
-        static HIT_TEST: string;
+        static readonly HIT_TEST: string;
         /**
         /**
          * physics impostors for xr controllers feature
          * physics impostors for xr controllers feature
          */
          */
-        static PHYSICS_CONTROLLERS: string;
+        static readonly PHYSICS_CONTROLLERS: string;
         /**
         /**
          * The name of the plane detection feature
          * The name of the plane detection feature
          */
          */
-        static PLANE_DETECTION: string;
+        static readonly PLANE_DETECTION: string;
         /**
         /**
          * The name of the pointer selection feature
          * The name of the pointer selection feature
          */
          */
-        static POINTER_SELECTION: string;
+        static readonly POINTER_SELECTION: string;
         /**
         /**
          * The name of the teleportation feature
          * The name of the teleportation feature
          */
          */
-        static TELEPORTATION: string;
+        static readonly TELEPORTATION: string;
+        /**
+         * The name of the feature points feature.
+         */
+        static readonly FEATURE_POINTS: string;
     }
     }
     /**
     /**
      * Defining the constructor of a feature. Used to register the modules.
      * Defining the constructor of a feature. Used to register the modules.
@@ -48827,7 +48831,7 @@ declare module BABYLON {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -49354,7 +49358,7 @@ declare module BABYLON {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -74123,7 +74127,7 @@ declare module BABYLON {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -74265,7 +74269,7 @@ declare module BABYLON {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -74367,7 +74371,7 @@ declare module BABYLON {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -74498,7 +74502,7 @@ declare module BABYLON {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -74584,7 +74588,7 @@ declare module BABYLON {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -74714,7 +74718,7 @@ declare module BABYLON {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -74783,6 +74787,79 @@ declare module BABYLON {
 }
 }
 declare module BABYLON {
 declare module BABYLON {
     /**
     /**
+     * A babylon interface for a "WebXR" feature point.
+     * Represents the position and confidence value of a given feature point.
+     */
+    export interface IWebXRFeaturePoint {
+        /**
+         * Represents the position of the feature point in world space.
+         */
+        position: Vector3;
+        /**
+         * Represents the confidence value of the feature point in world space. 0 being least confident, and 1 being most confident.
+         */
+        confidenceValue: number;
+    }
+    /**
+     * The feature point system is used to detect feature points from real world geometry.
+     * This feature is currently experimental and only supported on BabylonNative, and should not be used in the browser.
+     * The newly introduced API can be seen in webxr.nativeextensions.d.ts and described in FeaturePoints.md.
+     */
+    export class WebXRFeaturePointSystem extends WebXRAbstractFeature {
+        private _enabled;
+        private _featurePointCloud;
+        /**
+         * The module's name
+         */
+        static readonly Name: string;
+        /**
+         * The (Babylon) version of this module.
+         * This is an integer representing the implementation version.
+         * This number does not correspond to the WebXR specs version
+         */
+        static readonly Version: number;
+        /**
+        * Observers registered here will be executed whenever new feature points are added (on XRFrame while the session is tracking).
+        * Will notify the observers about which feature points have been added.
+        */
+        readonly onFeaturePointsAddedObservable: Observable<number[]>;
+        /**
+         * Observers registered here will be executed whenever a feature point has been updated (on XRFrame while the session is tracking).
+         * Will notify the observers about which feature points have been updated.
+         */
+        readonly onFeaturePointsUpdatedObservable: Observable<number[]>;
+        /**
+         * The current feature point cloud maintained across frames.
+         */
+        get featurePointCloud(): Array<IWebXRFeaturePoint>;
+        /**
+         * construct the feature point system
+         * @param _xrSessionManager an instance of xr Session manager
+         */
+        constructor(_xrSessionManager: WebXRSessionManager);
+        /**
+         * Detach this feature.
+         * Will usually be called by the features manager
+         *
+         * @returns true if successful.
+         */
+        detach(): boolean;
+        /**
+         * Dispose this feature and all of the resources attached
+         */
+        dispose(): void;
+        /**
+         * On receiving a new XR frame if this feature is attached notify observers new feature point data is available.
+         */
+        protected _onXRFrame(frame: XRFrame): void;
+        /**
+         * Initializes the feature. If the feature point feature is not available for this environment do not mark the feature as enabled.
+         */
+        private _init;
+    }
+}
+declare module BABYLON {
+    /**
      * The motion controller class for all microsoft mixed reality controllers
      * The motion controller class for all microsoft mixed reality controllers
      */
      */
     export class WebXRMicrosoftMixedRealityController extends WebXRAbstractMotionController {
     export class WebXRMicrosoftMixedRealityController extends WebXRAbstractMotionController {
@@ -75747,4 +75824,15 @@ interface XRPlane {
     planeSpace: XRSpace;
     planeSpace: XRSpace;
     polygon: Array<DOMPointReadOnly>;
     polygon: Array<DOMPointReadOnly>;
     lastChangedTime: number;
     lastChangedTime: number;
+}
+// This file contains native only extensions for WebXR  These APIs are not supported in the browser yet.
+// They are intended for use with either Babylon Native https://github.com/BabylonJS/BabylonNative or
+// Babylon React Native: https://github.com/BabylonJS/BabylonReactNative
+
+interface XRSession {
+    trySetFeaturePointCloudEnabled(enabled: boolean): boolean;
+}
+
+interface XRFrame {
+    featurePointCloud? : Array<number>;
 }
 }

文件差異過大導致無法顯示
+ 2 - 2
dist/preview release/babylon.js


文件差異過大導致無法顯示
+ 184 - 7
dist/preview release/babylon.max.js


文件差異過大導致無法顯示
+ 1 - 1
dist/preview release/babylon.max.js.map


+ 200 - 30
dist/preview release/babylon.module.d.ts

@@ -48868,31 +48868,35 @@ declare module "babylonjs/XR/webXRFeaturesManager" {
         /**
         /**
          * The name of the anchor system feature
          * The name of the anchor system feature
          */
          */
-        static ANCHOR_SYSTEM: string;
+        static readonly ANCHOR_SYSTEM: string;
         /**
         /**
          * The name of the background remover feature
          * The name of the background remover feature
          */
          */
-        static BACKGROUND_REMOVER: string;
+        static readonly BACKGROUND_REMOVER: string;
         /**
         /**
          * The name of the hit test feature
          * The name of the hit test feature
          */
          */
-        static HIT_TEST: string;
+        static readonly HIT_TEST: string;
         /**
         /**
          * physics impostors for xr controllers feature
          * physics impostors for xr controllers feature
          */
          */
-        static PHYSICS_CONTROLLERS: string;
+        static readonly PHYSICS_CONTROLLERS: string;
         /**
         /**
          * The name of the plane detection feature
          * The name of the plane detection feature
          */
          */
-        static PLANE_DETECTION: string;
+        static readonly PLANE_DETECTION: string;
         /**
         /**
          * The name of the pointer selection feature
          * The name of the pointer selection feature
          */
          */
-        static POINTER_SELECTION: string;
+        static readonly POINTER_SELECTION: string;
         /**
         /**
          * The name of the teleportation feature
          * The name of the teleportation feature
          */
          */
-        static TELEPORTATION: string;
+        static readonly TELEPORTATION: string;
+        /**
+         * The name of the feature points feature.
+         */
+        static readonly FEATURE_POINTS: string;
     }
     }
     /**
     /**
      * Defining the constructor of a feature. Used to register the modules.
      * Defining the constructor of a feature. Used to register the modules.
@@ -50670,7 +50674,7 @@ declare module "babylonjs/XR/features/WebXRControllerPointerSelection" {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -51218,7 +51222,7 @@ declare module "babylonjs/XR/features/WebXRControllerTeleportation" {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -78263,7 +78267,7 @@ declare module "babylonjs/XR/features/WebXRHitTestLegacy" {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -78410,7 +78414,7 @@ declare module "babylonjs/XR/features/WebXRHitTest" {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -78518,7 +78522,7 @@ declare module "babylonjs/XR/features/WebXRAnchorSystem" {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -78654,7 +78658,7 @@ declare module "babylonjs/XR/features/WebXRPlaneDetector" {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -78744,7 +78748,7 @@ declare module "babylonjs/XR/features/WebXRBackgroundRemover" {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -78880,7 +78884,7 @@ declare module "babylonjs/XR/features/WebXRControllerPhysics" {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -78947,6 +78951,83 @@ declare module "babylonjs/XR/features/WebXRControllerPhysics" {
         private _detachController;
         private _detachController;
     }
     }
 }
 }
+declare module "babylonjs/XR/features/WebXRFeaturePointSystem" {
+    import { WebXRSessionManager } from "babylonjs/XR/webXRSessionManager";
+    import { Observable } from "babylonjs/Misc/observable";
+    import { Vector3 } from "babylonjs/Maths/math.vector";
+    import { WebXRAbstractFeature } from "babylonjs/XR/features/WebXRAbstractFeature";
+    /**
+     * A babylon interface for a "WebXR" feature point.
+     * Represents the position and confidence value of a given feature point.
+     */
+    export interface IWebXRFeaturePoint {
+        /**
+         * Represents the position of the feature point in world space.
+         */
+        position: Vector3;
+        /**
+         * Represents the confidence value of the feature point in world space. 0 being least confident, and 1 being most confident.
+         */
+        confidenceValue: number;
+    }
+    /**
+     * The feature point system is used to detect feature points from real world geometry.
+     * This feature is currently experimental and only supported on BabylonNative, and should not be used in the browser.
+     * The newly introduced API can be seen in webxr.nativeextensions.d.ts and described in FeaturePoints.md.
+     */
+    export class WebXRFeaturePointSystem extends WebXRAbstractFeature {
+        private _enabled;
+        private _featurePointCloud;
+        /**
+         * The module's name
+         */
+        static readonly Name: string;
+        /**
+         * The (Babylon) version of this module.
+         * This is an integer representing the implementation version.
+         * This number does not correspond to the WebXR specs version
+         */
+        static readonly Version: number;
+        /**
+        * Observers registered here will be executed whenever new feature points are added (on XRFrame while the session is tracking).
+        * Will notify the observers about which feature points have been added.
+        */
+        readonly onFeaturePointsAddedObservable: Observable<number[]>;
+        /**
+         * Observers registered here will be executed whenever a feature point has been updated (on XRFrame while the session is tracking).
+         * Will notify the observers about which feature points have been updated.
+         */
+        readonly onFeaturePointsUpdatedObservable: Observable<number[]>;
+        /**
+         * The current feature point cloud maintained across frames.
+         */
+        get featurePointCloud(): Array<IWebXRFeaturePoint>;
+        /**
+         * construct the feature point system
+         * @param _xrSessionManager an instance of xr Session manager
+         */
+        constructor(_xrSessionManager: WebXRSessionManager);
+        /**
+         * Detach this feature.
+         * Will usually be called by the features manager
+         *
+         * @returns true if successful.
+         */
+        detach(): boolean;
+        /**
+         * Dispose this feature and all of the resources attached
+         */
+        dispose(): void;
+        /**
+         * On receiving a new XR frame if this feature is attached notify observers new feature point data is available.
+         */
+        protected _onXRFrame(frame: XRFrame): void;
+        /**
+         * Initializes the feature. If the feature point feature is not available for this environment do not mark the feature as enabled.
+         */
+        private _init;
+    }
+}
 declare module "babylonjs/XR/features/index" {
 declare module "babylonjs/XR/features/index" {
     export * from "babylonjs/XR/features/WebXRHitTestLegacy";
     export * from "babylonjs/XR/features/WebXRHitTestLegacy";
     export * from "babylonjs/XR/features/WebXRAnchorSystem";
     export * from "babylonjs/XR/features/WebXRAnchorSystem";
@@ -78956,6 +79037,7 @@ declare module "babylonjs/XR/features/index" {
     export * from "babylonjs/XR/features/WebXRControllerPointerSelection";
     export * from "babylonjs/XR/features/WebXRControllerPointerSelection";
     export * from "babylonjs/XR/features/WebXRControllerPhysics";
     export * from "babylonjs/XR/features/WebXRControllerPhysics";
     export * from "babylonjs/XR/features/WebXRHitTest";
     export * from "babylonjs/XR/features/WebXRHitTest";
+    export * from "babylonjs/XR/features/WebXRFeaturePointSystem";
 }
 }
 declare module "babylonjs/XR/motionController/webXRMicrosoftMixedRealityController" {
 declare module "babylonjs/XR/motionController/webXRMicrosoftMixedRealityController" {
     import { WebXRAbstractMotionController, IMinimalMotionControllerObject, MotionControllerHandedness } from "babylonjs/XR/motionController/webXRAbstractMotionController";
     import { WebXRAbstractMotionController, IMinimalMotionControllerObject, MotionControllerHandedness } from "babylonjs/XR/motionController/webXRAbstractMotionController";
@@ -126390,31 +126472,35 @@ declare module BABYLON {
         /**
         /**
          * The name of the anchor system feature
          * The name of the anchor system feature
          */
          */
-        static ANCHOR_SYSTEM: string;
+        static readonly ANCHOR_SYSTEM: string;
         /**
         /**
          * The name of the background remover feature
          * The name of the background remover feature
          */
          */
-        static BACKGROUND_REMOVER: string;
+        static readonly BACKGROUND_REMOVER: string;
         /**
         /**
          * The name of the hit test feature
          * The name of the hit test feature
          */
          */
-        static HIT_TEST: string;
+        static readonly HIT_TEST: string;
         /**
         /**
          * physics impostors for xr controllers feature
          * physics impostors for xr controllers feature
          */
          */
-        static PHYSICS_CONTROLLERS: string;
+        static readonly PHYSICS_CONTROLLERS: string;
         /**
         /**
          * The name of the plane detection feature
          * The name of the plane detection feature
          */
          */
-        static PLANE_DETECTION: string;
+        static readonly PLANE_DETECTION: string;
         /**
         /**
          * The name of the pointer selection feature
          * The name of the pointer selection feature
          */
          */
-        static POINTER_SELECTION: string;
+        static readonly POINTER_SELECTION: string;
         /**
         /**
          * The name of the teleportation feature
          * The name of the teleportation feature
          */
          */
-        static TELEPORTATION: string;
+        static readonly TELEPORTATION: string;
+        /**
+         * The name of the feature points feature.
+         */
+        static readonly FEATURE_POINTS: string;
     }
     }
     /**
     /**
      * Defining the constructor of a feature. Used to register the modules.
      * Defining the constructor of a feature. Used to register the modules.
@@ -128127,7 +128213,7 @@ declare module BABYLON {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -128654,7 +128740,7 @@ declare module BABYLON {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -153423,7 +153509,7 @@ declare module BABYLON {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -153565,7 +153651,7 @@ declare module BABYLON {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -153667,7 +153753,7 @@ declare module BABYLON {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -153798,7 +153884,7 @@ declare module BABYLON {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -153884,7 +153970,7 @@ declare module BABYLON {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -154014,7 +154100,7 @@ declare module BABYLON {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -154083,6 +154169,79 @@ declare module BABYLON {
 }
 }
 declare module BABYLON {
 declare module BABYLON {
     /**
     /**
+     * A babylon interface for a "WebXR" feature point.
+     * Represents the position and confidence value of a given feature point.
+     */
+    export interface IWebXRFeaturePoint {
+        /**
+         * Represents the position of the feature point in world space.
+         */
+        position: Vector3;
+        /**
+         * Represents the confidence value of the feature point in world space. 0 being least confident, and 1 being most confident.
+         */
+        confidenceValue: number;
+    }
+    /**
+     * The feature point system is used to detect feature points from real world geometry.
+     * This feature is currently experimental and only supported on BabylonNative, and should not be used in the browser.
+     * The newly introduced API can be seen in webxr.nativeextensions.d.ts and described in FeaturePoints.md.
+     */
+    export class WebXRFeaturePointSystem extends WebXRAbstractFeature {
+        private _enabled;
+        private _featurePointCloud;
+        /**
+         * The module's name
+         */
+        static readonly Name: string;
+        /**
+         * The (Babylon) version of this module.
+         * This is an integer representing the implementation version.
+         * This number does not correspond to the WebXR specs version
+         */
+        static readonly Version: number;
+        /**
+        * Observers registered here will be executed whenever new feature points are added (on XRFrame while the session is tracking).
+        * Will notify the observers about which feature points have been added.
+        */
+        readonly onFeaturePointsAddedObservable: Observable<number[]>;
+        /**
+         * Observers registered here will be executed whenever a feature point has been updated (on XRFrame while the session is tracking).
+         * Will notify the observers about which feature points have been updated.
+         */
+        readonly onFeaturePointsUpdatedObservable: Observable<number[]>;
+        /**
+         * The current feature point cloud maintained across frames.
+         */
+        get featurePointCloud(): Array<IWebXRFeaturePoint>;
+        /**
+         * construct the feature point system
+         * @param _xrSessionManager an instance of xr Session manager
+         */
+        constructor(_xrSessionManager: WebXRSessionManager);
+        /**
+         * Detach this feature.
+         * Will usually be called by the features manager
+         *
+         * @returns true if successful.
+         */
+        detach(): boolean;
+        /**
+         * Dispose this feature and all of the resources attached
+         */
+        dispose(): void;
+        /**
+         * On receiving a new XR frame if this feature is attached notify observers new feature point data is available.
+         */
+        protected _onXRFrame(frame: XRFrame): void;
+        /**
+         * Initializes the feature. If the feature point feature is not available for this environment do not mark the feature as enabled.
+         */
+        private _init;
+    }
+}
+declare module BABYLON {
+    /**
      * The motion controller class for all microsoft mixed reality controllers
      * The motion controller class for all microsoft mixed reality controllers
      */
      */
     export class WebXRMicrosoftMixedRealityController extends WebXRAbstractMotionController {
     export class WebXRMicrosoftMixedRealityController extends WebXRAbstractMotionController {
@@ -155047,4 +155206,15 @@ interface XRPlane {
     planeSpace: XRSpace;
     planeSpace: XRSpace;
     polygon: Array<DOMPointReadOnly>;
     polygon: Array<DOMPointReadOnly>;
     lastChangedTime: number;
     lastChangedTime: number;
+}
+// This file contains native only extensions for WebXR  These APIs are not supported in the browser yet.
+// They are intended for use with either Babylon Native https://github.com/BabylonJS/BabylonNative or
+// Babylon React Native: https://github.com/BabylonJS/BabylonReactNative
+
+interface XRSession {
+    trySetFeaturePointCloudEnabled(enabled: boolean): boolean;
+}
+
+interface XRFrame {
+    featurePointCloud? : Array<number>;
 }
 }

+ 118 - 20
dist/preview release/documentation.d.ts

@@ -47090,31 +47090,35 @@ declare module BABYLON {
         /**
         /**
          * The name of the anchor system feature
          * The name of the anchor system feature
          */
          */
-        static ANCHOR_SYSTEM: string;
+        static readonly ANCHOR_SYSTEM: string;
         /**
         /**
          * The name of the background remover feature
          * The name of the background remover feature
          */
          */
-        static BACKGROUND_REMOVER: string;
+        static readonly BACKGROUND_REMOVER: string;
         /**
         /**
          * The name of the hit test feature
          * The name of the hit test feature
          */
          */
-        static HIT_TEST: string;
+        static readonly HIT_TEST: string;
         /**
         /**
          * physics impostors for xr controllers feature
          * physics impostors for xr controllers feature
          */
          */
-        static PHYSICS_CONTROLLERS: string;
+        static readonly PHYSICS_CONTROLLERS: string;
         /**
         /**
          * The name of the plane detection feature
          * The name of the plane detection feature
          */
          */
-        static PLANE_DETECTION: string;
+        static readonly PLANE_DETECTION: string;
         /**
         /**
          * The name of the pointer selection feature
          * The name of the pointer selection feature
          */
          */
-        static POINTER_SELECTION: string;
+        static readonly POINTER_SELECTION: string;
         /**
         /**
          * The name of the teleportation feature
          * The name of the teleportation feature
          */
          */
-        static TELEPORTATION: string;
+        static readonly TELEPORTATION: string;
+        /**
+         * The name of the feature points feature.
+         */
+        static readonly FEATURE_POINTS: string;
     }
     }
     /**
     /**
      * Defining the constructor of a feature. Used to register the modules.
      * Defining the constructor of a feature. Used to register the modules.
@@ -48827,7 +48831,7 @@ declare module BABYLON {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -49354,7 +49358,7 @@ declare module BABYLON {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -74123,7 +74127,7 @@ declare module BABYLON {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -74265,7 +74269,7 @@ declare module BABYLON {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -74367,7 +74371,7 @@ declare module BABYLON {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -74498,7 +74502,7 @@ declare module BABYLON {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -74584,7 +74588,7 @@ declare module BABYLON {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -74714,7 +74718,7 @@ declare module BABYLON {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -74783,6 +74787,79 @@ declare module BABYLON {
 }
 }
 declare module BABYLON {
 declare module BABYLON {
     /**
     /**
+     * A babylon interface for a "WebXR" feature point.
+     * Represents the position and confidence value of a given feature point.
+     */
+    export interface IWebXRFeaturePoint {
+        /**
+         * Represents the position of the feature point in world space.
+         */
+        position: Vector3;
+        /**
+         * Represents the confidence value of the feature point in world space. 0 being least confident, and 1 being most confident.
+         */
+        confidenceValue: number;
+    }
+    /**
+     * The feature point system is used to detect feature points from real world geometry.
+     * This feature is currently experimental and only supported on BabylonNative, and should not be used in the browser.
+     * The newly introduced API can be seen in webxr.nativeextensions.d.ts and described in FeaturePoints.md.
+     */
+    export class WebXRFeaturePointSystem extends WebXRAbstractFeature {
+        private _enabled;
+        private _featurePointCloud;
+        /**
+         * The module's name
+         */
+        static readonly Name: string;
+        /**
+         * The (Babylon) version of this module.
+         * This is an integer representing the implementation version.
+         * This number does not correspond to the WebXR specs version
+         */
+        static readonly Version: number;
+        /**
+        * Observers registered here will be executed whenever new feature points are added (on XRFrame while the session is tracking).
+        * Will notify the observers about which feature points have been added.
+        */
+        readonly onFeaturePointsAddedObservable: Observable<number[]>;
+        /**
+         * Observers registered here will be executed whenever a feature point has been updated (on XRFrame while the session is tracking).
+         * Will notify the observers about which feature points have been updated.
+         */
+        readonly onFeaturePointsUpdatedObservable: Observable<number[]>;
+        /**
+         * The current feature point cloud maintained across frames.
+         */
+        get featurePointCloud(): Array<IWebXRFeaturePoint>;
+        /**
+         * construct the feature point system
+         * @param _xrSessionManager an instance of xr Session manager
+         */
+        constructor(_xrSessionManager: WebXRSessionManager);
+        /**
+         * Detach this feature.
+         * Will usually be called by the features manager
+         *
+         * @returns true if successful.
+         */
+        detach(): boolean;
+        /**
+         * Dispose this feature and all of the resources attached
+         */
+        dispose(): void;
+        /**
+         * On receiving a new XR frame if this feature is attached notify observers new feature point data is available.
+         */
+        protected _onXRFrame(frame: XRFrame): void;
+        /**
+         * Initializes the feature. If the feature point feature is not available for this environment do not mark the feature as enabled.
+         */
+        private _init;
+    }
+}
+declare module BABYLON {
+    /**
      * The motion controller class for all microsoft mixed reality controllers
      * The motion controller class for all microsoft mixed reality controllers
      */
      */
     export class WebXRMicrosoftMixedRealityController extends WebXRAbstractMotionController {
     export class WebXRMicrosoftMixedRealityController extends WebXRAbstractMotionController {
@@ -75748,6 +75825,17 @@ interface XRPlane {
     polygon: Array<DOMPointReadOnly>;
     polygon: Array<DOMPointReadOnly>;
     lastChangedTime: number;
     lastChangedTime: number;
 }
 }
+// This file contains native only extensions for WebXR  These APIs are not supported in the browser yet.
+// They are intended for use with either Babylon Native https://github.com/BabylonJS/BabylonNative or
+// Babylon React Native: https://github.com/BabylonJS/BabylonReactNative
+
+interface XRSession {
+    trySetFeaturePointCloudEnabled(enabled: boolean): boolean;
+}
+
+interface XRFrame {
+    featurePointCloud? : Array<number>;
+}
 
 
 /**
 /**
  * @ignore
  * @ignore
@@ -81835,6 +81923,7 @@ declare module BABYLON.GLTF2.Loader.Extensions {
          */
          */
         enabled: boolean;
         enabled: boolean;
         private _loader;
         private _loader;
+        private _variants?;
         /** @hidden */
         /** @hidden */
         constructor(loader: GLTFLoader);
         constructor(loader: GLTFLoader);
         /** @hidden */
         /** @hidden */
@@ -81887,6 +81976,8 @@ declare module BABYLON.GLTF2.Loader.Extensions {
         getLastSelectedVariant(rootMesh: Mesh): Nullable<string | string[]>;
         getLastSelectedVariant(rootMesh: Mesh): Nullable<string | string[]>;
         private static _GetExtensionMetadata;
         private static _GetExtensionMetadata;
         /** @hidden */
         /** @hidden */
+        onLoading(): void;
+        /** @hidden */
         _loadMeshPrimitiveAsync(context: string, name: string, node: INode, mesh: IMesh, primitive: IMeshPrimitive, assign: (babylonMesh: AbstractMesh) => void): Nullable<Promise<AbstractMesh>>;
         _loadMeshPrimitiveAsync(context: string, name: string, node: INode, mesh: IMesh, primitive: IMeshPrimitive, assign: (babylonMesh: AbstractMesh) => void): Nullable<Promise<AbstractMesh>>;
     }
     }
 }
 }
@@ -84732,14 +84823,21 @@ declare module BABYLON.GLTF2 {
      */
      */
 
 
     /** @hidden */
     /** @hidden */
-    interface IKHRMaterialVariants_Mapping {
-        variants: string[];
-        material: number;
+    interface IKHRMaterialVariants_Mapping extends IProperty {
+        mapping: Array<{
+            variants: number[];
+            material: number;
+        }>;
+    }
+
+    /** @hidden */
+    interface IKHRMaterialVariants_Variant extends IProperty {
+        name: string;
     }
     }
 
 
     /** @hidden */
     /** @hidden */
-    interface IKHRMaterialVariants {
-        mapping: IKHRMaterialVariants_Mapping[];
+    interface IKHRMaterialVariants_Variants extends IChildRootProperty {
+        variants: Array<IKHRMaterialVariants_Variant>;
     }
     }
 
 
     /**
     /**

文件差異過大導致無法顯示
+ 1 - 1
dist/preview release/inspector/babylon.inspector.bundle.js


+ 2 - 8
dist/preview release/inspector/babylon.inspector.bundle.max.js

@@ -74576,9 +74576,7 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "../../node_modules/react/index.js");
 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "../../node_modules/react/index.js");
 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
 /* harmony import */ var _lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../lineContainerComponent */ "./components/actionTabs/lineContainerComponent.tsx");
 /* harmony import */ var _lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../lineContainerComponent */ "./components/actionTabs/lineContainerComponent.tsx");
-/* harmony import */ var _lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../lines/buttonLineComponent */ "./components/actionTabs/lines/buttonLineComponent.tsx");
-/* harmony import */ var _lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../lines/optionsLineComponent */ "./components/actionTabs/lines/optionsLineComponent.tsx");
-
+/* harmony import */ var _lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../lines/optionsLineComponent */ "./components/actionTabs/lines/optionsLineComponent.tsx");
 
 
 
 
 
 
@@ -74608,7 +74606,7 @@ var VariantsPropertyGridComponent = /** @class */ (function (_super) {
         options.splice(0, 0, { label: "Original", value: 0 });
         options.splice(0, 0, { label: "Original", value: 0 });
         return (react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", null,
         return (react__WEBPACK_IMPORTED_MODULE_1__["createElement"]("div", null,
             react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__["LineContainerComponent"], { globalState: this.props.globalState, title: "VARIANTS" },
             react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lineContainerComponent__WEBPACK_IMPORTED_MODULE_2__["LineContainerComponent"], { globalState: this.props.globalState, title: "VARIANTS" },
-                react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_4__["OptionsLineComponent"], { label: "Active variant", options: options, noDirectUpdate: true, target: this.props.host, propertyName: "", onSelect: function (value) {
+                react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_optionsLineComponent__WEBPACK_IMPORTED_MODULE_3__["OptionsLineComponent"], { label: "Active variant", options: options, noDirectUpdate: true, target: this.props.host, propertyName: "", onSelect: function (value) {
                         if (value === 0) {
                         if (value === 0) {
                             extension.reset(_this.props.host);
                             extension.reset(_this.props.host);
                         }
                         }
@@ -74626,10 +74624,6 @@ var VariantsPropertyGridComponent = /** @class */ (function (_super) {
                             }
                             }
                         }
                         }
                         return index;
                         return index;
-                    } }),
-                react__WEBPACK_IMPORTED_MODULE_1__["createElement"](_lines_buttonLineComponent__WEBPACK_IMPORTED_MODULE_3__["ButtonLineComponent"], { label: "Reset", onClick: function () {
-                        extension.reset(_this.props.host);
-                        _this.forceUpdate();
                     } }))));
                     } }))));
     };
     };
     return VariantsPropertyGridComponent;
     return VariantsPropertyGridComponent;

文件差異過大導致無法顯示
+ 1 - 1
dist/preview release/inspector/babylon.inspector.bundle.max.js.map


+ 14 - 5
dist/preview release/loaders/babylon.glTF2FileLoader.js

@@ -1389,6 +1389,14 @@ var KHR_materials_variants = /** @class */ (function () {
         return ((_b = (_a = rootMesh === null || rootMesh === void 0 ? void 0 : rootMesh.metadata) === null || _a === void 0 ? void 0 : _a.gltf) === null || _b === void 0 ? void 0 : _b[NAME]) || null;
         return ((_b = (_a = rootMesh === null || rootMesh === void 0 ? void 0 : rootMesh.metadata) === null || _a === void 0 ? void 0 : _a.gltf) === null || _b === void 0 ? void 0 : _b[NAME]) || null;
     };
     };
     /** @hidden */
     /** @hidden */
+    KHR_materials_variants.prototype.onLoading = function () {
+        var extensions = this._loader.gltf.extensions;
+        if (extensions && extensions[this.name]) {
+            var extension = extensions[this.name];
+            this._variants = extension.variants;
+        }
+    };
+    /** @hidden */
     KHR_materials_variants.prototype._loadMeshPrimitiveAsync = function (context, name, node, mesh, primitive, assign) {
     KHR_materials_variants.prototype._loadMeshPrimitiveAsync = function (context, name, node, mesh, primitive, assign) {
         var _this = this;
         var _this = this;
         return _glTFLoader__WEBPACK_IMPORTED_MODULE_0__["GLTFLoader"].LoadExtensionAsync(context, primitive, this.name, function (extensionContext, extension) {
         return _glTFLoader__WEBPACK_IMPORTED_MODULE_0__["GLTFLoader"].LoadExtensionAsync(context, primitive, this.name, function (extensionContext, extension) {
@@ -1407,19 +1415,20 @@ var KHR_materials_variants = /** @class */ (function () {
                     var variants_1 = extensionMetadata.variants;
                     var variants_1 = extensionMetadata.variants;
                     for (var _i = 0, _a = extension.mapping; _i < _a.length; _i++) {
                     for (var _i = 0, _a = extension.mapping; _i < _a.length; _i++) {
                         var mapping = _a[_i];
                         var mapping = _a[_i];
-                        var _loop_1 = function (variant) {
+                        var _loop_1 = function (variantIndex) {
+                            var variant = _glTFLoader__WEBPACK_IMPORTED_MODULE_0__["ArrayItem"].Get(extensionContext + "/mapping/" + variantIndex, _this._variants, variantIndex);
                             var material = _glTFLoader__WEBPACK_IMPORTED_MODULE_0__["ArrayItem"].Get("#/materials/", _this._loader.gltf.materials, mapping.material);
                             var material = _glTFLoader__WEBPACK_IMPORTED_MODULE_0__["ArrayItem"].Get("#/materials/", _this._loader.gltf.materials, mapping.material);
                             promises.push(_this._loader._loadMaterialAsync("#/materials/" + mapping.material, material, babylonMesh, babylonDrawMode, function (babylonMaterial) {
                             promises.push(_this._loader._loadMaterialAsync("#/materials/" + mapping.material, material, babylonMesh, babylonDrawMode, function (babylonMaterial) {
-                                variants_1[variant] = variants_1[variant] || [];
-                                variants_1[variant].push({
+                                variants_1[variant.name] = variants_1[variant.name] || [];
+                                variants_1[variant.name].push({
                                     mesh: babylonMesh,
                                     mesh: babylonMesh,
                                     material: babylonMaterial
                                     material: babylonMaterial
                                 });
                                 });
                             }));
                             }));
                         };
                         };
                         for (var _b = 0, _c = mapping.variants; _b < _c.length; _b++) {
                         for (var _b = 0, _c = mapping.variants; _b < _c.length; _b++) {
-                            var variant = _c[_b];
-                            _loop_1(variant);
+                            var variantIndex = _c[_b];
+                            _loop_1(variantIndex);
                         }
                         }
                     }
                     }
                 }
                 }

文件差異過大導致無法顯示
+ 1 - 1
dist/preview release/loaders/babylon.glTF2FileLoader.js.map


文件差異過大導致無法顯示
+ 1 - 1
dist/preview release/loaders/babylon.glTF2FileLoader.min.js


+ 14 - 5
dist/preview release/loaders/babylon.glTFFileLoader.js

@@ -4003,6 +4003,14 @@ var KHR_materials_variants = /** @class */ (function () {
         return ((_b = (_a = rootMesh === null || rootMesh === void 0 ? void 0 : rootMesh.metadata) === null || _a === void 0 ? void 0 : _a.gltf) === null || _b === void 0 ? void 0 : _b[NAME]) || null;
         return ((_b = (_a = rootMesh === null || rootMesh === void 0 ? void 0 : rootMesh.metadata) === null || _a === void 0 ? void 0 : _a.gltf) === null || _b === void 0 ? void 0 : _b[NAME]) || null;
     };
     };
     /** @hidden */
     /** @hidden */
+    KHR_materials_variants.prototype.onLoading = function () {
+        var extensions = this._loader.gltf.extensions;
+        if (extensions && extensions[this.name]) {
+            var extension = extensions[this.name];
+            this._variants = extension.variants;
+        }
+    };
+    /** @hidden */
     KHR_materials_variants.prototype._loadMeshPrimitiveAsync = function (context, name, node, mesh, primitive, assign) {
     KHR_materials_variants.prototype._loadMeshPrimitiveAsync = function (context, name, node, mesh, primitive, assign) {
         var _this = this;
         var _this = this;
         return _glTFLoader__WEBPACK_IMPORTED_MODULE_0__["GLTFLoader"].LoadExtensionAsync(context, primitive, this.name, function (extensionContext, extension) {
         return _glTFLoader__WEBPACK_IMPORTED_MODULE_0__["GLTFLoader"].LoadExtensionAsync(context, primitive, this.name, function (extensionContext, extension) {
@@ -4021,19 +4029,20 @@ var KHR_materials_variants = /** @class */ (function () {
                     var variants_1 = extensionMetadata.variants;
                     var variants_1 = extensionMetadata.variants;
                     for (var _i = 0, _a = extension.mapping; _i < _a.length; _i++) {
                     for (var _i = 0, _a = extension.mapping; _i < _a.length; _i++) {
                         var mapping = _a[_i];
                         var mapping = _a[_i];
-                        var _loop_1 = function (variant) {
+                        var _loop_1 = function (variantIndex) {
+                            var variant = _glTFLoader__WEBPACK_IMPORTED_MODULE_0__["ArrayItem"].Get(extensionContext + "/mapping/" + variantIndex, _this._variants, variantIndex);
                             var material = _glTFLoader__WEBPACK_IMPORTED_MODULE_0__["ArrayItem"].Get("#/materials/", _this._loader.gltf.materials, mapping.material);
                             var material = _glTFLoader__WEBPACK_IMPORTED_MODULE_0__["ArrayItem"].Get("#/materials/", _this._loader.gltf.materials, mapping.material);
                             promises.push(_this._loader._loadMaterialAsync("#/materials/" + mapping.material, material, babylonMesh, babylonDrawMode, function (babylonMaterial) {
                             promises.push(_this._loader._loadMaterialAsync("#/materials/" + mapping.material, material, babylonMesh, babylonDrawMode, function (babylonMaterial) {
-                                variants_1[variant] = variants_1[variant] || [];
-                                variants_1[variant].push({
+                                variants_1[variant.name] = variants_1[variant.name] || [];
+                                variants_1[variant.name].push({
                                     mesh: babylonMesh,
                                     mesh: babylonMesh,
                                     material: babylonMaterial
                                     material: babylonMaterial
                                 });
                                 });
                             }));
                             }));
                         };
                         };
                         for (var _b = 0, _c = mapping.variants; _b < _c.length; _b++) {
                         for (var _b = 0, _c = mapping.variants; _b < _c.length; _b++) {
-                            var variant = _c[_b];
-                            _loop_1(variant);
+                            var variantIndex = _c[_b];
+                            _loop_1(variantIndex);
                         }
                         }
                     }
                     }
                 }
                 }

文件差異過大導致無法顯示
+ 1 - 1
dist/preview release/loaders/babylon.glTFFileLoader.js.map


文件差異過大導致無法顯示
+ 1 - 1
dist/preview release/loaders/babylon.glTFFileLoader.min.js


+ 3 - 0
dist/preview release/loaders/babylonjs.loaders.d.ts

@@ -1960,6 +1960,7 @@ declare module BABYLON.GLTF2.Loader.Extensions {
          */
          */
         enabled: boolean;
         enabled: boolean;
         private _loader;
         private _loader;
+        private _variants?;
         /** @hidden */
         /** @hidden */
         constructor(loader: GLTFLoader);
         constructor(loader: GLTFLoader);
         /** @hidden */
         /** @hidden */
@@ -2012,6 +2013,8 @@ declare module BABYLON.GLTF2.Loader.Extensions {
         getLastSelectedVariant(rootMesh: Mesh): Nullable<string | string[]>;
         getLastSelectedVariant(rootMesh: Mesh): Nullable<string | string[]>;
         private static _GetExtensionMetadata;
         private static _GetExtensionMetadata;
         /** @hidden */
         /** @hidden */
+        onLoading(): void;
+        /** @hidden */
         _loadMeshPrimitiveAsync(context: string, name: string, node: INode, mesh: IMesh, primitive: IMeshPrimitive, assign: (babylonMesh: AbstractMesh) => void): Nullable<Promise<AbstractMesh>>;
         _loadMeshPrimitiveAsync(context: string, name: string, node: INode, mesh: IMesh, primitive: IMeshPrimitive, assign: (babylonMesh: AbstractMesh) => void): Nullable<Promise<AbstractMesh>>;
     }
     }
 }
 }

+ 14 - 5
dist/preview release/loaders/babylonjs.loaders.js

@@ -5383,6 +5383,14 @@ var KHR_materials_variants = /** @class */ (function () {
         return ((_b = (_a = rootMesh === null || rootMesh === void 0 ? void 0 : rootMesh.metadata) === null || _a === void 0 ? void 0 : _a.gltf) === null || _b === void 0 ? void 0 : _b[NAME]) || null;
         return ((_b = (_a = rootMesh === null || rootMesh === void 0 ? void 0 : rootMesh.metadata) === null || _a === void 0 ? void 0 : _a.gltf) === null || _b === void 0 ? void 0 : _b[NAME]) || null;
     };
     };
     /** @hidden */
     /** @hidden */
+    KHR_materials_variants.prototype.onLoading = function () {
+        var extensions = this._loader.gltf.extensions;
+        if (extensions && extensions[this.name]) {
+            var extension = extensions[this.name];
+            this._variants = extension.variants;
+        }
+    };
+    /** @hidden */
     KHR_materials_variants.prototype._loadMeshPrimitiveAsync = function (context, name, node, mesh, primitive, assign) {
     KHR_materials_variants.prototype._loadMeshPrimitiveAsync = function (context, name, node, mesh, primitive, assign) {
         var _this = this;
         var _this = this;
         return _glTFLoader__WEBPACK_IMPORTED_MODULE_0__["GLTFLoader"].LoadExtensionAsync(context, primitive, this.name, function (extensionContext, extension) {
         return _glTFLoader__WEBPACK_IMPORTED_MODULE_0__["GLTFLoader"].LoadExtensionAsync(context, primitive, this.name, function (extensionContext, extension) {
@@ -5401,19 +5409,20 @@ var KHR_materials_variants = /** @class */ (function () {
                     var variants_1 = extensionMetadata.variants;
                     var variants_1 = extensionMetadata.variants;
                     for (var _i = 0, _a = extension.mapping; _i < _a.length; _i++) {
                     for (var _i = 0, _a = extension.mapping; _i < _a.length; _i++) {
                         var mapping = _a[_i];
                         var mapping = _a[_i];
-                        var _loop_1 = function (variant) {
+                        var _loop_1 = function (variantIndex) {
+                            var variant = _glTFLoader__WEBPACK_IMPORTED_MODULE_0__["ArrayItem"].Get(extensionContext + "/mapping/" + variantIndex, _this._variants, variantIndex);
                             var material = _glTFLoader__WEBPACK_IMPORTED_MODULE_0__["ArrayItem"].Get("#/materials/", _this._loader.gltf.materials, mapping.material);
                             var material = _glTFLoader__WEBPACK_IMPORTED_MODULE_0__["ArrayItem"].Get("#/materials/", _this._loader.gltf.materials, mapping.material);
                             promises.push(_this._loader._loadMaterialAsync("#/materials/" + mapping.material, material, babylonMesh, babylonDrawMode, function (babylonMaterial) {
                             promises.push(_this._loader._loadMaterialAsync("#/materials/" + mapping.material, material, babylonMesh, babylonDrawMode, function (babylonMaterial) {
-                                variants_1[variant] = variants_1[variant] || [];
-                                variants_1[variant].push({
+                                variants_1[variant.name] = variants_1[variant.name] || [];
+                                variants_1[variant.name].push({
                                     mesh: babylonMesh,
                                     mesh: babylonMesh,
                                     material: babylonMaterial
                                     material: babylonMaterial
                                 });
                                 });
                             }));
                             }));
                         };
                         };
                         for (var _b = 0, _c = mapping.variants; _b < _c.length; _b++) {
                         for (var _b = 0, _c = mapping.variants; _b < _c.length; _b++) {
-                            var variant = _c[_b];
-                            _loop_1(variant);
+                            var variantIndex = _c[_b];
+                            _loop_1(variantIndex);
                         }
                         }
                     }
                     }
                 }
                 }

文件差異過大導致無法顯示
+ 1 - 1
dist/preview release/loaders/babylonjs.loaders.js.map


文件差異過大導致無法顯示
+ 1 - 1
dist/preview release/loaders/babylonjs.loaders.min.js


+ 6 - 0
dist/preview release/loaders/babylonjs.loaders.module.d.ts

@@ -2115,6 +2115,7 @@ declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_materials_variants" {
          */
          */
         enabled: boolean;
         enabled: boolean;
         private _loader;
         private _loader;
+        private _variants?;
         /** @hidden */
         /** @hidden */
         constructor(loader: GLTFLoader);
         constructor(loader: GLTFLoader);
         /** @hidden */
         /** @hidden */
@@ -2167,6 +2168,8 @@ declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_materials_variants" {
         getLastSelectedVariant(rootMesh: Mesh): Nullable<string | string[]>;
         getLastSelectedVariant(rootMesh: Mesh): Nullable<string | string[]>;
         private static _GetExtensionMetadata;
         private static _GetExtensionMetadata;
         /** @hidden */
         /** @hidden */
+        onLoading(): void;
+        /** @hidden */
         _loadMeshPrimitiveAsync(context: string, name: string, node: INode, mesh: IMesh, primitive: IMeshPrimitive, assign: (babylonMesh: AbstractMesh) => void): Nullable<Promise<AbstractMesh>>;
         _loadMeshPrimitiveAsync(context: string, name: string, node: INode, mesh: IMesh, primitive: IMeshPrimitive, assign: (babylonMesh: AbstractMesh) => void): Nullable<Promise<AbstractMesh>>;
     }
     }
 }
 }
@@ -4853,6 +4856,7 @@ declare module BABYLON.GLTF2.Loader.Extensions {
          */
          */
         enabled: boolean;
         enabled: boolean;
         private _loader;
         private _loader;
+        private _variants?;
         /** @hidden */
         /** @hidden */
         constructor(loader: GLTFLoader);
         constructor(loader: GLTFLoader);
         /** @hidden */
         /** @hidden */
@@ -4905,6 +4909,8 @@ declare module BABYLON.GLTF2.Loader.Extensions {
         getLastSelectedVariant(rootMesh: Mesh): Nullable<string | string[]>;
         getLastSelectedVariant(rootMesh: Mesh): Nullable<string | string[]>;
         private static _GetExtensionMetadata;
         private static _GetExtensionMetadata;
         /** @hidden */
         /** @hidden */
+        onLoading(): void;
+        /** @hidden */
         _loadMeshPrimitiveAsync(context: string, name: string, node: INode, mesh: IMesh, primitive: IMeshPrimitive, assign: (babylonMesh: AbstractMesh) => void): Nullable<Promise<AbstractMesh>>;
         _loadMeshPrimitiveAsync(context: string, name: string, node: INode, mesh: IMesh, primitive: IMeshPrimitive, assign: (babylonMesh: AbstractMesh) => void): Nullable<Promise<AbstractMesh>>;
     }
     }
 }
 }

+ 200 - 30
dist/preview release/viewer/babylon.module.d.ts

@@ -48868,31 +48868,35 @@ declare module "babylonjs/XR/webXRFeaturesManager" {
         /**
         /**
          * The name of the anchor system feature
          * The name of the anchor system feature
          */
          */
-        static ANCHOR_SYSTEM: string;
+        static readonly ANCHOR_SYSTEM: string;
         /**
         /**
          * The name of the background remover feature
          * The name of the background remover feature
          */
          */
-        static BACKGROUND_REMOVER: string;
+        static readonly BACKGROUND_REMOVER: string;
         /**
         /**
          * The name of the hit test feature
          * The name of the hit test feature
          */
          */
-        static HIT_TEST: string;
+        static readonly HIT_TEST: string;
         /**
         /**
          * physics impostors for xr controllers feature
          * physics impostors for xr controllers feature
          */
          */
-        static PHYSICS_CONTROLLERS: string;
+        static readonly PHYSICS_CONTROLLERS: string;
         /**
         /**
          * The name of the plane detection feature
          * The name of the plane detection feature
          */
          */
-        static PLANE_DETECTION: string;
+        static readonly PLANE_DETECTION: string;
         /**
         /**
          * The name of the pointer selection feature
          * The name of the pointer selection feature
          */
          */
-        static POINTER_SELECTION: string;
+        static readonly POINTER_SELECTION: string;
         /**
         /**
          * The name of the teleportation feature
          * The name of the teleportation feature
          */
          */
-        static TELEPORTATION: string;
+        static readonly TELEPORTATION: string;
+        /**
+         * The name of the feature points feature.
+         */
+        static readonly FEATURE_POINTS: string;
     }
     }
     /**
     /**
      * Defining the constructor of a feature. Used to register the modules.
      * Defining the constructor of a feature. Used to register the modules.
@@ -50670,7 +50674,7 @@ declare module "babylonjs/XR/features/WebXRControllerPointerSelection" {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -51218,7 +51222,7 @@ declare module "babylonjs/XR/features/WebXRControllerTeleportation" {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -78263,7 +78267,7 @@ declare module "babylonjs/XR/features/WebXRHitTestLegacy" {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -78410,7 +78414,7 @@ declare module "babylonjs/XR/features/WebXRHitTest" {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -78518,7 +78522,7 @@ declare module "babylonjs/XR/features/WebXRAnchorSystem" {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -78654,7 +78658,7 @@ declare module "babylonjs/XR/features/WebXRPlaneDetector" {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -78744,7 +78748,7 @@ declare module "babylonjs/XR/features/WebXRBackgroundRemover" {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -78880,7 +78884,7 @@ declare module "babylonjs/XR/features/WebXRControllerPhysics" {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -78947,6 +78951,83 @@ declare module "babylonjs/XR/features/WebXRControllerPhysics" {
         private _detachController;
         private _detachController;
     }
     }
 }
 }
+declare module "babylonjs/XR/features/WebXRFeaturePointSystem" {
+    import { WebXRSessionManager } from "babylonjs/XR/webXRSessionManager";
+    import { Observable } from "babylonjs/Misc/observable";
+    import { Vector3 } from "babylonjs/Maths/math.vector";
+    import { WebXRAbstractFeature } from "babylonjs/XR/features/WebXRAbstractFeature";
+    /**
+     * A babylon interface for a "WebXR" feature point.
+     * Represents the position and confidence value of a given feature point.
+     */
+    export interface IWebXRFeaturePoint {
+        /**
+         * Represents the position of the feature point in world space.
+         */
+        position: Vector3;
+        /**
+         * Represents the confidence value of the feature point in world space. 0 being least confident, and 1 being most confident.
+         */
+        confidenceValue: number;
+    }
+    /**
+     * The feature point system is used to detect feature points from real world geometry.
+     * This feature is currently experimental and only supported on BabylonNative, and should not be used in the browser.
+     * The newly introduced API can be seen in webxr.nativeextensions.d.ts and described in FeaturePoints.md.
+     */
+    export class WebXRFeaturePointSystem extends WebXRAbstractFeature {
+        private _enabled;
+        private _featurePointCloud;
+        /**
+         * The module's name
+         */
+        static readonly Name: string;
+        /**
+         * The (Babylon) version of this module.
+         * This is an integer representing the implementation version.
+         * This number does not correspond to the WebXR specs version
+         */
+        static readonly Version: number;
+        /**
+        * Observers registered here will be executed whenever new feature points are added (on XRFrame while the session is tracking).
+        * Will notify the observers about which feature points have been added.
+        */
+        readonly onFeaturePointsAddedObservable: Observable<number[]>;
+        /**
+         * Observers registered here will be executed whenever a feature point has been updated (on XRFrame while the session is tracking).
+         * Will notify the observers about which feature points have been updated.
+         */
+        readonly onFeaturePointsUpdatedObservable: Observable<number[]>;
+        /**
+         * The current feature point cloud maintained across frames.
+         */
+        get featurePointCloud(): Array<IWebXRFeaturePoint>;
+        /**
+         * construct the feature point system
+         * @param _xrSessionManager an instance of xr Session manager
+         */
+        constructor(_xrSessionManager: WebXRSessionManager);
+        /**
+         * Detach this feature.
+         * Will usually be called by the features manager
+         *
+         * @returns true if successful.
+         */
+        detach(): boolean;
+        /**
+         * Dispose this feature and all of the resources attached
+         */
+        dispose(): void;
+        /**
+         * On receiving a new XR frame if this feature is attached notify observers new feature point data is available.
+         */
+        protected _onXRFrame(frame: XRFrame): void;
+        /**
+         * Initializes the feature. If the feature point feature is not available for this environment do not mark the feature as enabled.
+         */
+        private _init;
+    }
+}
 declare module "babylonjs/XR/features/index" {
 declare module "babylonjs/XR/features/index" {
     export * from "babylonjs/XR/features/WebXRHitTestLegacy";
     export * from "babylonjs/XR/features/WebXRHitTestLegacy";
     export * from "babylonjs/XR/features/WebXRAnchorSystem";
     export * from "babylonjs/XR/features/WebXRAnchorSystem";
@@ -78956,6 +79037,7 @@ declare module "babylonjs/XR/features/index" {
     export * from "babylonjs/XR/features/WebXRControllerPointerSelection";
     export * from "babylonjs/XR/features/WebXRControllerPointerSelection";
     export * from "babylonjs/XR/features/WebXRControllerPhysics";
     export * from "babylonjs/XR/features/WebXRControllerPhysics";
     export * from "babylonjs/XR/features/WebXRHitTest";
     export * from "babylonjs/XR/features/WebXRHitTest";
+    export * from "babylonjs/XR/features/WebXRFeaturePointSystem";
 }
 }
 declare module "babylonjs/XR/motionController/webXRMicrosoftMixedRealityController" {
 declare module "babylonjs/XR/motionController/webXRMicrosoftMixedRealityController" {
     import { WebXRAbstractMotionController, IMinimalMotionControllerObject, MotionControllerHandedness } from "babylonjs/XR/motionController/webXRAbstractMotionController";
     import { WebXRAbstractMotionController, IMinimalMotionControllerObject, MotionControllerHandedness } from "babylonjs/XR/motionController/webXRAbstractMotionController";
@@ -126390,31 +126472,35 @@ declare module BABYLON {
         /**
         /**
          * The name of the anchor system feature
          * The name of the anchor system feature
          */
          */
-        static ANCHOR_SYSTEM: string;
+        static readonly ANCHOR_SYSTEM: string;
         /**
         /**
          * The name of the background remover feature
          * The name of the background remover feature
          */
          */
-        static BACKGROUND_REMOVER: string;
+        static readonly BACKGROUND_REMOVER: string;
         /**
         /**
          * The name of the hit test feature
          * The name of the hit test feature
          */
          */
-        static HIT_TEST: string;
+        static readonly HIT_TEST: string;
         /**
         /**
          * physics impostors for xr controllers feature
          * physics impostors for xr controllers feature
          */
          */
-        static PHYSICS_CONTROLLERS: string;
+        static readonly PHYSICS_CONTROLLERS: string;
         /**
         /**
          * The name of the plane detection feature
          * The name of the plane detection feature
          */
          */
-        static PLANE_DETECTION: string;
+        static readonly PLANE_DETECTION: string;
         /**
         /**
          * The name of the pointer selection feature
          * The name of the pointer selection feature
          */
          */
-        static POINTER_SELECTION: string;
+        static readonly POINTER_SELECTION: string;
         /**
         /**
          * The name of the teleportation feature
          * The name of the teleportation feature
          */
          */
-        static TELEPORTATION: string;
+        static readonly TELEPORTATION: string;
+        /**
+         * The name of the feature points feature.
+         */
+        static readonly FEATURE_POINTS: string;
     }
     }
     /**
     /**
      * Defining the constructor of a feature. Used to register the modules.
      * Defining the constructor of a feature. Used to register the modules.
@@ -128127,7 +128213,7 @@ declare module BABYLON {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -128654,7 +128740,7 @@ declare module BABYLON {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -153423,7 +153509,7 @@ declare module BABYLON {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -153565,7 +153651,7 @@ declare module BABYLON {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -153667,7 +153753,7 @@ declare module BABYLON {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -153798,7 +153884,7 @@ declare module BABYLON {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -153884,7 +153970,7 @@ declare module BABYLON {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -154014,7 +154100,7 @@ declare module BABYLON {
         /**
         /**
          * The module's name
          * The module's name
          */
          */
-        static readonly Name: string;
+        static readonly Name: string;
         /**
         /**
          * The (Babylon) version of this module.
          * The (Babylon) version of this module.
          * This is an integer representing the implementation version.
          * This is an integer representing the implementation version.
@@ -154083,6 +154169,79 @@ declare module BABYLON {
 }
 }
 declare module BABYLON {
 declare module BABYLON {
     /**
     /**
+     * A babylon interface for a "WebXR" feature point.
+     * Represents the position and confidence value of a given feature point.
+     */
+    export interface IWebXRFeaturePoint {
+        /**
+         * Represents the position of the feature point in world space.
+         */
+        position: Vector3;
+        /**
+         * Represents the confidence value of the feature point in world space. 0 being least confident, and 1 being most confident.
+         */
+        confidenceValue: number;
+    }
+    /**
+     * The feature point system is used to detect feature points from real world geometry.
+     * This feature is currently experimental and only supported on BabylonNative, and should not be used in the browser.
+     * The newly introduced API can be seen in webxr.nativeextensions.d.ts and described in FeaturePoints.md.
+     */
+    export class WebXRFeaturePointSystem extends WebXRAbstractFeature {
+        private _enabled;
+        private _featurePointCloud;
+        /**
+         * The module's name
+         */
+        static readonly Name: string;
+        /**
+         * The (Babylon) version of this module.
+         * This is an integer representing the implementation version.
+         * This number does not correspond to the WebXR specs version
+         */
+        static readonly Version: number;
+        /**
+        * Observers registered here will be executed whenever new feature points are added (on XRFrame while the session is tracking).
+        * Will notify the observers about which feature points have been added.
+        */
+        readonly onFeaturePointsAddedObservable: Observable<number[]>;
+        /**
+         * Observers registered here will be executed whenever a feature point has been updated (on XRFrame while the session is tracking).
+         * Will notify the observers about which feature points have been updated.
+         */
+        readonly onFeaturePointsUpdatedObservable: Observable<number[]>;
+        /**
+         * The current feature point cloud maintained across frames.
+         */
+        get featurePointCloud(): Array<IWebXRFeaturePoint>;
+        /**
+         * construct the feature point system
+         * @param _xrSessionManager an instance of xr Session manager
+         */
+        constructor(_xrSessionManager: WebXRSessionManager);
+        /**
+         * Detach this feature.
+         * Will usually be called by the features manager
+         *
+         * @returns true if successful.
+         */
+        detach(): boolean;
+        /**
+         * Dispose this feature and all of the resources attached
+         */
+        dispose(): void;
+        /**
+         * On receiving a new XR frame if this feature is attached notify observers new feature point data is available.
+         */
+        protected _onXRFrame(frame: XRFrame): void;
+        /**
+         * Initializes the feature. If the feature point feature is not available for this environment do not mark the feature as enabled.
+         */
+        private _init;
+    }
+}
+declare module BABYLON {
+    /**
      * The motion controller class for all microsoft mixed reality controllers
      * The motion controller class for all microsoft mixed reality controllers
      */
      */
     export class WebXRMicrosoftMixedRealityController extends WebXRAbstractMotionController {
     export class WebXRMicrosoftMixedRealityController extends WebXRAbstractMotionController {
@@ -155047,4 +155206,15 @@ interface XRPlane {
     planeSpace: XRSpace;
     planeSpace: XRSpace;
     polygon: Array<DOMPointReadOnly>;
     polygon: Array<DOMPointReadOnly>;
     lastChangedTime: number;
     lastChangedTime: number;
+}
+// This file contains native only extensions for WebXR  These APIs are not supported in the browser yet.
+// They are intended for use with either Babylon Native https://github.com/BabylonJS/BabylonNative or
+// Babylon React Native: https://github.com/BabylonJS/BabylonReactNative
+
+interface XRSession {
+    trySetFeaturePointCloudEnabled(enabled: boolean): boolean;
+}
+
+interface XRFrame {
+    featurePointCloud? : Array<number>;
 }
 }

文件差異過大導致無法顯示
+ 12 - 8
dist/preview release/viewer/babylon.viewer.js


文件差異過大導致無法顯示
+ 2 - 2
dist/preview release/viewer/babylon.viewer.max.js


+ 6 - 0
dist/preview release/viewer/babylonjs.loaders.module.d.ts

@@ -2115,6 +2115,7 @@ declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_materials_variants" {
          */
          */
         enabled: boolean;
         enabled: boolean;
         private _loader;
         private _loader;
+        private _variants?;
         /** @hidden */
         /** @hidden */
         constructor(loader: GLTFLoader);
         constructor(loader: GLTFLoader);
         /** @hidden */
         /** @hidden */
@@ -2167,6 +2168,8 @@ declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_materials_variants" {
         getLastSelectedVariant(rootMesh: Mesh): Nullable<string | string[]>;
         getLastSelectedVariant(rootMesh: Mesh): Nullable<string | string[]>;
         private static _GetExtensionMetadata;
         private static _GetExtensionMetadata;
         /** @hidden */
         /** @hidden */
+        onLoading(): void;
+        /** @hidden */
         _loadMeshPrimitiveAsync(context: string, name: string, node: INode, mesh: IMesh, primitive: IMeshPrimitive, assign: (babylonMesh: AbstractMesh) => void): Nullable<Promise<AbstractMesh>>;
         _loadMeshPrimitiveAsync(context: string, name: string, node: INode, mesh: IMesh, primitive: IMeshPrimitive, assign: (babylonMesh: AbstractMesh) => void): Nullable<Promise<AbstractMesh>>;
     }
     }
 }
 }
@@ -4853,6 +4856,7 @@ declare module BABYLON.GLTF2.Loader.Extensions {
          */
          */
         enabled: boolean;
         enabled: boolean;
         private _loader;
         private _loader;
+        private _variants?;
         /** @hidden */
         /** @hidden */
         constructor(loader: GLTFLoader);
         constructor(loader: GLTFLoader);
         /** @hidden */
         /** @hidden */
@@ -4905,6 +4909,8 @@ declare module BABYLON.GLTF2.Loader.Extensions {
         getLastSelectedVariant(rootMesh: Mesh): Nullable<string | string[]>;
         getLastSelectedVariant(rootMesh: Mesh): Nullable<string | string[]>;
         private static _GetExtensionMetadata;
         private static _GetExtensionMetadata;
         /** @hidden */
         /** @hidden */
+        onLoading(): void;
+        /** @hidden */
         _loadMeshPrimitiveAsync(context: string, name: string, node: INode, mesh: IMesh, primitive: IMeshPrimitive, assign: (babylonMesh: AbstractMesh) => void): Nullable<Promise<AbstractMesh>>;
         _loadMeshPrimitiveAsync(context: string, name: string, node: INode, mesh: IMesh, primitive: IMeshPrimitive, assign: (babylonMesh: AbstractMesh) => void): Nullable<Promise<AbstractMesh>>;
     }
     }
 }
 }

+ 0 - 5
inspector/src/components/actionTabs/tabs/propertyGrids/variantsPropertyGridComponent.tsx

@@ -7,7 +7,6 @@ import { PropertyChangedEvent } from "../../../propertyChangedEvent";
 import { LineContainerComponent } from "../../lineContainerComponent";
 import { LineContainerComponent } from "../../lineContainerComponent";
 import { LockObject } from "./lockObject";
 import { LockObject } from "./lockObject";
 import { GlobalState } from "../../../globalState";
 import { GlobalState } from "../../../globalState";
-import { ButtonLineComponent } from '../../lines/buttonLineComponent';
 import { OptionsLineComponent } from '../../lines/optionsLineComponent';
 import { OptionsLineComponent } from '../../lines/optionsLineComponent';
 
 
 declare type KHR_materials_variants = import("babylonjs-loaders/glTF/2.0/Extensions/KHR_materials_variants").KHR_materials_variants;
 declare type KHR_materials_variants = import("babylonjs-loaders/glTF/2.0/Extensions/KHR_materials_variants").KHR_materials_variants;
@@ -74,10 +73,6 @@ export class VariantsPropertyGridComponent extends React.Component<IVariantsProp
                         return index;
                         return index;
                     }}
                     }}
                 />
                 />
-                    <ButtonLineComponent label="Reset" onClick={() => {
-                        extension.reset(this.props.host);
-                        this.forceUpdate();
-                    }} />
                 </LineContainerComponent>
                 </LineContainerComponent>
             </div>
             </div>
         );
         );

+ 2 - 0
src/Lights/Shadows/cascadedShadowGenerator.ts

@@ -826,6 +826,8 @@ export class CascadedShadowGenerator extends ShadowGenerator {
 
 
         const world = mesh.getWorldMatrix();
         const world = mesh.getWorldMatrix();
 
 
+        effect.setMatrix(matriceNames?.world ?? "world", world);
+
         world.multiplyToRef(this.getCascadeTransformMatrix(this._currentLayer)!, tmpMatrix);
         world.multiplyToRef(this.getCascadeTransformMatrix(this._currentLayer)!, tmpMatrix);
 
 
         effect.setMatrix(matriceNames?.worldViewProjection ?? "worldViewProjection", tmpMatrix);
         effect.setMatrix(matriceNames?.worldViewProjection ?? "worldViewProjection", tmpMatrix);

+ 1 - 1
src/Meshes/thinInstanceMesh.ts

@@ -301,7 +301,7 @@ Mesh.prototype.thinInstanceRefreshBoundingInfo = function(forceRefreshParentInfo
         }
         }
     }
     }
 
 
-    boundingInfo.reConstruct(TmpVectors.Vector3[0], TmpVectors.Vector3[1]);
+    boundingInfo.reConstruct(TmpVectors.Vector3[0], TmpVectors.Vector3[1], this.getWorldMatrix());
 };
 };
 
 
 Mesh.prototype._thinInstanceUpdateBufferSize = function(kind: string, numInstances: number = 1) {
 Mesh.prototype._thinInstanceUpdateBufferSize = function(kind: string, numInstances: number = 1) {