MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / ObjectOutOfPortal

Function ObjectOutOfPortal

Descent3/terrainrender.cpp:958–974  ·  view source on GitHub ↗

Returns true if the object is outside of our terrain portal

Source from the content-addressed store, hash-verified

956}
957// Returns true if the object is outside of our terrain portal
958int ObjectOutOfPortal(object *obj) {
959 g3Point pnt1, pnt2;
960 uint8_t anded = 0xff;
961 g3_RotatePoint(&pnt1, &obj->min_xyz);
962 if (pnt1.p3_codes & CC_BEHIND)
963 return 0;
964 g3_ProjectPoint(&pnt1);
965 anded &= CodeTerrainPoint(&pnt1);
966 g3_RotatePoint(&pnt2, &obj->max_xyz);
967 if (pnt2.p3_codes & CC_BEHIND)
968 return 0;
969 g3_ProjectPoint(&pnt2);
970 anded &= CodeTerrainPoint(&pnt2);
971 if (anded)
972 return 1;
973 return 0;
974}
975obj_sort_item objs_to_render[MAX_OBJECTS + MAX_VIS_EFFECTS];
976obj_sort_item rooms_to_render[MAX_ROOMS];
977// Checks to see if this object can even be seen from our current viewpoint

Callers 2

RenderTerrainRoomsFunction · 0.85
RenderAllTerrainObjectsFunction · 0.85

Calls 3

g3_RotatePointFunction · 0.85
g3_ProjectPointFunction · 0.85
CodeTerrainPointFunction · 0.85

Tested by

no test coverage detected