CLASSES
TagsA - Z

Octree

Description

class Octree

Data structure class based on space coordinates

Constructor

new Octree(creationFunc, maxBlockCapacity, maxDepth)

Parameters

Name Type Description
creationFunc (entry: T, block: OctreeBlock<T>) => void The function used to add a mesh in this octree
optional maxBlockCapacity number @param maxBlockCapacity
optional maxDepth number @param maxDepth

Members

maxDepth : number

The maxDepth

blocks : Array<OctreeBlock<T>>

The blocks

dynamicContent : T[]

The dynamic content

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

Create function for Meshes

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

Create function for SubMeshes

Methods

update(worldMin, worldMax, entries) void

Update this octree

Parameters

Name Type Description
worldMin Vector3 the minimum world
worldMax Vector3 the maximum world
entries T[] @param entries

addMesh(entry) void

Add a mesh to this octree

Parameters

Name Type Description
entry T @param entry

select(frustumPlanes, allowDuplicate) SmartArray<T>

Select octree

Parameters

Name Type Description
frustumPlanes Plane[] Frustum plan of the mesh
optional allowDuplicate boolean True if you want to duplicate it, false otherwise.

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

Intersects

Parameters

Name Type Description
sphereCenter Vector3 The sphere center
sphereRadius number The sphere radius
optional allowDuplicate boolean True if you want to duplicate it, false otherwise.

intersectsRay(ray) SmartArray<T>

Parameters

Name Type Description
ray Ray @param ray