Open
Description
class Particle
{
...
union
{
ParticleSystem * m_systemUnderControl; ///< the particle system attached to this particle (not the system that created us)
ParticleSystemID m_systemUnderControlID; ///< id of system attached to this particle (not the system that created us);
};
void Particle::loadPostProcess( void )
{
...
// tidy up the m_systemUnderControl pointer
if( m_systemUnderControlID != INVALID_PARTICLE_SYSTEM_ID )
{
ParticleSystem *system;
// find system
system = TheParticleSystemManager->findParticleSystem( m_systemUnderControlID ); // <---- what?
// set us as the control particle for this system
system->setControlParticle( this );
controlParticleSystem( system );
// sanity
if( m_systemUnderControlID == NULL )
{
DEBUG_CRASH(( "Particle::loadPostProcess - Unable to find system under control pointer\n" ));
throw SC_INVALID_DATA;
} // end if
} // end if
} // end loadPostProcess