MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / castRay

Method castRay

Engine/source/afx/ce/afxModel.cpp:625–672  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

623}
624
625bool afxModel::castRay(const Point3F &start, const Point3F &end, RayInfo* info)
626{
627 if (shape_inst)
628 {
629 RayInfo shortest;
630 shortest.t = 1e8;
631
632 info->object = NULL;
633 if (mLOSDetails.size() > 0)
634 {
635 for (U32 i = 0; i < mLOSDetails.size(); i++)
636 {
637 shape_inst->animate(mLOSDetails[i]);
638 if (shape_inst->castRay(start, end, info, mLOSDetails[i]))
639 {
640 info->object = this;
641 if (info->t < shortest.t)
642 shortest = *info;
643 }
644 }
645 }
646 else
647 {
648 if (mCollisionDetails.size() > 0)
649 {
650 for (U32 i = 0; i < mCollisionDetails.size(); i++)
651 {
652 shape_inst->animate(mCollisionDetails[i]);
653 if (shape_inst->castRay(start, end, info, mCollisionDetails[i]))
654 {
655 info->object = this;
656 if (info->t < shortest.t)
657 shortest = *info;
658 }
659 }
660 }
661 }
662
663 if (info->object == this)
664 {
665 // Copy out the shortest time...
666 *info = shortest;
667 return true;
668 }
669 }
670
671 return false;
672}
673
674U32 afxModel::unique_anim_tag_counter = 1;
675#define BAD_ANIM_ID 999999999

Callers 11

emitParticlesMethod · 0.45
processTickMethod · 0.45
validateEyePointMethod · 0.45
avoid_blocked_viewMethod · 0.45
test_blocked_lineMethod · 0.45
rolloverRayCastMethod · 0.45
freeTargetingRayCastMethod · 0.45
groundConformPointMethod · 0.45
onRenderMethod · 0.45
updateParamsMethod · 0.45
updateParamsMethod · 0.45

Calls 2

sizeMethod · 0.45
animateMethod · 0.45

Tested by 1

test_blocked_lineMethod · 0.36