Place the given group at the specified room face The function merely causes the group to be drawn in the editor, allowing the user to line it up before attaching it. The function AttachGroup() must be called to do the actual attachment. Parameters: destroomp, destside - where to place the group g - the group to place
| 399 | // Parameters: destroomp, destside - where to place the group |
| 400 | // g - the group to place |
| 401 | void PlaceGroup(room *destroomp, int destface, group *g) { |
| 402 | // Clear the placed room, if one exists |
| 403 | Placed_room = -1; |
| 404 | |
| 405 | ASSERT(destroomp->faces[destface].portal_num == -1); |
| 406 | |
| 407 | // Set globals |
| 408 | Placed_group = g; |
| 409 | Placed_room_orient.fvec = destroomp->faces[destface].normal; |
| 410 | Placed_room_angle = 0; |
| 411 | Placed_baseroomp = destroomp; |
| 412 | Placed_baseface = destface; |
| 413 | |
| 414 | // Compute attach points on each face |
| 415 | #ifndef NEWEDITOR |
| 416 | ComputeCenterPointOnFace(&Placed_room_attachpoint, destroomp, destface); |
| 417 | ComputeCenterPointOnFace(&Placed_room_origin, &g->rooms[g->attachroom], g->attachface); |
| 418 | #else |
| 419 | float ComputeFaceBoundingCircle(vector * center, room * rp, int facenum); |
| 420 | ComputeFaceBoundingCircle(&Placed_room_attachpoint, destroomp, destface); |
| 421 | ComputeFaceBoundingCircle(&Placed_room_origin, &g->rooms[g->attachroom], g->attachface); |
| 422 | #endif |
| 423 | |
| 424 | // Compute initial orientation matrix |
| 425 | ComputePlacedRoomMatrix(); |
| 426 | |
| 427 | // Set the flag |
| 428 | State_changed = 1; |
| 429 | } |
| 430 | |
| 431 | #include "terrain.h" |
| 432 |
no test coverage detected