Rotates all the points in a room
| 488 | |
| 489 | // Rotates all the points in a room |
| 490 | void 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 |
no test coverage detected