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

Method castRay

Engine/source/T3D/shapeBase.cpp:2791–2819  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2789}
2790
2791bool ShapeBase::castRay(const Point3F &start, const Point3F &end, RayInfo* info)
2792{
2793 if (mShapeInstance)
2794 {
2795 RayInfo shortest;
2796 shortest.t = 1e8;
2797
2798 info->object = NULL;
2799 for (U32 i = 0; i < mDataBlock->LOSDetails.size(); i++)
2800 {
2801 mShapeInstance->animate(mDataBlock->LOSDetails[i]);
2802 if (mShapeInstance->castRay(start, end, info, mDataBlock->LOSDetails[i]))
2803 {
2804 info->object = this;
2805 if (info->t < shortest.t)
2806 shortest = *info;
2807 }
2808 }
2809
2810 if (info->object == this)
2811 {
2812 // Copy out the shortest time...
2813 *info = shortest;
2814 return true;
2815 }
2816 }
2817
2818 return false;
2819}
2820
2821bool ShapeBase::castRayRendered(const Point3F &start, const Point3F &end, RayInfo* info)
2822{

Callers 3

getCameraTransformMethod · 0.45
emitDustMethod · 0.45
shapeBase.cppFile · 0.45

Calls 2

sizeMethod · 0.45
animateMethod · 0.45

Tested by

no test coverage detected