BGE: Setting up the RAS_ICanvas interface as the primary way to alter the OpenGL

viewport. This helps to eliminate OpenGL calls in weird places like the physics
code and to reduce glGet calls, which are expensive.

There should be no functional changes (except maybe a very slight speed improvement).
This commit is contained in:
2012-10-08 03:28:11 +00:00
parent aa1e50be94
commit 244ce92dbd
15 changed files with 88 additions and 30 deletions

View File

@@ -1502,7 +1502,15 @@ void KX_Scene::CalculateVisibleMeshes(RAS_IRasterizer* rasty,KX_Camera* cam, int
planes[4].setValue(cplanes[2].getValue()); // top
planes[5].setValue(cplanes[3].getValue()); // bottom
CullingInfo info(layer);
dbvt_culling = m_physicsEnvironment->cullingTest(PhysicsCullingCallback,&info,planes,5,m_dbvt_occlusion_res);
double mvmat[16] = {0};
cam->GetModelviewMatrix().getValue(mvmat);
double pmat[16] = {0};
cam->GetProjectionMatrix().getValue(pmat);
dbvt_culling = m_physicsEnvironment->cullingTest(PhysicsCullingCallback,&info,planes,5,m_dbvt_occlusion_res,
KX_GetActiveEngine()->GetCanvas()->GetViewPort(),
mvmat, pmat);
}
if (!dbvt_culling) {
// the physics engine couldn't help us, do it the hard way