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

Function BuildOrbitEllipseAxes

trinity/Eve/UI/EveEllipseSet.cpp:51–63  ·  view source on GitHub ↗

Major along U, minor along V; rotationDegrees matches Python atan2(maj·basis_v, maj·basis_u).

Source from the content-addressed store, hash-verified

49
50// Major along U, minor along V; rotationDegrees matches Python atan2(maj·basis_v, maj·basis_u).
51void BuildOrbitEllipseAxes( const EveEllipseDefinition& spec, Vector3& outU, Vector3& outV )
52{
53 Vector3 basisU, basisV, n;
54 BuildOrbitPlaneBasisPython( spec.m_planeNormal, basisU, basisV, n );
55 const float phiRad = spec.m_rotationDegrees * ( TRI_PI / 180.f );
56 const float cf = cosf( phiRad );
57 const float sf = sinf( phiRad );
58 // unit since basisU and basisV are unit
59 outU = basisU * cf + basisV * sf;
60 outV = Cross( outU, n );
61 const float lv = Length( outV );
62 outV = outV / lv;
63}
64
65} // namespace
66

Callers 1

RebuildGeometryMethod · 0.85

Calls 3

CrossFunction · 0.85
LengthFunction · 0.85

Tested by

no test coverage detected