-------------------------------------------------------------------------------------- Description: Implements ITr2AttributeGenerator interface. Generates random 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 of floa
| 36 | // The generator fills element identified by generator's m_name with random values. |
| 37 | // -------------------------------------------------------------------------------------- |
| 38 | void Tr2RandomUniformAttributeGenerator::Generate( const Vector3* position, |
| 39 | const Vector3* velocity, |
| 40 | float** particle ) |
| 41 | { |
| 42 | if( !m_valid ) |
| 43 | { |
| 44 | return; |
| 45 | } |
| 46 | float* data = particle[m_element.m_bufferType] + m_element.m_offset; |
| 47 | for( unsigned i = 0; i < m_element.m_dimension; ++i ) |
| 48 | { |
| 49 | data[i] = m_minRange[i] + ( m_maxRange[i] - m_minRange[i] ) * Tr2ParticleSystem::RandFloat(); |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | // -------------------------------------------------------------------------------------- |
| 54 | // Description: |
nothing calls this directly
no test coverage detected