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

Method GetSortValue

trinity/Tr2PrimitiveSet.cpp:67–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67float Tr2PrimitiveSet::GetSortValue()
68{ /*
69 Primitives are sorted by the distance to the bounding sphere
70 */
71 Vector4 bound = GetBoundingSphere();
72 Vector3 d = Tr2Renderer::GetViewPosition() - Vector3( bound.x, bound.y, bound.z );
73 float distance = Length( d ) - bound.w;
74 return distance;
75}
76
77Vector4 Tr2PrimitiveSet::GetBoundingSphere( void )
78{ /*

Callers

nothing calls this directly

Calls 4

GetBoundingSphereFunction · 0.85
GetViewPositionFunction · 0.85
LengthFunction · 0.85
Vector3Class · 0.70

Tested by

no test coverage detected