Trevor Baron 6 tahun lalu
induk
melakukan
00d43f948d

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

@@ -111,6 +111,8 @@
 - Fixed an issue with loading base64 encoded images in the glTF loader ([bghgary](https://github.com/bghgary))
 - In multi-camera scenes the inspector would cause the camera's interaction events to get detached ([TrevorDev](https://github.com/TrevorDev))
 - SixDofDragBehavior will support when the camera is parented ([TrevorDev](https://github.com/TrevorDev))
+- Deactivate webvr lasers when not in vr ([TrevorDev](https://github.com/TrevorDev))
+- Update physics position using absolutePosition instead of pivotPosition ([TrevorDev](https://github.com/TrevorDev))
 
 ### Core Engine
 - Fixed a bug with `mesh.alwaysSelectAsActiveMesh` preventing layerMask to be taken in account ([Deltakosh](https://github.com/deltakosh))

+ 6 - 6
src/Cameras/VR/babylon.vrExperienceHelper.ts

@@ -938,9 +938,9 @@ module BABYLON {
                 this._scene.registerBeforeRender(this.beforeRender);
             }
 
-            if(this._displayLaserPointer){
-                [this._leftController, this._rightController].forEach((controller)=>{
-                    if(controller){
+            if (this._displayLaserPointer) {
+                [this._leftController, this._rightController].forEach((controller) => {
+                    if (controller) {
                         controller._activatePointer();
                     }
                 });
@@ -1029,8 +1029,8 @@ module BABYLON {
                 // resize to update width and height when exiting vr exits fullscreen
                 this._scene.getEngine().resize();
 
-                [this._leftController, this._rightController].forEach((controller)=>{
-                    if(controller){
+                [this._leftController, this._rightController].forEach((controller) => {
+                    if (controller) {
                         controller._deactivatePointer();
                     }
                 });
@@ -1282,7 +1282,7 @@ module BABYLON {
             if (controllerMesh) {
 
                 controller._interactionsEnabled = true;
-                if(this.isInVRMode && this._displayLaserPointer){
+                if (this.isInVRMode && this._displayLaserPointer) {
                     controller._activatePointer();
                 }
                 if (this.webVROptions.laserToggle) {

+ 2 - 2
src/Physics/Plugins/babylon.ammoJSPlugin.ts

@@ -402,7 +402,7 @@ module BABYLON {
                     }
                 });
 
-                if(childrenAdded > 0){
+                if (childrenAdded > 0) {
                     // Add parents shape as a child if present
                     var shape = this._createShape(impostor, true);
                     if (shape) {
@@ -414,7 +414,7 @@ module BABYLON {
                     }
 
                     return returnValue;
-                }else{
+                }else {
                     // If no children with impostors create the actual shape below instead
                     Ammo.destroy(returnValue);
                     returnValue = null;