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

Method castRay

Engine/source/environment/waterBlock.cpp:628–646  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

intersectMethod · 0.45
isContainedMethod · 0.45

Tested by

no test coverage detected