Explorar o código

Merge pull request #9707 from jasonsturges/doc/culling

Culling documentation
sebavan %!s(int64=4) %!d(string=hai) anos
pai
achega
9ae173a08b

+ 1 - 1
src/Culling/Octrees/octree.ts

@@ -27,7 +27,7 @@ export class Octree<T> {
     /**
      * Creates a octree
      * @see https://doc.babylonjs.com/how_to/optimizing_your_scene_with_octrees
-     * @param creationFunc function to be used to instatiate the octree
+     * @param creationFunc function to be used to instantiate the octree
      * @param maxBlockCapacity defines the maximum number of meshes you want on your octree's leaves (default: 64)
      * @param maxDepth defines the maximum depth (sub-levels) for your octree. Default value is 2, which means 8 8 8 = 512 blocks :) (This parameter takes precedence over capacity.)
      */

+ 1 - 1
src/Culling/Octrees/octreeBlock.ts

@@ -154,7 +154,7 @@ export class OctreeBlock<T> {
     }
 
     /**
-     * Test if the current block intersects the furstum planes and if yes, then add its content to the selection array
+     * Test if the current block intersects the frustum planes and if yes, then add its content to the selection array
      * @param frustumPlanes defines the frustum planes to test
      * @param selection defines the array to store current content if selection is positive
      * @param allowDuplicate defines if the selection array can contains duplicated entries

+ 1 - 1
src/Culling/Octrees/octreeSceneComponent.ts

@@ -239,7 +239,7 @@ export class OctreeSceneComponent {
     }
 
     /**
-     * Disposes the component and the associated ressources.
+     * Disposes the component and the associated resources.
      */
     public dispose(): void {
         // Nothing to do here.

+ 2 - 2
src/Culling/boundingInfo.ts

@@ -41,7 +41,7 @@ export interface ICullable {
     isInFrustum(frustumPlanes: Plane[]): boolean;
     /**
      * Checks if a cullable object (mesh...) is in the camera frustum
-     * Unlike isInFrustum this cheks the full bounding box
+     * Unlike isInFrustum this checks the full bounding box
      * @param frustumPlanes Camera near/planes
      * @returns true if the object is in frustum otherwise false
      */
@@ -216,7 +216,7 @@ export class BoundingInfo implements ICullable {
 
     /**
      * Checks if a cullable object (mesh...) is in the camera frustum
-     * Unlike isInFrustum this cheks the full bounding box
+     * Unlike isInFrustum this checks the full bounding box
      * @param frustumPlanes Camera near/planes
      * @returns true if the object is in frustum otherwise false
      */

+ 2 - 2
src/Culling/boundingSphere.ts

@@ -151,10 +151,10 @@ export class BoundingSphere {
 
     // Statics
     /**
-     * Checks if two sphere intersct
+     * Checks if two sphere intersect
      * @param sphere0 sphere 0
      * @param sphere1 sphere 1
-     * @returns true if the speres intersect
+     * @returns true if the spheres intersect
      */
     public static Intersects(sphere0: DeepImmutable<BoundingSphere>, sphere1: DeepImmutable<BoundingSphere>): boolean {
         const squareDistance = Vector3.DistanceSquared(sphere0.centerWorld, sphere1.centerWorld);

+ 3 - 3
src/Culling/ray.ts

@@ -37,7 +37,7 @@ export class Ray {
     // Methods
     /**
      * Checks if the ray intersects a box
-     * This does not account for the ray lenght by design to improve perfs.
+     * This does not account for the ray length by design to improve perfs.
      * @param minimum bound of the box
      * @param maximum bound of the box
      * @param intersectionTreshold extra extend to be added to the box in all direction
@@ -282,7 +282,7 @@ export class Ray {
      * Checks if ray intersects a mesh
      * @param mesh the mesh to check
      * @param fastCheck defines if the first intersection will be used (and not the closest)
-     * @returns picking info of the intersecton
+     * @returns picking info of the intersection
      */
     public intersectsMesh(mesh: DeepImmutable<AbstractMesh>, fastCheck?: boolean): PickingInfo {
         var tm = TmpVectors.Matrix[0];
@@ -339,7 +339,7 @@ export class Ray {
     private static rayl = 10e8;
 
     /**
-     * Intersection test between the ray and a given segment whithin a given tolerance (threshold)
+     * Intersection test between the ray and a given segment within a given tolerance (threshold)
      * @param sega the first point of the segment to test the intersection against
      * @param segb the second point of the segment to test the intersection against
      * @param threshold the tolerance margin, if the ray doesn't intersect the segment but is close to the given threshold, the intersection is successful