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

Method GetSortValue

trinity/Tr2CurveLineSet.cpp:648–657  ·  view source on GitHub ↗

-------------------------------------------------------------------------------------- Description: Implements ITr2Renderable interface. Return Value: Line set's bounding sphere center distance from view position. --------------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

646// Line set's bounding sphere center distance from view position.
647// --------------------------------------------------------------------------------------
648float Tr2CurveLineSet::GetSortValue()
649{
650 // center of bounding sphere is "check point"
651 Vector3 center = TransformCoord( BoundingSphereGetCenter( m_boundingSphere ), m_worldTransform );
652
653 // distance from viewer to sort z
654 Vector3 d = Tr2Renderer::GetViewPosition() - center;
655 float distance = Length( d );
656 return distance + m_depthOffset;
657}
658
659// -------------------------------------------------------------
660// Description:

Callers

nothing calls this directly

Calls 2

GetViewPositionFunction · 0.85
LengthFunction · 0.85

Tested by

no test coverage detected