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

Function fvi_FindIntersection

physics/findintersection.cpp:2610–2900  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2608#endif
2609
2610int fvi_FindIntersection(fvi_query *fq, fvi_info *hit_data, bool no_subdivision) {
2611 int i;
2612 object *this_obj;
2613 int last_sim_trigger_faces;
2614
2615 if (fq->startroom == -1) {
2616 return HIT_NONE;
2617 }
2618
2619#ifndef NED_PHYSICS
2620 if (Tracking_FVI) {
2621 mprintf(0, "Track FVI - Ray %d, thisobjnum=%d, startroom=%d, rad=%f\n", FVI_counter, fq->thisobjnum, fq->startroom,
2622 fq->rad);
2623 }
2624#endif
2625
2626 /////////////////////////////////////////
2627 // Debug Code
2628#ifdef USE_RTP
2629 INT64 curr_time;
2630 RTP_GETCLOCK(curr_time);
2631
2632 RTP_tSTARTTIME(fvi_time, curr_time);
2633 RTP_INCRVALUE(fvi_calls, 1);
2634#endif
2635
2636 FVI_counter++;
2637 /////////////////////////////////////////
2638
2639 // Setup our globals
2640 fvi_hit_data_ptr = hit_data;
2641 fvi_query_ptr = fq;
2642
2643 if (fq->thisobjnum >= 0)
2644 this_obj = &Objects[fq->thisobjnum];
2645 else
2646 this_obj = nullptr;
2647
2648 if (fq->rad == 0.0f)
2649 fvi_zero_rad = true;
2650 else
2651 fvi_zero_rad = false;
2652
2653 ASSERT(fq != nullptr && hit_data != nullptr);
2654
2655 ASSERT(std::isfinite(fq->p1->x)); // Caller wants to go to infinity! -- Not FVI's fault.
2656 ASSERT(std::isfinite(fq->p1->y)); // Caller wants to go to infinity! -- Not FVI's fault.
2657 ASSERT(std::isfinite(fq->p1->z)); // Caller wants to go to infinity! -- Not FVI's fault.
2658
2659 fvi_movement_delta = *fq->p1 - *fq->p0;
2660
2661 // mprintf(0, "FVI:----New search----\n");
2662 // mprintf(0, "FVI: P0 is %f, %f, %f\n", XYZ(fq->p0));
2663 if (fq->flags & FQ_NEW_RECORD_LIST) {
2664 Fvi_num_recorded_faces = 0;
2665 }
2666 last_sim_trigger_faces = Fvi_num_recorded_faces;
2667

Callers 15

BeginSoundFrameMethod · 0.85
do_physics_simFunction · 0.85
PhysCastWalkRayFunction · 0.85
do_walking_simFunction · 0.85
do_vis_physics_simFunction · 0.85
MoveObjectFunction · 0.85
OnTrigAddFloatingMethod · 0.85
ShootRayForLightingMethod · 0.85
MovePathNodeToPosFunction · 0.85
InsertNodeIntoPathFunction · 0.85
OnPathpadCenterViewMethod · 0.85

Calls 11

compute_movement_AABBFunction · 0.85
is_long_xz_rayFunction · 0.85
vm_NormalizeVectorFunction · 0.85
GetTerrainRoomFromPosFunction · 0.85
do_fvi_terrainFunction · 0.85
fvi_roomFunction · 0.85
fvi_rooms_objsFunction · 0.85
check_ceilingFunction · 0.85
fvi_QuickRoomCheckFunction · 0.85
make_trigger_face_listFunction · 0.85
vm_VectorDistanceFunction · 0.50

Tested by

no test coverage detected