Octree

Description

class Octree

Constructor

new Octree(creationFunc, maxBlockCapacity, maxDepth)

Parameters

Name Type Description
creationFunc entry T
block OctreeBlock<T>

| optional | maxBlockCapacity | number |

Members

maxDepth : number

blocks : Array<OctreeBlock<T>>

dynamicContent : T[]

static CreationFuncForMeshes : (entry: AbstractMesh, block: OctreeBlock<AbstractMesh>) => void

Parameters

Name Type Description
entry AbstractMesh
block OctreeBlock<AbstractMesh>

static CreationFuncForSubMeshes : (entry: SubMesh, block: OctreeBlock<SubMesh>) => void

Parameters

Name Type Description
entry SubMesh
block OctreeBlock<SubMesh>

Methods

update(worldMin, worldMax, entries) void

Parameters

Name Type Description
worldMin Vector3
worldMax Vector3
entries T[]

addMesh(entry) void

Parameters

Name Type Description
entry T

select(frustumPlanes, allowDuplicate) SmartArray<T>

Parameters

Name Type Description
frustumPlanes Plane[]
optional allowDuplicate boolean

intersects(sphereCenter, sphereRadius, allowDuplicate) SmartArray<T>

Parameters

Name Type Description
sphereCenter Vector3
sphereRadius number
optional allowDuplicate boolean

intersectsRay(ray) SmartArray<T>

Parameters

Name Type Description
ray Ray