-------------------------------------------------------------------------------------- Description: Implements ITr2GenericParticleConstraint interface. Binds the constraint with the provided particle system. Looks up a particle element with the given type/name in the particle system. Arguments: system - Particle system that owns the constraint ------------------------------------------------------
| 115 | // system - Particle system that owns the constraint |
| 116 | // -------------------------------------------------------------------------------------- |
| 117 | void Tr2ElementBlendConstraint::Bind( Tr2ParticleSystem* system ) |
| 118 | { |
| 119 | m_isValid = false; |
| 120 | |
| 121 | const Tr2ParticleElementDataMap& declaration = system->GetElementDeclaration(); |
| 122 | auto i = declaration.find( m_name ); |
| 123 | if( i == declaration.end() ) |
| 124 | { |
| 125 | CCP_LOGERR( "Tr2BlendElementConstraint element \"%s\" not found in the particle system", m_name.GetName().c_str() ); |
| 126 | } |
| 127 | else |
| 128 | { |
| 129 | m_element = i->second; |
| 130 | m_isValid = true; |
| 131 | } |
| 132 | } |