Forráskód Böngészése

Merge branch 'master' of https://github.com/Jaskar/Babylon.js into testPG

# Conflicts:
#	Playground/js/menuPG.js
#	Playground/js/monacoCreator.js
Jaskar 6 éve
szülő
commit
ba53be2b35

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

@@ -24,7 +24,7 @@
 - Added startAndReleaseDragOnPointerEvents property to pointerDragBehavior which can be set to false for custom drag triggering ([TrevorDev](https://github.com/TrevorDev))
 - Effect renderer to render one or multiple shader effects to a texture ([TrevorDev](https://github.com/TrevorDev))
 - Added url parameters to web request modifiers ([PierreLeBlond](https://github.com/PierreLeBlond))
-- WebXR updated to spec as of June 27th ([TrevorDev](https://github.com/TrevorDev))
+- WebXR updated to spec as of July 9th ([TrevorDev](https://github.com/TrevorDev))
 - WebXR webVR parity helpers ([TrevorDev](https://github.com/TrevorDev))
 
 ### Engine

+ 2 - 0
src/Cameras/XR/webXRControllerModelLoader.ts

@@ -20,6 +20,8 @@ export class WebXRControllerModelLoader {
                 controllerModel.initControllerMesh(c.grip!.getScene(), (m) => {
                     controllerModel.mesh!.parent = c.grip!;
                     controllerModel.mesh!.rotationQuaternion = Quaternion.FromEulerAngles(0, Math.PI, 0);
+                    controllerModel.mesh!.position.y = 0.034;
+                    controllerModel.mesh!.position.z = 0.052;
                 });
             }else if (c.inputSource.gamepad && c.inputSource.gamepad.id === "oculus-quest") {
                 OculusTouchController._IsQuest = true;

+ 1 - 1
src/Gizmos/boundingBoxGizmo.ts

@@ -122,7 +122,7 @@ export class BoundingBoxGizmo extends Gizmo {
         super(gizmoLayer);
 
         // Do not update the gizmo's scale so it has a fixed size to the object its attached to
-        this._updateScale = false;
+        this.updateScale = false;
 
         this._anchorMesh = new AbstractMesh("anchor", gizmoLayer.utilityLayerScene);
         // Create Materials

+ 5 - 3
src/Gizmos/gizmo.ts

@@ -62,9 +62,9 @@ export class Gizmo implements IDisposable {
      */
     public updateGizmoPositionToMatchAttachedMesh = true;
     /**
-     * When set, the gizmo will always appear the same size no matter where the camera is (default: false)
+     * When set, the gizmo will always appear the same size no matter where the camera is (default: true)
      */
-    protected _updateScale = true;
+    public updateScale = true;
     protected _interactionsEnabled = true;
     protected _attachedMeshChanged(value: Nullable<AbstractMesh>) {
     }
@@ -109,7 +109,7 @@ export class Gizmo implements IDisposable {
             }
 
             // Scale
-            if (this._updateScale) {
+            if (this.updateScale) {
                 const activeCamera = this.gizmoLayer.utilityLayerScene.activeCamera!;
                 var cameraPosition = activeCamera.globalPosition;
                 if ((<WebVRFreeCamera>activeCamera).devicePosition) {
@@ -123,6 +123,8 @@ export class Gizmo implements IDisposable {
                 if (effectiveMesh._getWorldMatrixDeterminant() < 0) {
                     this._rootMesh.scaling.y *= -1;
                 }
+            }else {
+                this._rootMesh.scaling.setAll(this.scaleRatio);
             }
         }
     }