MCPcopy Create free account
hub / github.com/carbonengine/trinity / UpdateVisibility

Method UpdateVisibility

trinity/Eve/EveEffectRoot2.cpp:260–297  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

258}
259
260void 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
299void EveEffectRoot2::GetRenderables( std::vector<ITr2Renderable*>& renderables, Tr2ImpostorManager* impostors )
300{

Callers

nothing calls this directly

Calls 9

GetBoundingSphereFunction · 0.85
BoundingSphereTransformFunction · 0.85
IsSphereVisibleMethod · 0.80
GetFrustumMethod · 0.80
GetPixelSizeAccrossMethod · 0.80
GetLowDetailThresholdMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected