瀏覽代碼

fix : requested changes

Jérôme Bousquié 6 年之前
父節點
當前提交
19e7be9880
共有 3 個文件被更改,包括 5 次插入6 次删除
  1. 2 3
      src/Culling/babylon.boundingInfo.ts
  2. 1 1
      src/Culling/babylon.boundingSphere.ts
  3. 2 2
      src/Mesh/babylon.abstractMesh.ts

+ 2 - 3
src/Culling/babylon.boundingInfo.ts

@@ -148,13 +148,11 @@ module BABYLON {
         /**
          * Returns `true` if the bounding info is within the frustum defined by the passed array of planes.  
          * @param frustumPlanes defines the frustum to test  
-         * @param strategy defines the strategy to use for the culling (default is BABYLON.Scene.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY)  
+         * @param strategy defines the strategy to use for the culling (default is BABYLON.AbstractMesh.CULLINGSTRATEGY_STANDARD)  
          * @returns true if the bounding info is in the frustum planes  
          */
         public isInFrustum(frustumPlanes: Array<DeepImmutable<Plane>>, strategy: number = AbstractMesh.CULLINGSTRATEGY_STANDARD): boolean {
             let inclusionTest = (strategy === AbstractMesh.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION || strategy === AbstractMesh.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY);
-            let bSphereOnlyTest = (strategy === AbstractMesh.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY || strategy === AbstractMesh.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY);
-            
             if (inclusionTest) {
                 if (this.boundingSphere.isCenterInFrustum(frustumPlanes)) {
                     return true;
@@ -165,6 +163,7 @@ module BABYLON {
                 return false;
             }
 
+            let bSphereOnlyTest = (strategy === AbstractMesh.CULLINGSTRATEGY_BOUNDINGSPHERE_ONLY || strategy === AbstractMesh.CULLINGSTRATEGY_OPTIMISTIC_INCLUSION_THEN_BSPHERE_ONLY);
             if (bSphereOnlyTest) {
                 return true;
             }

+ 1 - 1
src/Culling/babylon.boundingSphere.ts

@@ -116,7 +116,7 @@ module BABYLON {
         }
 
         /**
-         * Tests if the bounding sphere center is inbetween the frustum planes.
+         * Tests if the bounding sphere center is in between the frustum planes.
          * Used for optimistic fast inclusion.
          * @param frustumPlanes defines the frustum planes to test
          * @returns true if the sphere center is inbetween the frustum planes

+ 2 - 2
src/Mesh/babylon.abstractMesh.ts

@@ -61,7 +61,7 @@ module BABYLON {
         /** Culling strategy : Optimistic Inclusion.  
          *  This in an inclusion test first, then the standard exclusion test.  
          *  This can be faster when a cullable object is expected to be almost always in the camera frustum.  
-         *  This can also be a little slower than the standard test when the tested object center is not the frustum.  
+         *  This could also be a little slower than the standard test when the tested object center is not the frustum but one of its bounding box vertex is still inside.  
          *  Anyway, it's as accurate as the standard strategy.  
          *  Test :  
          *  Is the cullable object bounding sphere center in the frustum ?  
@@ -71,7 +71,7 @@ module BABYLON {
         /** Culling strategy : Optimistic Inclusion then Bounding Sphere Only.  
          *  This in an inclusion test first, then the bounding sphere only exclusion test.  
          *  This can be the fastest test when a cullable object is expected to be almost always in the camera frustum.  
-         *  This can also be a little slower than the BoundingSphereOnly stratagy when the tested object center is not in the frustum.   
+         *  This could also be a little slower than the BoundingSphereOnly strategy when the tested object center is not in the frustum but its bounding sphere still intersects it.   
          *  It's less accurate than the standard strategy and as accurate as the BoundingSphereOnly strategy.  
          *  Test :  
          *  Is the cullable object bounding sphere center in the frustum ?