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

Method isUnderwater

Engine/source/environment/waterBlock.cpp:541–562  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

539}
540
541bool WaterBlock::isUnderwater( const Point3F &pnt ) const
542{
543 // Transform point into object space so we can test if it is within
544 // the WaterBlock's object box, include rotation/scale.
545
546 Point3F objPnt = pnt;
547 mWorldToObj.mulP( pnt, &objPnt );
548
549 objPnt.z -= 0.1f;
550
551 Box3F testBox = mObjBox;
552 testBox.scale( mObjScale );
553
554 // We already tested if below the surface plane,
555 // so clamping the z height of the box is not really necessary.
556 testBox.maxExtents.z = testBox.getCenter().z;
557
558 if ( testBox.isContained( objPnt ) )
559 return true;
560
561 return false;
562}
563
564void WaterBlock::clearVertBuffers()
565{

Callers

nothing calls this directly

Calls 4

mulPMethod · 0.80
scaleMethod · 0.45
getCenterMethod · 0.45
isContainedMethod · 0.45

Tested by

no test coverage detected