Class PatchedNBodyOrbit
- Namespace
- KSP.Sim.impl
- Assembly
- Assembly-CSharp.dll
public class PatchedNBodyOrbit : IPatchedOrbit, IDisposable, IComparable<IPatchedOrbit>, IDynamicOrbit, IOrbit
- Inheritance
-
PatchedNBodyOrbit
- Implements
-
- Inherited Members
-
- Extension Methods
-
Constructors
PatchedNBodyOrbit()
public PatchedNBodyOrbit()
Fields
AArray
public NativeArray<double> AArray
Field Value
- NativeArray<double>
BArray
public NativeArray<double> BArray
Field Value
- NativeArray<double>
BURST_ALLOCATOR_TYPE
public const Allocator BURST_ALLOCATOR_TYPE = 4
Field Value
- Allocator
CArray
public NativeArray<double> CArray
Field Value
- NativeArray<double>
EArray
public NativeArray<double> EArray
Field Value
- NativeArray<double>
EncounterBodyIndex
public NativeArray<int> EncounterBodyIndex
Field Value
- NativeArray<int>
ErrorEstimateOrder
public int ErrorEstimateOrder
Field Value
- int
KArray
public NativeArray<PatchedNBody.OdeState> KArray
Field Value
- NativeArray<OdeState>
MAX_ITERATIONS
public const int MAX_ITERATIONS = 50
Field Value
- int
OdeChildKeplerBodies
public NativeList<PatchedNBody.CelestialBodyPositionJob.KeplerBody> OdeChildKeplerBodies
Field Value
- NativeList<KeplerBody>
OdeSolveJob
public PatchedNBody.OdeSolveJob OdeSolveJob
Field Value
- PatchedNBody.OdeSolveJob
OdeSolveTerminationStatus
public NativeArray<OdeSolveStatus> OdeSolveTerminationStatus
Field Value
- NativeArray<OdeSolveStatus>
PArray
public NativeArray<double> PArray
Field Value
- NativeArray<double>
PShape
Field Value
- int2
PatchEndTransitionNative
public NativeArray<PatchTransitionType> PatchEndTransitionNative
Field Value
- NativeArray<PatchTransitionType>
QArray
public NativeList<PatchedNBody.OdeState> QArray
Field Value
- NativeList<OdeState>
TOLERANCE
public const double TOLERANCE = 0.01
Field Value
- double
Properties
ActivePatch
public bool ActivePatch { get; set; }
Property Value
- bool
Apoapsis
public double Apoapsis { get; }
Property Value
- double
ApoapsisArl
public double ApoapsisArl { get; }
Property Value
- double
ClosestApproachDistance
public double ClosestApproachDistance { get; set; }
Property Value
- double
EndUT
public double EndUT { get; set; }
Property Value
- double
NextPatch
public IPatchedOrbit NextPatch { get; set; }
Property Value
- IPatchedOrbit
OdeSolution
public NativeList<PatchedNBody.OdeSolutionComponent> OdeSolution { get; }
Property Value
- NativeList<OdeSolutionComponent>
OrbitFrame
public CelestialFrame OrbitFrame { get; }
Property Value
- CelestialFrame
OrbitMarkerHandler
public OrbitMarkerHandler OrbitMarkerHandler { get; }
Property Value
- OrbitMarkerHandler
PatchEndTransition
public PatchTransitionType PatchEndTransition { get; set; }
Property Value
- PatchTransitionType
PatchStartTransition
public PatchTransitionType PatchStartTransition { get; set; }
Property Value
- PatchTransitionType
Periapsis
public double Periapsis { get; }
Property Value
- double
PeriapsisArl
public double PeriapsisArl { get; }
Property Value
- double
Position
public Position Position { get; }
Property Value
- Position
PreviousPatch
public IPatchedOrbit PreviousPatch { get; set; }
Property Value
- IPatchedOrbit
ReferenceFrame
public ITransformFrame ReferenceFrame { get; }
Property Value
- ITransformFrame
SolverParams
public PatchedNBodyOrbit.SolverParameters SolverParams { get; }
Property Value
- PatchedNBodyOrbit.SolverParameters
SpecificAngularMomentum
public Vector3d SpecificAngularMomentum { get; }
Property Value
- Vector3d
StartUT
public double StartUT { get; set; }
Property Value
- double
TimeToAp
public double TimeToAp { get; set; }
Property Value
- double
TimeToPe
public double TimeToPe { get; set; }
Property Value
- double
UniversalTimeAtClosestApproach
public double UniversalTimeAtClosestApproach { get; set; }
Property Value
- double
UniversalTimeAtSoiEncounter
public double UniversalTimeAtSoiEncounter { get; set; }
Property Value
- double
coordinateSystem
public ICoordinateSystem coordinateSystem { get; }
Property Value
- ICoordinateSystem
localPosition
public Vector3d localPosition { get; }
Property Value
- Vector3d
referenceBody
public CelestialBodyComponent referenceBody { get; }
Property Value
- CelestialBodyComponent
relativeToMotion
public IMotion relativeToMotion { get; }
Property Value
- IMotion
relativeVelocity
public Vector relativeVelocity { get; }
Property Value
- Vector
Methods
CompareTo(IPatchedOrbit)
public int CompareTo(IPatchedOrbit other)
Parameters
other IPatchedOrbit
Returns
- int
CreateInterpolator()
public void CreateInterpolator()
Dispose()
DisposeMarkerHandler()
public void DisposeMarkerHandler()
GetOrbitalStateVectorsAtUT(double, out Vector3d, out Vector3d)
public double GetOrbitalStateVectorsAtUT(double UT, out Vector3d localPositionZup, out Vector3d relativeVelocityZup)
Parameters
UT double
localPositionZup Vector3d
relativeVelocityZup Vector3d
Returns
- double
GetOrbitalVelocityAtUTZup(double)
public Vector3d GetOrbitalVelocityAtUTZup(double UT)
Parameters
UT double
Returns
- Vector3d
GetRelativePositionAtUT(double)
public Vector3d GetRelativePositionAtUT(double UT)
Parameters
UT double
Returns
- Vector3d
GetRelativePositionAtUTZup(double)
public Vector3d GetRelativePositionAtUTZup(double UT)
Parameters
UT double
Returns
- Vector3d
GetRelativePositionFromEccAnomaly(double)
public Vector3d GetRelativePositionFromEccAnomaly(double eccentricAnomaly)
Parameters
eccentricAnomaly double
Returns
- Vector3d
GetRelativeVelocityAtUT(double)
public Vector3d GetRelativeVelocityAtUT(double UT)
Parameters
UT double
Returns
- Vector3d
GetTimeToPeriapsis()
public double GetTimeToPeriapsis()
Returns
- double
GetTruePositionAtT(double)
public Position GetTruePositionAtT(double universalTime)
Parameters
universalTime double
Returns
- Position
GetTruePositionAtT(double, ICoordinateSystem)
public Vector3d GetTruePositionAtT(double universalTime, ICoordinateSystem coordinateSystem)
Parameters
universalTime double
coordinateSystem ICoordinateSystem
Returns
- Vector3d
GetTruePositionAtUT(double)
public Position GetTruePositionAtUT(double universalTime)
Parameters
universalTime double
Returns
- Position
GetTruePositionAtUT(double, ICoordinateSystem)
public Vector3d GetTruePositionAtUT(double universalTime, ICoordinateSystem coordinateSystem)
Parameters
universalTime double
coordinateSystem ICoordinateSystem
Returns
- Vector3d
GetVel(VesselComponent)
public Vector3d GetVel(VesselComponent relativeVessel)
Parameters
relativeVessel VesselComponent
Returns
- Vector3d
InitializeMarkerHandler()
public void InitializeMarkerHandler()
InitializeOdeSolverData()
public void InitializeOdeSolverData()
OnOdeSolveComplete(PatchTransitionType)
public void OnOdeSolveComplete(PatchTransitionType patchEndTransitionType)
Parameters
patchEndTransitionType PatchTransitionType
SetReferenceBody(CelestialBodyComponent)
public void SetReferenceBody(CelestialBodyComponent body)
Parameters
body CelestialBodyComponent
SetSolverParams(double, double, double3, double3, CelestialBodyComponent)
public void SetSolverParams(double startUt, double endUt, double3 initialPosition, double3 initialVelocity, CelestialBodyComponent parentBody)
Parameters
startUt double
endUt double
initialPosition double3
initialVelocity double3
parentBody CelestialBodyComponent
SolveClosestApproach(IKeplerOrbit, ref double, double, double, double, double, int, ref int)
public double SolveClosestApproach(IKeplerOrbit secondaryKeplerOrbit, ref double UT, double dT, double minUt, double maxUt, double epsilon, int maxIterations, ref int iterationCount)
Parameters
secondaryKeplerOrbit IKeplerOrbit
UT double
dT double
minUt double
maxUt double
epsilon double
maxIterations int
iterationCount int
Returns
- double
SolveSOI_BSP(IKeplerOrbit, ref double, double, double, double, double, double, int, ref int)
public bool SolveSOI_BSP(IKeplerOrbit secondaryKeplerOrbit, ref double UT, double dT, double Rsoi, double MinUT, double MaxUT, double epsilon, int maxIterations, ref int iterationCount)
Parameters
secondaryKeplerOrbit IKeplerOrbit
UT double
dT double
Rsoi double
MinUT double
MaxUT double
epsilon double
maxIterations int
iterationCount int
Returns
- bool
UpdateFromOrbitAtUT(IOrbit, double, CelestialBodyComponent)
public void UpdateFromOrbitAtUT(IOrbit orbit, double UT, CelestialBodyComponent toBody)
Parameters
orbit IOrbit
UT double
toBody CelestialBodyComponent
UpdateFromStateVectors(ICoordinateSystem, Vector3d, IMotion, Vector3d, CelestialBodyComponent, double)
public void UpdateFromStateVectors(ICoordinateSystem coordinateSystem, Vector3d pos, IMotion relativeMotion, Vector3d vel, CelestialBodyComponent refBody, double UT)
Parameters
coordinateSystem ICoordinateSystem
pos Vector3d
relativeMotion IMotion
vel Vector3d
refBody CelestialBodyComponent
UT double
UpdateFromStateVectors(Position, Velocity, CelestialBodyComponent, double)
public void UpdateFromStateVectors(Position pos, Velocity vel, CelestialBodyComponent refBody, double UT)
Parameters
pos Position
vel Velocity
refBody CelestialBodyComponent
UT double
UpdateFromUT(double)
public void UpdateFromUT(double UT)
Parameters
UT double