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:
DavidWyand-GG 2013-11-07 15:07:16 -05:00
parent 9af13248cf
commit 91e542b8ec
22 changed files with 161 additions and 47 deletions

View file

@ -67,7 +67,7 @@ void SingleLightShadowMap::_render( RenderPassManager* renderPass,
GFXTransformSaver saver;
MatrixF lightMatrix;
calcLightMatrices( lightMatrix, diffuseState->getFrustum() );
calcLightMatrices( lightMatrix, diffuseState->getCameraFrustum() );
lightMatrix.inverse();
GFX->setWorldMatrix(lightMatrix);