MCPcopy Create free account
hub / github.com/Panzerschrek/Chasm-Reverse / BBoxIsOutsideView

Function BBoxIsOutsideView

PanzerChasm/client/map_drawers_common.cpp:32–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30}
31
32bool BBoxIsOutsideView(
33 const ViewClipPlanes& clip_planes,
34 const m_BBox3& bbox,
35 const m_Mat4& bbox_mat )
36{
37 for( const m_Plane3& plane : clip_planes )
38 {
39 bool is_inside= false;
40 for( unsigned int z= 0u; z < 2u; z++ )
41 for( unsigned int y= 0u; y < 2u; y++ )
42 for( unsigned int x= 0u; x < 2u; x++ )
43 {
44 const m_Vec3 point(
45 x == 0 ? bbox.min.x : bbox.max.x,
46 y == 0 ? bbox.min.y : bbox.max.y,
47 z == 0 ? bbox.min.z : bbox.max.z );
48
49 if( plane.IsPointAheadPlane( point * bbox_mat ) )
50 {
51 is_inside= true;
52 goto box_vertices_check_end;
53 }
54 }
55 box_vertices_check_end:
56
57 if( !is_inside ) // bbox is behind of one of clip planes
58 return true;
59 }
60
61 return false;
62}
63
64unsigned int GetModelBMPSpritePhase( const MapState::StaticModel& model )
65{

Callers 8

DrawMapRelatedModelsMethod · 0.85
DrawModelsMethod · 0.85
DrawItemsMethod · 0.85
DrawDynamicItemsMethod · 0.85
DrawMonstersMethod · 0.85
DrawMonstersBodyPartsMethod · 0.85
DrawRocketsMethod · 0.85
DrawGibsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected