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

Method EstimatePixelDiameter

trinity/Eve/SpaceObject/EveSpaceObject2.cpp:3350–3362  ·  view source on GitHub ↗

-------------------------------------------------------------------------------- Description: Update pixel diameter estimation --------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

3348// Update pixel diameter estimation
3349// --------------------------------------------------------------------------------
3350void EveSpaceObject2::EstimatePixelDiameter( const TriFrustum& frustum )
3351{
3352 // estimate the pixel diameter using the local bounding box,
3353 // as the bounding sphere may not pepresent the mesh bounding sphere,
3354 // but rather the bounding sphere of the object and it's EveChildMesh attachments
3355 if( m_mesh )
3356 {
3357 m_mesh->GetBoundingBox( m_localAabbMin, m_localAabbMax );
3358 }
3359 Vector4 sphere;
3360 BoundingSphereFromBox( sphere, m_localAabbMin, m_localAabbMax, &m_worldTransform );
3361 m_estimatedPixelDiameter = frustum.GetPixelSizeAccross( sphere.GetXYZ(), sphere.w );
3362}
3363
3364// --------------------------------------------------------------------------------
3365// Description:

Callers

nothing calls this directly

Calls 3

BoundingSphereFromBoxFunction · 0.85
GetPixelSizeAccrossMethod · 0.80
GetBoundingBoxMethod · 0.45

Tested by

no test coverage detected