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

Function fvi_room

physics/findintersection.cpp:4453–4865  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4451}
4452
4453int fvi_room(int room_index, int from_portal, int room_obj) {
4454 vector hit_point; // where we hit
4455 float cur_dist; // distance to hit point
4456 const room *cur_room = &Rooms[room_index];
4457 int16_t i;
4458 int next_portals[MAX_NEXT_PORTALS];
4459 int num_next_portals = 0;
4460 int next_portal_index;
4461 int portal_num;
4462 // vector col_point[32];
4463 // vector col_normal[32];
4464 int num_cols = 0;
4465 object *this_obj;
4466 uint8_t msector = 0;
4467
4468 if (fvi_min_xyz.x <= cur_room->bbf_min_xyz.x) {
4469 msector |= 0x01;
4470 }
4471 if (fvi_min_xyz.y <= cur_room->bbf_min_xyz.y) {
4472 msector |= 0x02;
4473 }
4474 if (fvi_min_xyz.z <= cur_room->bbf_min_xyz.z) {
4475 msector |= 0x04;
4476 }
4477 if (fvi_max_xyz.x >= cur_room->bbf_max_xyz.x) {
4478 msector |= 0x08;
4479 }
4480 if (fvi_max_xyz.y >= cur_room->bbf_max_xyz.y) {
4481 msector |= 0x10;
4482 }
4483 if (fvi_max_xyz.z >= cur_room->bbf_max_xyz.z) {
4484 msector |= 0x20;
4485 }
4486
4487 if (fvi_query_ptr->thisobjnum >= 0)
4488 this_obj = &Objects[fvi_query_ptr->thisobjnum];
4489 else
4490 this_obj = nullptr;
4491
4492 ASSERT(room_index >= 0 && room_index <= Highest_room_index);
4493 ASSERT(Rooms[room_index].used);
4494 ASSERT((fvi_visit_list[room_index >> 3] & (0x01 << (room_index % 8))) == 0);
4495
4496 if (!(cur_room->flags & RF_EXTERNAL)) {
4497 fvi_visit_list[room_index >> 3] |= 0x01 << (room_index % 8);
4498 fvi_rooms_visited[fvi_num_rooms_visited] = room_index;
4499 fvi_num_rooms_visited++;
4500
4501 ASSERT(fvi_num_rooms_visited <= MAX_ROOMS);
4502 }
4503
4504 if (fvi_query_ptr->flags & FQ_IGNORE_WALLS) {
4505 vector face_normal;
4506 vector *vertex_ptr_list[MAX_VERTS_PER_FACE];
4507 int16_t count;
4508 bool f_backface;
4509 int face_info;
4510 int j; //, k;

Callers 2

fvi_FindIntersectionFunction · 0.85
check_hit_objFunction · 0.85

Calls 9

room_movement_AABBFunction · 0.85
GetFacePhysicsFlagsFunction · 0.85
FastVectorBBoxFunction · 0.85
PhysPastPortalFunction · 0.85
check_line_to_faceFunction · 0.85
CheckTransparentPointFunction · 0.85
compute_movement_AABBFunction · 0.85
GetTerrainRoomFromPosFunction · 0.85
do_fvi_terrainFunction · 0.85

Tested by

no test coverage detected