const cMatrixf& cLight3DSpot::GetViewMatrix() { if(mlViewMatrixCount != GetTransformUpdateCount()) { mlViewMatrixCount = GetTransformUpdateCount(); m_mtxView = cMath::MatrixInverse(GetWorldMatrix()); } return m_mtxView; }
const cMatrixf& cLight3DSpot::GetViewProjMatrix() { if(mlViewProjMatrixCount != GetTransformUpdateCount() || mbViewProjUpdated || mbProjectionUpdated) { m_mtxViewProj = cMath::MatrixMul(GetProjectionMatrix(),GetViewMatrix()); m_mtxViewProj = cMath::MatrixMul(g_mtxTextureUnitFix, m_mtxViewProj); mlViewProjMatrixCount = GetTransformUpdateCount(); mbViewProjUpdated = false; } return m_mtxViewProj; }
cFrustum* cLight3DSpot::GetFrustum() { if(mlFrustumMatrixCount != GetTransformUpdateCount() || mbFrustumUpdated || mbProjectionUpdated) { mpFrustum->SetViewProjMatrix( GetProjectionMatrix(), GetViewMatrix(), mfFarAttenuation,mfNearClipPlane, mfFOV,mfAspect,GetWorldPosition(),false); mbFrustumUpdated = false; mlFrustumMatrixCount = GetTransformUpdateCount(); } return mpFrustum; }
int cColliderEntity::GetMatrixUpdateCount() { return GetTransformUpdateCount(); }
int cBillboard::GetMatrixUpdateCount() { return GetTransformUpdateCount(); }