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

Method castRay

Engine/source/environment/waterBlock.cpp:630–648  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

628}
629
630bool WaterBlock::castRay( const Point3F &start, const Point3F &end, RayInfo *info )
631{
632 // Simply look for the hit on the water plane
633 // and ignore any future issues with waves, etc.
634 const Point3F norm(0,0,1);
635 PlaneF plane( Point3F::Zero, norm );
636
637 F32 hit = plane.intersect( start, end );
638 if ( hit < 0.0f || hit > 1.0f )
639 return false;
640
641 info->t = hit;
642 info->object = this;
643 info->point = start + ( ( end - start ) * hit );
644 info->normal = norm;
645 info->material = mMatInstances[WaterMat];
646
647 return mObjBox.isContained(info->point);
648}
649
650bool WaterBlock::buildPolyList( PolyListContext context, AbstractPolyList* polyList, const Box3F& box, const SphereF& )
651{

Callers

nothing calls this directly

Calls 2

intersectMethod · 0.45
isContainedMethod · 0.45

Tested by

no test coverage detected