Alternate call for CFrustum plane generation

This commit is contained in:
Jack Andersen 2017-02-23 22:28:06 -10:00
parent 69627f4bf3
commit 8702ae7d97
1 changed files with 7 additions and 3 deletions

View File

@ -12,10 +12,9 @@ class CFrustum
CPlane planes[6]; CPlane planes[6];
public: public:
inline void updatePlanes(const CTransform& modelview, const CProjection& projection) inline void updatePlanes(const CMatrix4f& modelview, const CMatrix4f& projection)
{ {
CMatrix4f mv = modelview.toMatrix4f(); CMatrix4f mvp = projection * modelview;
CMatrix4f mvp = projection.getCachedMatrix() * mv;
CMatrix4f mvp_rm = mvp.transposed(); CMatrix4f mvp_rm = mvp.transposed();
#if __SSE__ #if __SSE__
@ -85,6 +84,11 @@ public:
planes[5].normalize(); planes[5].normalize();
} }
inline void updatePlanes(const CTransform& modelview, const CProjection& projection)
{
updatePlanes(modelview.toMatrix4f(), projection.getCachedMatrix());
}
inline bool aabbFrustumTest(const CAABox& aabb) const inline bool aabbFrustumTest(const CAABox& aabb) const
{ {
CVector3f vmin, vmax; CVector3f vmin, vmax;