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

Method createSplash

Engine/source/T3D/player.cpp:7086–7106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7084//--------------------------------------------------------------------------
7085
7086void Player::createSplash( Point3F &pos, F32 speed )
7087{
7088 if ( speed >= mDataBlock->hardSplashSoundVel )
7089 SFX->playOnce( mDataBlock->sound[PlayerData::ImpactWaterHard], &getTransform() );
7090 else if ( speed >= mDataBlock->medSplashSoundVel )
7091 SFX->playOnce( mDataBlock->sound[PlayerData::ImpactWaterMedium], &getTransform() );
7092 else
7093 SFX->playOnce( mDataBlock->sound[PlayerData::ImpactWaterEasy], &getTransform() );
7094
7095 if( mDataBlock->splash )
7096 {
7097 MatrixF trans = getTransform();
7098 trans.setPosition( pos );
7099 Splash *splash = new Splash;
7100 splash->onNewDataBlock( mDataBlock->splash, false );
7101 splash->setTransform( trans );
7102 splash->setInitialState( trans.getPosition(), Point3F( 0.0, 0.0, 1.0 ) );
7103 if (!splash->registerObject())
7104 delete splash;
7105 }
7106}
7107
7108
7109bool 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