MCPcopy Create free account
hub / github.com/carbonengine/trinity / IsBoxVisible

Method IsBoxVisible

trinity/TriFrustum.cpp:187–223  ·  view source on GitHub ↗

------------------------------------------------------------- Description: Tests for frustum-AABB intersection. May return false positive answers. Arguments: boundsMin - Min bounds of AABB boundsMax - Max bounds of AABB Return Value: true If AABB intersects / is inside frustum false If AABB is outside frustum -------------------------------------------------------------

Source from the content-addressed store, hash-verified

185// false If AABB is outside frustum
186// -------------------------------------------------------------
187bool TriFrustum::IsBoxVisible( const Vector3& boundsMin, const Vector3& boundsMax ) const
188{
189 Vector3 vmax;
190
191 for( int i = 0; i < 6; ++i )
192 {
193 if( m_planes[i].a > 0 )
194 {
195 vmax.x = boundsMax.x;
196 }
197 else
198 {
199 vmax.x = boundsMin.x;
200 }
201 if( m_planes[i].b > 0 )
202 {
203 vmax.y = boundsMax.y;
204 }
205 else
206 {
207 vmax.y = boundsMin.y;
208 }
209 if( m_planes[i].c > 0 )
210 {
211 vmax.z = boundsMax.z;
212 }
213 else
214 {
215 vmax.z = boundsMin.z;
216 }
217 if( DotCoord( m_planes[i], vmax ) < 0 )
218 {
219 return false;
220 }
221 }
222 return true;
223}
224
225bool TriFrustum::IsBoxVisible( const CcpMath::AxisAlignedBox& aabb ) const
226{

Callers 13

IsInFrustumMethod · 0.80
IsInFrustumMethod · 0.80
IsInFrustumMethod · 0.80
UpdateVisibilityMethod · 0.80
UpdateVisibilityMethod · 0.80
UpdateVisibilityMethod · 0.80
UpdateVisibilityMethod · 0.80
UpdateVisibilityMethod · 0.80
UpdateVisibilityMethod · 0.80
UpdateVisibilityMethod · 0.80
UpdateVisibilityMethod · 0.80
UpdateVisibilityMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected