| 258 | } |
| 259 | |
| 260 | void EveEffectRoot2::UpdateVisibility( const EveUpdateContext& updateContext, const Matrix& parentTransform ) |
| 261 | { |
| 262 | if( !m_display ) |
| 263 | { |
| 264 | return; |
| 265 | } |
| 266 | |
| 267 | if( m_dynamicLODSelection ) |
| 268 | { |
| 269 | Vector4 boundingSphere; |
| 270 | GetBoundingSphere( boundingSphere ); |
| 271 | BoundingSphereTransform( m_worldTransform, boundingSphere ); |
| 272 | |
| 273 | if( updateContext.GetFrustum().IsSphereVisible( &boundingSphere ) ) |
| 274 | { |
| 275 | m_estimatedSize = updateContext.GetFrustum().GetPixelSizeAccross( &boundingSphere ); |
| 276 | } |
| 277 | |
| 278 | Tr2Lod oldLod = m_lodLevel; |
| 279 | m_lodLevel = TR2_LOD_LOW; |
| 280 | |
| 281 | if( m_estimatedSize >= updateContext.GetMediumDetailThreshold() ) |
| 282 | { |
| 283 | m_lodLevel = TR2_LOD_HIGH; |
| 284 | } |
| 285 | else if( m_estimatedSize >= updateContext.GetLowDetailThreshold() ) |
| 286 | { |
| 287 | m_lodLevel = TR2_LOD_MEDIUM; |
| 288 | } |
| 289 | |
| 290 | m_changeLOD |= oldLod != m_lodLevel; |
| 291 | } |
| 292 | |
| 293 | for( auto ecIt = m_effectChildren.begin(); ecIt != m_effectChildren.end(); ++ecIt ) |
| 294 | { |
| 295 | ( *ecIt )->UpdateVisibility( updateContext, parentTransform, m_lodLevel ); |
| 296 | } |
| 297 | } |
| 298 | |
| 299 | void EveEffectRoot2::GetRenderables( std::vector<ITr2Renderable*>& renderables, Tr2ImpostorManager* impostors ) |
| 300 | { |
nothing calls this directly
no test coverage detected