mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 16:14:38 +00:00
SceneCullingState with culling and camera frustum
- Fix for issue https://github.com/GarageGames/Torque3D/issues/525 This fix takes into account the skewed view into the world when you have a projection offset and the ability to see further into the scene at the edges opposite to the offset. - SceneCullingState now has two frustum rather than one: a culling frustum and camera frustum. - The camera frustum should be referenced when you need the projection matrix or don't want a skewed frustum. - The culling frustum should be referenced during any scene culling or when determining what dynamic geometry to render. It currently skews itself to take into account any projection offset (automatically calculated in SceneCullingState constructor). - When there is no projection offset, the camera frustum and culling frustum are the same. This usually means any time when not using the Oculus Rift.
This commit is contained in:
parent
9af13248cf
commit
91e542b8ec
22 changed files with 161 additions and 47 deletions
|
|
@ -100,9 +100,12 @@ class SceneCullingState
|
|||
/// The viewing state that defines how the scene is being viewed.
|
||||
SceneCameraState mCameraState;
|
||||
|
||||
/// The root culling volume corresponding to the camera frustum.
|
||||
/// The root culling volume corresponding to the culling frustum.
|
||||
SceneCullingVolume mRootVolume;
|
||||
|
||||
/// The root culling frustum, which may be different from the camera frustum
|
||||
Frustum mCullingFrustum;
|
||||
|
||||
/// Occluders that have been added to this render state. Adding an occluder does not
|
||||
/// necessarily result in an occluder volume being added. To not repeatedly try to
|
||||
/// process the same occluder object, all objects that are added are recorded here.
|
||||
|
|
@ -136,7 +139,10 @@ class SceneCullingState
|
|||
SceneManager* getSceneManager() const { return mSceneManager; }
|
||||
|
||||
/// Return the root frustum which is used to set up scene visibility.
|
||||
const Frustum& getFrustum() const { return getCameraState().getFrustum(); }
|
||||
const Frustum& getCullingFrustum() const { return mCullingFrustum; }
|
||||
|
||||
/// Return the root frustum which is used to set up scene visibility.
|
||||
const Frustum& getCameraFrustum() const { return getCameraState().getFrustum(); }
|
||||
|
||||
/// Return the viewing state that defines how the scene is being viewed.
|
||||
const SceneCameraState& getCameraState() const { return mCameraState; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue