Borut 7 years ago
parent
commit
9ff17c925d
2 changed files with 5491 additions and 5509 deletions
  1. 5485 5486
      dist/preview release/babylon.d.ts
  2. 6 23
      src/Physics/babylon.physicsEngine.ts

File diff suppressed because it is too large
+ 5485 - 5486
dist/preview release/babylon.d.ts


+ 6 - 23
src/Physics/babylon.physicsEngine.ts

@@ -256,7 +256,7 @@
             return { force: force, contactPoint: contactPoint };
         }
 
-        private _radialSphere: Mesh;
+        private _radialSphere: Mesh; // create a sphere, so we can get the intersecting meshes inside
         private _prepareRadialSphere(scene: Scene) {
             if (!this._radialSphere) {
                 this._radialSphere = BABYLON.Mesh.CreateSphere(
@@ -279,31 +279,14 @@
             this._radialSphere._updateBoundingInfo();
             this._radialSphere.computeWorldMatrix(true);
   
-            if (this._radialSphere.intersectsMesh(
+            return this._radialSphere.intersectsMesh(
                 impostorObject,
                 true
-            )) {
-                return true;
-            }
-
-            return false;
+            );
         }
-
-        public showRadialSphere(scene: Scene) {
-            this._prepareRadialSphere(scene);
-
-            this._radialSphere.isVisible = true;
-            if (!this._radialSphere.material) {
-                var radialSphereMaterial = new StandardMaterial("radialSphereMaterial", scene);
-                radialSphereMaterial.alpha = 0.5;
-                this._radialSphere.material = radialSphereMaterial;
-            }
-        }
-
-        public hideRadialSphere() {
-            if (this._radialSphere) {
-                this._radialSphere.isVisible = false;
-            }
+        
+        public getRadialSphere() {
+            return this._radialSphere;
         }
     }