Constructor

@:value({ cellSize : -1 })new(minBound:Vector3D, maxBound:Vector3D, cellSize:Float = -1)

Creates a new ViewVolume with given dimensions. A ViewVolume is a region where the camera or a shadow casting light could reside in.

Parameters:

minBound

The minimum boundaries of the view volume (the bottom-left-near corner)

maxBound

The maximum boundaries of the view volume (the top-right-far corner)

cellSize

The size of cell subdivisions for the view volume. The default value is -1, meaning the view volume will not be subdivided. This is the value that should usually be used when setting visibility info manually.

Variables

read onlydepth:Float

read onlyheight:Float

read onlymaxBound:Vector3D

read onlymaxX:Float

read onlymaxY:Float

read onlymaxZ:Float

read onlyminBound:Vector3D

read onlyminX:Float

read onlyminY:Float

read onlyminZ:Float

read onlynumCellsX:Int

read onlynumCellsY:Int

read onlynumCellsZ:Int

read onlywidth:Float

Methods

@:value({ indexZ : 0, indexY : 0, indexX : 0 })addVisibleDynamicCell(cell:InvertedOctreeNode, indexX:Int = 0, indexY:Int = 0, indexZ:Int = 0):Void

@:value({ indexZ : 0, indexY : 0, indexX : 0, dynamicGrid : null })addVisibleRegion(minBounds:Vector3D, maxBounds:Vector3D, scene:Scene3D, ?dynamicGrid:DynamicGrid, indexX:Int = 0, indexY:Int = 0, indexZ:Int = 0):Void

Adds all static geometry in a scene that intersects a given region, as well as the dynamic grid if provided.

Parameters:

minBounds

The minimum bounds of the region to be considered visible

maxBounds

The maximum bounds of the region to be considered visible

scene

The Scene3D object containing the static objects to be added.

dynamicGrid

The DynamicGrid belonging to the partition this will be used with

indexX

An optional index for the cell within ViewVolume. If created with gridSize -1, this is typically avoided.

indexY

An optional index for the cell within ViewVolume. If created with gridSize -1, this is typically avoided.

indexZ

An optional index for the cell within ViewVolume. If created with gridSize -1, this is typically avoided.

@:value({ indexZ : 0, indexY : 0, indexX : 0 })addVisibleStatic(entity:Entity, indexX:Int = 0, indexY:Int = 0, indexZ:Int = 0):Void

@:value({ dynamicGrid : null })addVisibleViewVolume(viewVolume:ViewVolume, scene:Scene3D, ?dynamicGrid:DynamicGrid):Void

A shortcut method for addVisibleRegion, that adds static geometry in a scene that intersects a given viewvolume, as well as the dynamic grid if provided.

Parameters:

viewVolume

The viewVolume providing the region

scene

The Scene3D object containing the static objects to be added.

dynamicGrid

The DynamicGrid belonging to the partition this will be used with

contains(entryPoint:Vector3D):Bool

markCellAccessible(indexX:Int, indexY:Int, indexZ:Int):Void

Enable the use of a cell. Do this if the camera or casting light can potentially be in this cell. If the ViewVolume was constructed with gridSize -1, it does not need to be called

Parameters:

indexX

The x-index of the cell

indexY

The y-index of the cell

indexZ

The z-index of the cell

markCellInaccessible(indexX:Int, indexY:Int, indexZ:Int):Void

Disables the use of a cell. Do this only if the camera or casting light can never be in this cell.

Parameters:

indexX

The x-index of the cell

indexY

The y-index of the cell

indexZ

The z-index of the cell

@:value({ indexZ : 0, indexY : 0, indexX : 0 })removeVisibleDynamicCell(cell:InvertedOctreeNode, indexX:Int = 0, indexY:Int = 0, indexZ:Int = 0):Void

@:value({ indexZ : 0, indexY : 0, indexX : 0 })removeVisibleStatic(entity:Entity, indexX:Int = 0, indexY:Int = 0, indexZ:Int = 0):Void

Inherited Variables

Defined by NodeBase

Inherited Methods

Defined by NodeBase

findPartitionForEntity(entity:Entity):NodeBase

Finds the partition that contains (or should contain) the given entity.

isInFrustum(planes:Vector<Plane3D>, numPlanes:Int):Bool

Tests if the current node is at least partly inside the frustum.

Parameters:

viewProjectionRaw

The raw data of the view projection matrix

Returns:

Whether or not the node is at least partly inside the view frustum.

isIntersectingRay(rayPosition:Vector3D, rayDirection:Vector3D):Bool

Tests if the current node is intersecting with a ray.

Parameters:

rayPosition

The starting position of the ray

rayDirection

The direction vector of the ray

Returns:

Whether or not the node is at least partly intersecting the ray.