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

Method _scatterTransform

Engine/source/sfx/sfxSource.cpp:1334–1349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1332//-----------------------------------------------------------------------------
1333
1334void SFXSource::_scatterTransform()
1335{
1336 if( mDescription )
1337 {
1338 Point3F position = mTransform.getPosition();
1339 for( U32 i = 0; i < 3; ++ i )
1340 {
1341 F32 scatterDist = mDescription->mScatterDistance[ i ];
1342 if( scatterDist != 0.f )
1343 position[ 0 ] += gRandGen.randF( - scatterDist, scatterDist );
1344 }
1345 mTransform.setPosition( position );
1346 }
1347
1348 mTransformScattered = true;
1349}
1350
1351//=============================================================================
1352// Console Methods.

Callers

nothing calls this directly

Calls 3

randFMethod · 0.80
getPositionMethod · 0.45
setPositionMethod · 0.45

Tested by

no test coverage detected