| 2608 | #endif |
| 2609 | |
| 2610 | int 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 |
no test coverage detected