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

Function DrawRoomRotated

editor/drawworld.cpp:650–668  ·  view source on GitHub ↗

Draw a room rotated and placed in space

Source from the content-addressed store, hash-verified

648
649// Draw a room rotated and placed in space
650void DrawRoomRotated(room *rp, vector *rotpoint, matrix *rotmat, vector *placepoint, int room_color) {
651 int fn, vn;
652 face *fp;
653
654 ResetEdgeList(MAX_EDGES);
655
656 // Rotate all the points
657 for (vn = 0; vn < rp->num_verts; vn++) {
658 vector tv;
659 tv = (rp->verts[vn] - *rotpoint) * *rotmat + *placepoint;
660 g3_RotatePoint((g3Point *)&World_point_buffer[vn], &tv);
661 }
662
663 for (fn = 0, fp = rp->faces; fn < rp->num_faces; fn++, fp++)
664 for (vn = 0; vn < fp->num_verts; vn++)
665 AddEdge(fp->face_verts[vn], fp->face_verts[(vn + 1) % fp->num_verts], ET_FACING);
666
667 DrawEdges(room_color);
668}
669
670void DrawRoomFace(ddgr_color color, room *rp, int facenum) {
671 face *fp = &rp->faces[facenum];

Callers 1

DrawWorldFunction · 0.85

Calls 4

ResetEdgeListFunction · 0.85
g3_RotatePointFunction · 0.85
AddEdgeFunction · 0.85
DrawEdgesFunction · 0.85

Tested by

no test coverage detected