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

Method onAdd

Engine/source/T3D/levelInfo.cpp:282–309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280//-----------------------------------------------------------------------------
281
282bool LevelInfo::onAdd()
283{
284 if ( !Parent::onAdd() )
285 return false;
286
287 // If no sound ambience has been set, default to
288 // 'AudioAmbienceDefault'.
289
290 if( !mSoundAmbience )
291 Sim::findObject( "AudioAmbienceDefault", mSoundAmbience );
292
293 // Set up sound on client.
294
295 if( isClientObject() )
296 {
297 SFX->setDistanceModel( mSoundDistanceModel );
298
299 // Set up the global ambient soundscape.
300
301 mSoundscape = SFX->getSoundscapeManager()->getGlobalSoundscape();
302 if( mSoundAmbience )
303 mSoundscape->setAmbience( mSoundAmbience );
304 }
305
306 _updateSceneGraph();
307
308 return true;
309}
310
311//-----------------------------------------------------------------------------
312

Callers

nothing calls this directly

Calls 5

getGlobalSoundscapeMethod · 0.80
getSoundscapeManagerMethod · 0.80
setAmbienceMethod · 0.80
findObjectFunction · 0.50
setDistanceModelMethod · 0.45

Tested by

no test coverage detected