|
From: <axl...@us...> - 2009-07-04 15:38:53
|
Revision: 401
http://hgengine.svn.sourceforge.net/hgengine/?rev=401&view=rev
Author: axlecrusher
Date: 2009-07-04 15:38:52 +0000 (Sat, 04 Jul 2009)
Log Message:
-----------
add culling to render
Modified Paths:
--------------
Mercury2/src/HGMDLModel.cpp
Modified: Mercury2/src/HGMDLModel.cpp
===================================================================
--- Mercury2/src/HGMDLModel.cpp 2009-07-04 15:37:58 UTC (rev 400)
+++ Mercury2/src/HGMDLModel.cpp 2009-07-04 15:38:52 UTC (rev 401)
@@ -60,9 +60,17 @@
void HGMDLModel::Render(const MercuryNode* node)
{
+ bool cull;
if ( GetLoadState() != LOADING )
+ {
for(uint16_t i = 0; i < m_meshes.size(); ++i)
- m_meshes[i]->Render(node);
+ {
+ cull = false;
+ const BoundingVolume* bv = m_meshes[i]->GetBoundingVolume();
+ if (bv) cull = bv->FrustumCull();
+ if ( !cull ) m_meshes[i]->Render(node);
+ }
+ }
}
void HGMDLModel::LoadHGMDL( const MString& path )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|