-------------------------------------------------------------------------------- Description: Get the start position of this firing effect. This is most likely only an average, because the firing effects contains multiple beams from multiple muzzles. --------------------------------------------------------------------------------
| 321 | // multiple muzzles. |
| 322 | // -------------------------------------------------------------------------------- |
| 323 | bool EveTurretFiringFX::GetStartPosition( Vector3& pos ) const |
| 324 | { |
| 325 | if( !m_isFiring ) |
| 326 | { |
| 327 | return false; |
| 328 | } |
| 329 | // sum all of them up |
| 330 | Vector3 p = Vector3( 0.f, 0.f, 0.f ); |
| 331 | uint32_t cntr = 0; |
| 332 | for( size_t i = 0; i < m_stretch.size(); ++i ) |
| 333 | { |
| 334 | if( m_perMuzzleData[i].started ) |
| 335 | { |
| 336 | p += m_perMuzzleData[i].muzzleTransform.GetTranslation(); |
| 337 | ++cntr; |
| 338 | } |
| 339 | } |
| 340 | // did we get any? |
| 341 | if( cntr == 0 ) |
| 342 | { |
| 343 | return false; |
| 344 | } |
| 345 | |
| 346 | // devide and return |
| 347 | pos = p / (float)cntr; |
| 348 | return true; |
| 349 | } |
| 350 | |
| 351 | // -------------------------------------------------------------------------------- |
| 352 | // Description: |
no test coverage detected