-------------------------------------------------------------------------------------- Description: Implements ITr2AttributeGenerator interface. Generates random integer values for new particle component (element). Arguments: position - Position of the "parent" particle (unused). velocity - Velocity of the "parent" particle (unused). paticle - (out) New particle data: Tr2ParticleElementData::COUNT
| 37 | // The generator fills element identified by generator's m_name with random values. |
| 38 | // -------------------------------------------------------------------------------------- |
| 39 | void Tr2RandomIntegerAttributeGenerator::Generate( const Vector3* position, |
| 40 | const Vector3* velocity, |
| 41 | float** particle ) |
| 42 | { |
| 43 | if( !m_valid ) |
| 44 | { |
| 45 | return; |
| 46 | } |
| 47 | float* data = particle[m_element.m_bufferType] + m_element.m_offset; |
| 48 | for( unsigned i = 0; i < m_element.m_dimension; ++i ) |
| 49 | { |
| 50 | data[i] = floor( m_minRange[i] + ( m_maxRange[i] - m_minRange[i] ) * Tr2ParticleSystem::RandFloat() + 0.5f ); |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | // -------------------------------------------------------------------------------------- |
| 55 | // Description: |
nothing calls this directly
no test coverage detected