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

Function RotateRoomPoints

Descent3/render.cpp:490–509  ·  view source on GitHub ↗

Rotates all the points in a room

Source from the content-addressed store, hash-verified

488
489// Rotates all the points in a room
490void RotateRoomPoints(room *rp, vector *world_vecs) {
491 int i;
492 // Jig the vertices a bit if being deformed
493 if (Viewer_object->effect_info && (Viewer_object->effect_info->type_flags & EF_DEFORM)) {
494 for (i = 0; i < rp->num_verts; i++) {
495 vector vec = world_vecs[i];
496 float val = ((ps_rand() % 1000) - 500.0) / 500.0;
497 val *= Viewer_object->effect_info->deform_time;
498 vec += Global_alter_vec * (Viewer_object->effect_info->deform_range * val);
499
500 g3_RotatePoint(&World_point_buffer[rp->wpb_index + i], &vec);
501 g3_ProjectPoint(&World_point_buffer[rp->wpb_index + i]);
502 }
503 } else {
504 for (i = 0; i < rp->num_verts; i++) {
505 g3_RotatePoint(&World_point_buffer[rp->wpb_index + i], &world_vecs[i]);
506 g3_ProjectPoint(&World_point_buffer[rp->wpb_index + i]);
507 }
508 }
509}
510
511// Given a vector, reflects that vector off of a mirror vector
512// Useful for specular and other reflective surfaces

Callers 5

MarkFacesForRenderingFunction · 0.85
BuildRoomListFunction · 0.85
RenderRoomSortedFunction · 0.85
RenderRoomUnsortedFunction · 0.85
RenderMirroredRoomFunction · 0.85

Calls 3

ps_randFunction · 0.85
g3_RotatePointFunction · 0.85
g3_ProjectPointFunction · 0.85

Tested by

no test coverage detected