-------------------------------------------------------------------------------- Description: First calculate the LOD based on the provided sphere and frustum, then "merge" it with lod0 --------------------------------------------------------------------------------
| 10 | // it with lod0 |
| 11 | // -------------------------------------------------------------------------------- |
| 12 | Tr2Lod EveLODHelper::MergeLOD( Tr2Lod lod0, const Vector4& sphere, const EveUpdateContext& updateContext ) |
| 13 | { |
| 14 | auto& frustum = updateContext.GetFrustum(); |
| 15 | |
| 16 | // only change something if this thing is actually visible |
| 17 | if( frustum.IsSphereVisible( &sphere ) ) |
| 18 | { |
| 19 | Tr2Lod lod1 = TR2_LOD_LOW; |
| 20 | |
| 21 | float estimatedSize = frustum.GetPixelSizeAccross( &sphere ); |
| 22 | if( estimatedSize >= updateContext.GetMediumDetailThreshold() ) |
| 23 | { |
| 24 | lod1 = TR2_LOD_HIGH; |
| 25 | } |
| 26 | else if( estimatedSize >= updateContext.GetLowDetailThreshold() ) |
| 27 | { |
| 28 | lod1 = TR2_LOD_MEDIUM; |
| 29 | } |
| 30 | |
| 31 | // ok, merge it! |
| 32 | return MergeLOD( lod0, lod1 ); |
| 33 | } |
| 34 | return TR2_LOD_UNSPECIFIED; |
| 35 | } |
nothing calls this directly
no test coverage detected