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

Method createSplash

Engine/source/T3D/player.cpp:7241–7261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7239//--------------------------------------------------------------------------
7240
7241void Player::createSplash( Point3F &pos, F32 speed )
7242{
7243 if ( speed >= mDataBlock->hardSplashSoundVel )
7244 SFX->playOnce( mDataBlock->getPlayerSoundProfile(PlayerData::ImpactWaterHard), &getTransform() );
7245 else if ( speed >= mDataBlock->medSplashSoundVel )
7246 SFX->playOnce( mDataBlock->getPlayerSoundProfile(PlayerData::ImpactWaterMedium), &getTransform() );
7247 else
7248 SFX->playOnce( mDataBlock->getPlayerSoundProfile(PlayerData::ImpactWaterEasy), &getTransform() );
7249
7250 if( mDataBlock->splash )
7251 {
7252 MatrixF trans = getTransform();
7253 trans.setPosition( pos );
7254 Splash *splash = new Splash;
7255 splash->onNewDataBlock( mDataBlock->splash, false );
7256 splash->setTransform( trans );
7257 splash->setInitialState( trans.getPosition(), Point3F( 0.0, 0.0, 1.0 ) );
7258 if (!splash->registerObject())
7259 delete splash;
7260 }
7261}
7262
7263
7264bool Player::isControlObject()

Callers

nothing calls this directly

Calls 8

Point3FClass · 0.50
playOnceMethod · 0.45
setPositionMethod · 0.45
onNewDataBlockMethod · 0.45
setTransformMethod · 0.45
setInitialStateMethod · 0.45
getPositionMethod · 0.45
registerObjectMethod · 0.45

Tested by

no test coverage detected