diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2012-10-08 07:28:11 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2012-10-08 07:28:11 +0400 |
commit | 244ce92dbd1f32960e0f909933d99cd0e6027dcc (patch) | |
tree | ee71a9619fb257d9d7deffce53051fa1a6214cdf /source/gameengine/Ketsji/KX_Scene.cpp | |
parent | aa1e50be946dfeb17f9bb98b242bdbf6775f1ab6 (diff) |
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).
Diffstat (limited to 'source/gameengine/Ketsji/KX_Scene.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_Scene.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index a4237f9fabe..f6ab9af261e 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -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 |