SceneZoneCullingState
Engine/source/scene/culling/sceneZoneCullingState.h
Culling state for a zone.
Classes:
Iterator over the culling volumes assigned to a zone.
A culling volume linked to a zone.
Public Types
CullingTestResult { CullingTestPositiveByInclusion CullingTestPositiveByOcclusion CullingTestNegative }
Result of a culling test in a zone.
Public Friends
class
Protected Attributes
bool
Whether tests can be short-circuited, i.e.
Link of culling volumes defining the visibility state of the zone.
bool
Whether there are inclusion volumes on this state.
bool
Whether there are occlusion volumes on this state.
bool
Whether culling volumes for this zone state have already been sorted.
Protected Functions
Sort the culling volumes such that the volumes with the highest probability of rejecting objects come first in the list.
_testVolumes(T bounds, bool occludersOnly)
Culling volume test abstracted over bounding volume type.
Protected Static Functions
_insertSorted(CullingVolumeLink *& head, CullingVolumeLink *& tail, CullingVolumeLink * link)
Insert the volume in link at the proper position in the list represented by head and tail.
Public Functions
Zone states are constructed by SceneCullingState.
Return the list of culling volumes attached to the zone.
bool
Return true if the zone has inclusion volumes assigned to it.
bool
Return true if the zone has more than one culling volume assigned to it.
bool
Return true if the zone has occlusion volumes assigned to it.
bool
Return true if the zone is visible.
testVolumes(const Box3F & aabb, bool occludersOnly)
Test whether the culling volumes added to the zone test positive on the given AABB, i.e.
testVolumes(const OrientedBox3F & obb, bool occludersOnly)
Test whether the culling volumes added to the zone test positive on the given OBB, i.e.
testVolumes(const SphereF & sphere, bool occludersOnly)
Test whether the culling volumes added to the zone test positive on the given sphere, i.e.
Detailed Description
Culling state for a zone.
Zone states keep track of the culling volumes that are generated during traversal for a particular zone in a scene.
note:This class has no meaningful constructor; the memory for all zone states is cleared en bloc.
Public Types
CullingTestResult
Enumerator
- CullingTestPositiveByInclusion
An includer tested positive on the bounding volume.
- CullingTestPositiveByOcclusion
An occluder tested positive on the bounding volume.
- CullingTestNegative
None of the culling volumes included or excluded the bounding volume.
Result of a culling test in a zone.
Public Friends
Protected Attributes
bool mCanShortcuit
Whether tests can be short-circuited, i.e.
the first culler that rejects or accepts will cause the test to terminate. This is the case if there are no includers inside occluders, i.e. if occluders can be trusted to fully exclude any space they cover.
CullingVolumeLink * mCullingVolumes
Link of culling volumes defining the visibility state of the zone.
Since there may be multiple portals leading into a zone or multiple occluders inside a zone, we may have multiple culling volumes.
bool mHaveIncluders
Whether there are inclusion volumes on this state.
bool mHaveOccluders
Whether there are occlusion volumes on this state.
bool mHaveSortedVolumes
Whether culling volumes for this zone state have already been sorted.
Protected Functions
_sortVolumes()
Sort the culling volumes such that the volumes with the highest probability of rejecting objects come first in the list.
Also, make sure that all occluders come before all includers so that occlusion is handled correctly.
_testVolumes(T bounds, bool occludersOnly)
Culling volume test abstracted over bounding volume type.
Protected Static Functions
_insertSorted(CullingVolumeLink *& head, CullingVolumeLink *& tail, CullingVolumeLink * link)
Insert the volume in link at the proper position in the list represented by head and tail.
Public Functions
SceneZoneCullingState()
Zone states are constructed by SceneCullingState.
This constructor should not be used otherwise. It is public due to the use through Vector in SceneCullingState.
getCullingVolumes()
Return the list of culling volumes attached to the zone.
hasIncluders()
Return true if the zone has inclusion volumes assigned to it.
hasMultipleVolumes()
Return true if the zone has more than one culling volume assigned to it.
hasOccluders()
Return true if the zone has occlusion volumes assigned to it.
isZoneVisible()
Return true if the zone is visible.
This is the case if any includers have been added to the zone's rendering state.
testVolumes(const Box3F & aabb, bool occludersOnly)
Test whether the culling volumes added to the zone test positive on the given AABB, i.e.
whether they include or exclude the given AABB.
testVolumes(const OrientedBox3F & obb, bool occludersOnly)
Test whether the culling volumes added to the zone test positive on the given OBB, i.e.
whether they include or exclude the given OBB.
Parameters:
obb | An OBB described by 8 points. |
invertedOnly | If true, only inverted cullers are tested. |
testVolumes(const SphereF & sphere, bool occludersOnly)
Test whether the culling volumes added to the zone test positive on the given sphere, i.e.
whether they include or exclude the given sphere.