| 355 | } |
| 356 | |
| 357 | int TriGeometryRes::GetLodIndexForScreenSize( unsigned int meshIx, float screenSize ) const |
| 358 | { |
| 359 | auto mesh = GetMeshData( meshIx ); |
| 360 | |
| 361 | if( !mesh ) |
| 362 | { |
| 363 | return -1; |
| 364 | } |
| 365 | |
| 366 | int32_t lastLod = static_cast<int32_t>( mesh->m_lods.size() ) - 1; |
| 367 | if( m_forceLod && m_forcedLodIndex >= 0 ) |
| 368 | { |
| 369 | return int( std::min( m_forcedLodIndex, lastLod ) ); |
| 370 | } |
| 371 | |
| 372 | for( int32_t i = lastLod; i >= 0; i-- ) |
| 373 | { |
| 374 | if( mesh->m_lods[i]->m_maxScreenSize >= screenSize ) |
| 375 | { |
| 376 | return i; |
| 377 | } |
| 378 | } |
| 379 | //If we end up here, it's because we requested a LOD size larger than the best one we have. |
| 380 | //Just return the highest quality LOD in this case. |
| 381 | return 0; |
| 382 | } |
| 383 | |
| 384 | const AudioGeometryResData* TriGeometryRes::GetAudioGeometry( unsigned int meshIx ) const |
| 385 | { |
no test coverage detected