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

Method collidingWithWater

Engine/source/T3D/rigidShape.cpp:1730–1744  ·  view source on GitHub ↗

-------------------------------------------------------------------------- Returns true if shape is intersecting a water surface (roughly) --------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1728// Returns true if shape is intersecting a water surface (roughly)
1729//--------------------------------------------------------------------------
1730bool RigidShape::collidingWithWater( Point3F &waterHeight )
1731{
1732 Point3F curPos = getPosition();
1733
1734 F32 height = mFabs( mObjBox.maxExtents.z - mObjBox.minExtents.z );
1735
1736 RayInfo rInfo;
1737 if( gClientContainer.castRay( curPos + Point3F(0.0, 0.0, height), curPos, WaterObjectType, &rInfo) )
1738 {
1739 waterHeight = rInfo.point;
1740 return true;
1741 }
1742
1743 return false;
1744}
1745
1746void RigidShape::setEnergyLevel(F32 energy)
1747{

Callers

nothing calls this directly

Calls 4

getPositionFunction · 0.85
mFabsFunction · 0.85
Point3FClass · 0.50
castRayMethod · 0.45

Tested by

no test coverage detected