From: <axl...@us...> - 2009-03-04 00:46:52
|
Revision: 176 http://hgengine.svn.sourceforge.net/hgengine/?rev=176&view=rev Author: axlecrusher Date: 2009-03-04 00:46:51 +0000 (Wed, 04 Mar 2009) Log Message: ----------- test clipping Modified Paths: -------------- Mercury2/src/BoundingBox.cpp Mercury2/src/Viewport.cpp Modified: Mercury2/src/BoundingBox.cpp =================================================================== --- Mercury2/src/BoundingBox.cpp 2009-03-03 22:30:27 UTC (rev 175) +++ Mercury2/src/BoundingBox.cpp 2009-03-04 00:46:51 UTC (rev 176) @@ -53,10 +53,8 @@ const BoundingBox& bb = *m_bb; BoundingBox gbb = m_bb->Transform( GetGlobalMatrix() ); + if ( FRUSTUM->Clip( gbb ) ) return; - FRUSTUM->m_planes[PFAR].IsBehindPlane( gbb.GetCenter() ); -// printf("clip %d\n", FRUSTUM->m_planes[PFAR].IsBehindPlane( gbb.GetCenter() )); - const float* center = m_bb->GetCenter(); const float* extend = m_bb->GetExtend(); Modified: Mercury2/src/Viewport.cpp =================================================================== --- Mercury2/src/Viewport.cpp 2009-03-03 22:30:27 UTC (rev 175) +++ Mercury2/src/Viewport.cpp 2009-03-04 00:46:51 UTC (rev 176) @@ -127,10 +127,10 @@ bool Frustum::Clip(const BoundingBox& bb) const { - bool inView = false; - for (uint8_t i = 0; (i < 6) && !inView; ++i) + bool inView = true; + for (uint8_t i = 0; (i < 6) && inView; ++i) { - inView = m_planes[i].IsBehindPlane( bb )?inView:true; + inView = m_planes[i].IsBehindPlane( bb )?false:inView; } return !inView; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |