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

Method UpdateVisibility

trinity/Eve/Renderable/EveSceneStaticParticles.cpp:107–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107void EveSceneStaticParticles::UpdateVisibility( const EveUpdateContext& updateContext )
108{
109 m_visible = false;
110
111 // nothing to do here?
112 if( Tr2Renderer::IsLowQuality() || m_clusters.empty() || !m_mesh )
113 {
114 return;
115 }
116 auto& frustum = updateContext.GetFrustum();
117 m_estimatedSize = frustum.GetPixelSizeAccross( &m_boundingSphere );
118
119 bool estimatedSizeWithinBounds = m_estimatedSize > PARTICLE_CLUSTER_MIN_SIZE * updateContext.GetLodFactor();
120 bool inBoundingSphere = LengthSq( m_center - frustum.m_viewPos ) <= m_boundingSphere.w * m_boundingSphere.w;
121
122 m_visible = inBoundingSphere || ( IsVisible( updateContext ) && estimatedSizeWithinBounds );
123}
124
125// --------------------------------------------------------------------------------
126// Description:

Callers

nothing calls this directly

Calls 5

LengthSqFunction · 0.85
emptyMethod · 0.80
GetFrustumMethod · 0.80
GetPixelSizeAccrossMethod · 0.80
GetLodFactorMethod · 0.80

Tested by

no test coverage detected