babylon.octree.d.ts 1.3 KB

12345678910111213141516171819202122
  1. declare module BABYLON {
  2. interface IOctreeContainer<T> {
  3. blocks: OctreeBlock<T>[];
  4. }
  5. class Octree<T> {
  6. public maxDepth: number;
  7. public blocks: OctreeBlock<T>[];
  8. public dynamicContent: T[];
  9. private _maxBlockCapacity;
  10. private _selectionContent;
  11. private _creationFunc;
  12. constructor(creationFunc: (entry: T, block: OctreeBlock<T>) => void, maxBlockCapacity?: number, maxDepth?: number);
  13. public update(worldMin: Vector3, worldMax: Vector3, entries: T[]): void;
  14. public addMesh(entry: T): void;
  15. public select(frustumPlanes: Plane[], allowDuplicate?: boolean): SmartArray<T>;
  16. public intersects(sphereCenter: Vector3, sphereRadius: number, allowDuplicate?: boolean): SmartArray<T>;
  17. public intersectsRay(ray: Ray): SmartArray<T>;
  18. static _CreateBlocks<T>(worldMin: Vector3, worldMax: Vector3, entries: T[], maxBlockCapacity: number, currentDepth: number, maxDepth: number, target: IOctreeContainer<T>, creationFunc: (entry: T, block: OctreeBlock<T>) => void): void;
  19. static CreationFuncForMeshes: (entry: AbstractMesh, block: OctreeBlock<AbstractMesh>) => void;
  20. static CreationFuncForSubMeshes: (entry: SubMesh, block: OctreeBlock<SubMesh>) => void;
  21. }
  22. }