MCPcopy Create free account
hub / github.com/OGRECave/ogre-next / _notifyAttached

Method _notifyAttached

OgreMain/src/OgreParticleSystem.cpp:987–1017  ·  view source on GitHub ↗

-----------------------------------------------------------------------

Source from the content-addressed store, hash-verified

985 Real ParticleSystem::getDefaultHeight() const { return mDefaultHeight; }
986 //-----------------------------------------------------------------------
987 void ParticleSystem::_notifyAttached( Node *parent )
988 {
989 MovableObject::_notifyAttached( parent );
990 if( mRenderer && mIsRendererConfigured )
991 {
992 mRenderer->_notifyAttached( parent );
993 }
994
995 if( parent && !mTimeController )
996 {
997 // Assume visible
998 mTimeSinceLastVisible = 0;
999 mLastVisibleFrame = Root::getSingleton().getNextFrameNumber();
1000
1001 // Create time controller when attached
1002 ControllerManager &mgr = ControllerManager::getSingleton();
1003 ControllerValueRealPtr updValue;
1004
1005 if( ParticleSystemManager::getSingleton().getSimulationTickRate() <= Real( 0.0 ) )
1006 updValue.reset( OGRE_NEW ParticleSystemUpdateValue( this ) );
1007 else
1008 updValue.reset( OGRE_NEW ParticleSystemUpdateValueDeterministic( this ) );
1009 mTimeController = mgr.createFrameTimePassthroughController( updValue );
1010 }
1011 else if( !parent && mTimeController )
1012 {
1013 // Destroy controller
1014 ControllerManager::getSingleton().destroyController( mTimeController );
1015 mTimeController = 0;
1016 }
1017 }
1018 //-----------------------------------------------------------------------
1019 void ParticleSystem::setMaterialName(
1020 const String &name,

Callers 1

configureRendererMethod · 0.45

Tested by

no test coverage detected