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

Function ComputeRoomCenter

Descent3/room.cpp:759–771  ·  view source on GitHub ↗

Finds the center point of a room Parameters: vp - filled in with the center point rp - the room whose center to find

Source from the content-addressed store, hash-verified

757// Parameters: vp - filled in with the center point
758// rp - the room whose center to find
759void ComputeRoomCenter(vector *vp, room *rp) {
760 int i;
761
762 vp->x = vp->y = vp->z = 0;
763
764 for (i = 0; i < rp->num_verts; i++)
765 *vp += rp->verts[i];
766
767#ifdef NEWEDITOR
768 if (rp->num_verts)
769#endif
770 *vp /= rp->num_verts;
771}
772
773// Computes the center point on a face by averaging the points in the face
774void ComputeCenterPointOnFace(vector *vp, room *rp, int facenum) {

Callers 7

AllocLoadRoomFunction · 0.85
SizeRoomVerticesFunction · 0.85
OnViewCenterOnCubeMethod · 0.85
SetViewerFromRoomFaceFunction · 0.85
SetEditorViewerFunction · 0.85
compute_costsFunction · 0.85
CreatePlayerObjectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected