Same construction as frontier.hud.system_view.scene_new.util._get_orbit_rotation_from_axes: basis_u = normalize(n x ref), basis_v = normalize(basis_u x n). Rotation degrees are atan2(maj·v, maj·u) in that frame.
| 25 | // Same construction as frontier.hud.system_view.scene_new.util._get_orbit_rotation_from_axes: |
| 26 | // basis_u = normalize(n x ref), basis_v = normalize(basis_u x n). Rotation degrees are atan2(maj·v, maj·u) in that frame. |
| 27 | void BuildOrbitPlaneBasisPython( const Vector3& planeNormal, Vector3& basisU, Vector3& basisV, Vector3& n ) |
| 28 | { |
| 29 | n = Normalize( planeNormal ); |
| 30 | Vector3 ref( 0.f, 1.f, 0.f ); |
| 31 | basisU = Cross( n, ref ); |
| 32 | float lenSq = Dot( basisU, basisU ); |
| 33 | if( lenSq < 1e-3f ) |
| 34 | { |
| 35 | const Vector3 ax0( 1.f, 0.f, 0.f ); |
| 36 | const Vector3 ax1( 0.f, 0.f, 1.f ); |
| 37 | const float d0 = std::fabs( Dot( n, ax0 ) ); |
| 38 | const float d1 = std::fabs( Dot( n, ax1 ) ); |
| 39 | ref = ( d0 < d1 ) ? ax0 : ax1; |
| 40 | basisU = Cross( n, ref ); |
| 41 | lenSq = Dot( basisU, basisU ); |
| 42 | } |
| 43 | CCP_ASSERT( lenSq > 0.f ); |
| 44 | basisU = basisU / std::sqrt( lenSq ); |
| 45 | basisV = Cross( basisU, n ); |
| 46 | const float lv = Length( basisV ); |
| 47 | basisV = basisV / lv; |
| 48 | } |
| 49 | |
| 50 | // Major along U, minor along V; rotationDegrees matches Python atan2(maj·basis_v, maj·basis_u). |
| 51 | void BuildOrbitEllipseAxes( const EveEllipseDefinition& spec, Vector3& outU, Vector3& outV ) |
no test coverage detected