Jelajahi Sumber

Merge pull request #7370 from BabylonJS/master

Nightly
David Catuhe 5 tahun lalu
induk
melakukan
4d7e9b9644

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

@@ -42484,11 +42484,6 @@ declare module BABYLON {
         private _updateNumberOfRigCameras;
         /** @hidden */
         _updateForDualEyeDebugging(): void;
-        /**
-         * Updates the cameras position from the current pose information of the  XR session
-         * @param xrSessionManager the session containing pose information
-         */
-        update(): void;
         private _updateReferenceSpace;
         private _updateReferenceSpaceOffset;
         private _updateFromXRSession;

File diff ditekan karena terlalu besar
+ 1 - 1
dist/preview release/babylon.js


File diff ditekan karena terlalu besar
+ 20 - 24
dist/preview release/babylon.max.js


File diff ditekan karena terlalu besar
+ 1 - 1
dist/preview release/babylon.max.js.map


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

@@ -43963,11 +43963,6 @@ declare module "babylonjs/Cameras/XR/webXRCamera" {
         private _updateNumberOfRigCameras;
         /** @hidden */
         _updateForDualEyeDebugging(): void;
-        /**
-         * Updates the cameras position from the current pose information of the  XR session
-         * @param xrSessionManager the session containing pose information
-         */
-        update(): void;
         private _updateReferenceSpace;
         private _updateReferenceSpaceOffset;
         private _updateFromXRSession;
@@ -113889,11 +113884,6 @@ declare module BABYLON {
         private _updateNumberOfRigCameras;
         /** @hidden */
         _updateForDualEyeDebugging(): void;
-        /**
-         * Updates the cameras position from the current pose information of the  XR session
-         * @param xrSessionManager the session containing pose information
-         */
-        update(): void;
         private _updateReferenceSpace;
         private _updateReferenceSpaceOffset;
         private _updateFromXRSession;

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

@@ -42484,11 +42484,6 @@ declare module BABYLON {
         private _updateNumberOfRigCameras;
         /** @hidden */
         _updateForDualEyeDebugging(): void;
-        /**
-         * Updates the cameras position from the current pose information of the  XR session
-         * @param xrSessionManager the session containing pose information
-         */
-        update(): void;
         private _updateReferenceSpace;
         private _updateReferenceSpaceOffset;
         private _updateFromXRSession;

+ 1 - 1
dist/preview release/glTF2Interface/package.json

@@ -1,7 +1,7 @@
 {
     "name": "babylonjs-gltf2interface",
     "description": "A typescript declaration of babylon's gltf2 inteface.",
-    "version": "4.1.0-beta.17",
+    "version": "4.1.0-beta.18",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 2 - 2
dist/preview release/gui/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-gui",
     "description": "The Babylon.js GUI library is an extension you can use to generate interactive user interface. It is build on top of the DynamicTexture.",
-    "version": "4.1.0-beta.17",
+    "version": "4.1.0-beta.18",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,7 +28,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.1.0-beta.17"
+        "babylonjs": "4.1.0-beta.18"
     },
     "engines": {
         "node": "*"

+ 7 - 7
dist/preview release/inspector/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-inspector",
     "description": "The Babylon.js inspector.",
-    "version": "4.1.0-beta.17",
+    "version": "4.1.0-beta.18",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -29,12 +29,12 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.1.0-beta.17",
-        "babylonjs-gui": "4.1.0-beta.17",
-        "babylonjs-loaders": "4.1.0-beta.17",
-        "babylonjs-materials": "4.1.0-beta.17",
-        "babylonjs-serializers": "4.1.0-beta.17",
-        "babylonjs-gltf2interface": "4.1.0-beta.17"
+        "babylonjs": "4.1.0-beta.18",
+        "babylonjs-gui": "4.1.0-beta.18",
+        "babylonjs-loaders": "4.1.0-beta.18",
+        "babylonjs-materials": "4.1.0-beta.18",
+        "babylonjs-serializers": "4.1.0-beta.18",
+        "babylonjs-gltf2interface": "4.1.0-beta.18"
     },
     "devDependencies": {
         "@types/react": "~16.7.3",

+ 3 - 3
dist/preview release/loaders/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-loaders",
     "description": "The Babylon.js file loaders library is an extension you can use to load different 3D file types into a Babylon scene.",
-    "version": "4.1.0-beta.17",
+    "version": "4.1.0-beta.18",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,8 +28,8 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs-gltf2interface": "4.1.0-beta.17",
-        "babylonjs": "4.1.0-beta.17"
+        "babylonjs-gltf2interface": "4.1.0-beta.18",
+        "babylonjs": "4.1.0-beta.18"
     },
     "engines": {
         "node": "*"

+ 2 - 2
dist/preview release/materialsLibrary/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-materials",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
-    "version": "4.1.0-beta.17",
+    "version": "4.1.0-beta.18",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,7 +28,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.1.0-beta.17"
+        "babylonjs": "4.1.0-beta.18"
     },
     "engines": {
         "node": "*"

+ 2 - 2
dist/preview release/nodeEditor/package.json

@@ -4,14 +4,14 @@
     },
     "name": "babylonjs-node-editor",
     "description": "The Babylon.js node material editor.",
-    "version": "4.1.0-beta.17",
+    "version": "4.1.0-beta.18",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
     },
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.1.0-beta.17"
+        "babylonjs": "4.1.0-beta.18"
     },
     "files": [
         "babylon.nodeEditor.max.js.map",

+ 1 - 1
dist/preview release/package.json

@@ -7,7 +7,7 @@
     ],
     "name": "babylonjs",
     "description": "Babylon.js is a JavaScript 3D engine based on webgl.",
-    "version": "4.1.0-beta.17",
+    "version": "4.1.0-beta.18",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 2 - 2
dist/preview release/postProcessesLibrary/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-post-process",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
-    "version": "4.1.0-beta.17",
+    "version": "4.1.0-beta.18",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,7 +28,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.1.0-beta.17"
+        "babylonjs": "4.1.0-beta.18"
     },
     "engines": {
         "node": "*"

+ 2 - 2
dist/preview release/proceduralTexturesLibrary/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-procedural-textures",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
-    "version": "4.1.0-beta.17",
+    "version": "4.1.0-beta.18",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,7 +28,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.1.0-beta.17"
+        "babylonjs": "4.1.0-beta.18"
     },
     "engines": {
         "node": "*"

+ 3 - 3
dist/preview release/serializers/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-serializers",
     "description": "The Babylon.js serializers library is an extension you can use to serialize Babylon scenes.",
-    "version": "4.1.0-beta.17",
+    "version": "4.1.0-beta.18",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,8 +28,8 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "4.1.0-beta.17",
-        "babylonjs-gltf2interface": "4.1.0-beta.17"
+        "babylonjs": "4.1.0-beta.18",
+        "babylonjs-gltf2interface": "4.1.0-beta.18"
     },
     "engines": {
         "node": "*"

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

@@ -43963,11 +43963,6 @@ declare module "babylonjs/Cameras/XR/webXRCamera" {
         private _updateNumberOfRigCameras;
         /** @hidden */
         _updateForDualEyeDebugging(): void;
-        /**
-         * Updates the cameras position from the current pose information of the  XR session
-         * @param xrSessionManager the session containing pose information
-         */
-        update(): void;
         private _updateReferenceSpace;
         private _updateReferenceSpaceOffset;
         private _updateFromXRSession;
@@ -113889,11 +113884,6 @@ declare module BABYLON {
         private _updateNumberOfRigCameras;
         /** @hidden */
         _updateForDualEyeDebugging(): void;
-        /**
-         * Updates the cameras position from the current pose information of the  XR session
-         * @param xrSessionManager the session containing pose information
-         */
-        update(): void;
         private _updateReferenceSpace;
         private _updateReferenceSpaceOffset;
         private _updateFromXRSession;

File diff ditekan karena terlalu besar
+ 6 - 6
dist/preview release/viewer/babylon.viewer.js


File diff ditekan karena terlalu besar
+ 1 - 1
dist/preview release/viewer/babylon.viewer.max.js


+ 4 - 4
dist/preview release/what's new.md

@@ -48,7 +48,7 @@
 - Added `RawTexture2DArray` to enable use of WebGL2 2D array textures by custom shaders ([atg](https://github.com/atg))
 - Added multiview support for the shader material (and the line-mesh class) ([RaananW](https://github.com/RaananW/))
 - Added various (interpolation) functions to Path3D, also `alignTangentsWithPath`, `slice`, `getClosestPositionTo` ([Poolminer](https://github.com/Poolminer/))
-- Allow setting of `BABYLON.Basis.JSModuleURL` and `BABYLON.Basis.WasmModuleURL`, for hosting the Basis transcoder locally ([JasonAyre])(https://github.com/jasonyre))
+- Allow setting of `BABYLON.Basis.JSModuleURL` and `BABYLON.Basis.WasmModuleURL`, for hosting the Basis transcoder locally ([JasonAyre](https://github.com/jasonyre))
 - PNG support for browsers not supporting SVG ([RaananW](https://github.com/RaananW/))
 - Device orientation event permissions for iOS 13+ ([RaananW](https://github.com/RaananW/))
 - Added `DirectionalLight.autoCalcShadowZBounds` to automatically compute the `shadowMinZ` and `shadowMaxZ` values ([Popov72](https://github.com/Popov72))
@@ -181,7 +181,7 @@
 - WebXR teleportation can now be disabled after initialized ([RaananW](https://github.com/RaananW/))
 - New Features Manager for WebXR features ([RaananW](https://github.com/RaananW/))
 - New features - Plane detection, Hit Test, Background remover ([RaananW](https://github.com/RaananW/))
-- Camera's API works as expected (position, rotationQuaternion, world matrix etc') ([#7239](https://github.com/BabylonJS/Babylon.js/issues/7239)) ([RaananW](https://github.com/RaananW/))
+- Camera's API is Babylon-conform (position, rotationQuaternion, world matrix, direction etc') ([#7239](https://github.com/BabylonJS/Babylon.js/issues/7239)) ([RaananW](https://github.com/RaananW/))
 - XR Input now using standard profiles and completely separated from the gamepad class ([#7348](https://github.com/BabylonJS/Babylon.js/issues/7348)) ([RaananW](https://github.com/RaananW/))
 
 ### Ray
@@ -216,7 +216,7 @@
 ### Serializers
 
 - Added support for `AnimationGroup` serialization ([Drigax](https://github.com/drigax/))
-- Expanded animation group serialization to include all targeted TransformNodes ([Drigax]https://github.com/drigax/)
+- Expanded animation group serialization to include all targeted TransformNodes ([Drigax](https://github.com/drigax/))
 
 ### Documentation
 
@@ -284,4 +284,4 @@
 - The STL loader does not create light or camera automatically, please use `scene.createDefaultCameraOrLight();` in your code [Sebavan](https://github.com/sebavan/)
 - The glTF2 exporter extension no longer ignores childless empty nodes.([drigax](https://github.com/drigax))
 - Default culling strategy changed to CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY ([Deltakosh](https://github.com/deltakosh/))
-- `MaterialHelper.BindLight` and `MaterialHelper.BindLights` do not need the usePhysicalLight anymore ([Sebavan](https://github.com/sebavan/))
+- `MaterialHelper.BindLight` and `MaterialHelper.BindLights` do not need the usePhysicalLight anymore ([Sebavan](https://github.com/sebavan/))

+ 1 - 1
package.json

@@ -7,7 +7,7 @@
     ],
     "name": "babylonjs",
     "description": "Babylon.js is a JavaScript 3D engine based on webgl.",
-    "version": "4.1.0-beta.17",
+    "version": "4.1.0-beta.18",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 3 - 4
src/Cameras/XR/motionController/webXROculusTouchMotionController.ts

@@ -252,16 +252,15 @@ export class WebXROculusTouchMotionController extends WebXRAbstractMotionControl
 
     protected _setRootMesh(meshes: AbstractMesh[]): void {
         this.rootMesh = new Mesh(this.profileId + " " + this.handness, this.scene);
+        this.rootMesh.rotationQuaternion = Quaternion.FromEulerAngles(0, Math.PI, 0);
 
         meshes.forEach((mesh) => { mesh.isPickable = false; });
         if (this._isQuest()) {
             this._modelRootNode = meshes[0];
-            this.rootMesh.rotationQuaternion = Quaternion.FromEulerAngles(0, Math.PI, 0);
-            this.rootMesh.position.y = 0.034;
-            this.rootMesh.position.z = 0.052;
         } else {
             this._modelRootNode = meshes[1];
-            this.rootMesh.rotationQuaternion = Quaternion.FromEulerAngles(Math.PI / -4, Math.PI, 0);
+            this.rootMesh.position.y = 0.034;
+            this.rootMesh.position.z = 0.052;
         }
         this._modelRootNode.parent = this.rootMesh;
     }

+ 9 - 12
src/Cameras/XR/webXRCamera.ts

@@ -44,6 +44,15 @@ export class WebXRCamera extends FreeCamera {
             // first frame - camera's y position should be 0 for the correct offset
             this._firstFrame = true;
         });
+
+        // Check transformation changes on each frame. Callback is added to be first so that the transformation will be
+        // applied to the rest of the elements using the referenceSpace object
+        this._xrSessionManager.onXRFrameObservable.add((frame) => {
+            if (!this._firstFrame) {
+                this._updateReferenceSpace();
+            }
+            this._updateFromXRSession();
+        }, undefined, true);
     }
 
     private _updateNumberOfRigCameras(viewCount = 1) {
@@ -74,18 +83,6 @@ export class WebXRCamera extends FreeCamera {
         this.rigCameras[1].outputRenderTarget = null;
     }
 
-    /**
-     * Updates the cameras position from the current pose information of the  XR session
-     * @param xrSessionManager the session containing pose information
-     */
-    public update() {
-        if (!this._firstFrame) {
-            this._updateReferenceSpace();
-        }
-        this._updateFromXRSession();
-        super.update();
-    }
-
     private _updateReferenceSpace(): boolean {
         // were position & rotation updated OUTSIDE of the xr update loop
         if (!this.position.equals(this._referencedPosition) || !this.rotationQuaternion.equals(this._referenceQuaternion)) {

+ 2 - 2
src/Engines/thinEngine.ts

@@ -132,14 +132,14 @@ export class ThinEngine {
      */
     // Not mixed with Version for tooling purpose.
     public static get NpmPackage(): string {
-        return "babylonjs@4.1.0-beta.17";
+        return "babylonjs@4.1.0-beta.18";
     }
 
     /**
      * Returns the current version of the framework
      */
     public static get Version(): string {
-        return "4.1.0-beta.17";
+        return "4.1.0-beta.18";
     }
 
     /**