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

Function AddVertToAllEdges

editor/HRoom.cpp:886–897  ·  view source on GitHub ↗

Adds a new vertex to all instances of a given edge

Source from the content-addressed store, hash-verified

884
885// Adds a new vertex to all instances of a given edge
886void AddVertToAllEdges(room *rp, int v0, int v1, int new_v) {
887 face *fp;
888 int f, v;
889
890 for (f = 0, fp = rp->faces; f < rp->num_faces; f++, fp++) {
891 for (v = 0; v < fp->num_verts; v++) {
892 if (((fp->face_verts[v] == v0) && (fp->face_verts[(v + 1) % fp->num_verts] == v1)) ||
893 ((fp->face_verts[v] == v1) && (fp->face_verts[(v + 1) % fp->num_verts] == v0)))
894 AddVertToFace(rp, f, new_v, v);
895 }
896 }
897}
898
899// Adds a new point to all instances of a given edge
900// First adds the point to the room (or finds it there), then calls AddVertToAllEdges()

Callers 2

AddPointToAllEdgesFunction · 0.85
ClipFaceFunction · 0.85

Calls 1

AddVertToFaceFunction · 0.85

Tested by

no test coverage detected