Browse Source

Small fix and cleanup

Raanan Weber 5 years ago
parent
commit
c52aa8f36d

+ 13 - 0
.vscode/launch.json

@@ -67,6 +67,19 @@
             ]
         },
         {
+            "name": "Launch playground (Chrome+SSL+Public address)",
+            "type": "chrome",
+            "request": "launch",
+            "url": "https://localhost:1338/Playground/index-local.html",
+            "webRoot": "${workspaceRoot}/",
+            "sourceMaps": true,
+            "preLaunchTask": "start-public-ssl",
+            "userDataDir": "${workspaceRoot}/.tempChromeProfileForDebug",
+            "runtimeArgs": [
+                "--disable-es3-apis"
+            ]
+        },
+        {
             "name": "Launch Materials Library (Chrome)",
             "type": "chrome",
             "request": "launch",

+ 24 - 0
.vscode/tasks.json

@@ -69,6 +69,30 @@
                 }
             ],
             "isBackground": true
+        },
+        {
+            "label": "start-public-ssl",
+            "type": "npm",
+            "script": "start-public-ssl",
+            "path": "Tools/Gulp/",
+            "isBackground": true,
+            "problemMatcher": {
+                "owner": "typescript",
+                "fileLocation": "relative",
+                "pattern": {
+                    "regexp": "^([^\\s].*)\\((\\d+|\\,\\d+|\\d+,\\d+,\\d+,\\d+)\\):\\s+(error|warning|info)\\s+(TS\\d+)\\s*:\\s*(.*)$",
+                    "file": 1,
+                    "location": 2,
+                    "severity": 3,
+                    "code": 4,
+                    "message": 5
+                },
+                "background": {
+                    "activeOnStart": true,
+                    "beginsPattern": "Starting \\'watchCore\\'",
+                    "endsPattern": "Watching for file changes"
+                }
+            }
         }
     ]
 }

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

@@ -208,7 +208,7 @@
 - Selection has gaze mode (which can be forced) and touch-screen support ([#7395](https://github.com/BabylonJS/Babylon.js/issues/7395)) ([RaananW](https://github.com/RaananW/))
 - Laser pointers can be excluded from lighting influence so that they are always visible in both WebXR and WebVR ([#7323](https://github.com/BabylonJS/Babylon.js/issues/7323)) ([RaananW](https://github.com/RaananW/))
 - Full support for the online motion controller repository ([#7323](https://github.com/BabylonJS/Babylon.js/issues/7323)) ([RaananW](https://github.com/RaananW/))
-- New XR feature - XR Controller physics impostor for motion controllers ([RaananW](https://github.com/RaananW/))
+- New XR feature - XR Controller physics impostor for motion controllers / XR Input sources ([RaananW](https://github.com/RaananW/))
 - Teleportation between different ground levels in WebXR is enabled ([RaananW](https://github.com/RaananW/))
 - Utility Meshes for XR (teleportation ring, selection rays) can now be rendered using a utility layer ([#7563](https://github.com/BabylonJS/Babylon.js/issues/7563)) ([RaananW](https://github.com/RaananW/))
 

+ 0 - 3
src/Physics/Plugins/oimoJSPlugin.ts

@@ -151,8 +151,6 @@ export class OimoJSPlugin implements IPhysicsEnginePlugin {
 
                 const radToDeg = 57.295779513082320876;
 
-                console.log(i.object.position, extendSize);
-
                 if (i === impostor) {
                     var center = impostor.getObjectCenter();
 
@@ -233,7 +231,6 @@ export class OimoJSPlugin implements IPhysicsEnginePlugin {
                 //actually not needed, but hey...
                 i.object.rotationQuaternion = oldQuaternion;
             });
-            console.log(bodyConfig);
             impostor.physicsBody = this.world.add(bodyConfig);
             // set the quaternion, ignoring the previously defined (euler) rotation
             impostor.physicsBody.resetQuaternion(globalQuaternion);

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

@@ -326,7 +326,7 @@ export class WebXRControllerPhysics extends WebXRAbstractFeature {
             const comparedQuaternion = controllerData.oldRotation || controllerData.impostorMesh!.rotationQuaternion!;
 
             controllerMesh.position.subtractToRef(comparedPosition, this._tmpVector);
-            this._tmpVector.scaleInPlace(this._delta);
+            this._tmpVector.scaleInPlace(1000 / this._delta);
             controllerData.impostor.setLinearVelocity(this._tmpVector);
             if (this._debugMode) {
                 console.log(this._tmpVector, 'linear');
@@ -342,7 +342,7 @@ export class WebXRControllerPhysics extends WebXRAbstractFeature {
                     this._tmpVector.scaleInPlace(2);
                 } else {
                     const angle = 2 * Math.atan2(len, this._tmpQuaternion.w);
-                    this._tmpVector.scaleInPlace((angle / (len * this._delta)));
+                    this._tmpVector.scaleInPlace((angle / (len * (this._delta / 1000))));
                 }
                 controllerData.impostor.setAngularVelocity(this._tmpVector);
                 if (this._debugMode) {