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

Method updateFroth

Engine/source/T3D/rigidShape.cpp:1703–1725  ·  view source on GitHub ↗

--------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1701
1702//--------------------------------------------------------------------------
1703void RigidShape::updateFroth( F32 dt )
1704{
1705 // update bubbles
1706 Point3F moveDir = getVelocity();
1707
1708 Point3F contactPoint;
1709
1710 F32 speed = moveDir.len();
1711 if( speed < mDataBlock->splashVelEpsilon ) speed = 0.0;
1712
1713 U32 emitRate = (U32)(speed * mDataBlock->splashFreqMod * dt);
1714
1715 U32 i;
1716 for( i=0; i<RigidShapeData::VC_NUM_SPLASH_EMITTERS; i++ )
1717 {
1718 if( mSplashEmitterList[i] )
1719 {
1720 mSplashEmitterList[i]->emitParticles( contactPoint, contactPoint, Point3F( 0.0, 0.0, 1.0 ),
1721 moveDir, emitRate );
1722 }
1723 }
1724
1725}
1726
1727//--------------------------------------------------------------------------
1728// Returns true if shape is intersecting a water surface (roughly)

Callers

nothing calls this directly

Calls 4

getVelocityFunction · 0.85
Point3FClass · 0.50
lenMethod · 0.45
emitParticlesMethod · 0.45

Tested by

no test coverage detected