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

Function ComputeCenterPointOnFace

Descent3/room.cpp:774–784  ·  view source on GitHub ↗

Computes the center point on a face by averaging the points in the face

Source from the content-addressed store, hash-verified

772
773// Computes the center point on a face by averaging the points in the face
774void ComputeCenterPointOnFace(vector *vp, room *rp, int facenum) {
775 face *fp = &rp->faces[facenum];
776 int i;
777
778 vp->x = vp->y = vp->z = 0;
779
780 for (i = 0; i < fp->num_verts; i++)
781 *vp += rp->verts[fp->face_verts[i]];
782
783 *vp /= fp->num_verts;
784}
785
786// the minimum magnitude of a surface normal that we're willing to accept
787#define MIN_NORMAL_MAG 0.035

Callers 15

HObjectPlaceFunction · 0.85
PlaceGroupFunction · 0.85
PlaceGroupTerrainFunction · 0.85
SizeFaceVerticesFunction · 0.85
CheckRoomFunction · 0.85
SetViewerFromRoomFaceFunction · 0.85
PlaceRoomFunction · 0.85
BuildBridgeFunction · 0.85
JoinRoomsFunction · 0.85
DropRoomFunction · 0.85
PlaceExternalRoomFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected