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

Method _scatterTransform

Engine/source/sfx/sfxSource.cpp:1324–1339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1322//-----------------------------------------------------------------------------
1323
1324void SFXSource::_scatterTransform()
1325{
1326 if( mDescription )
1327 {
1328 Point3F position = mTransform.getPosition();
1329 for( U32 i = 0; i < 3; ++ i )
1330 {
1331 F32 scatterDist = mDescription->mScatterDistance[ i ];
1332 if( scatterDist != 0.f )
1333 position[ 0 ] += gRandGen.randF( - scatterDist, scatterDist );
1334 }
1335 mTransform.setPosition( position );
1336 }
1337
1338 mTransformScattered = true;
1339}
1340
1341//=============================================================================
1342// Console Methods.

Callers

nothing calls this directly

Calls 3

randFMethod · 0.80
getPositionMethod · 0.45
setPositionMethod · 0.45

Tested by

no test coverage detected