Constructor
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
Methods
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. |
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 |
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 |