Table of Contents

Class PatchedConicSolver

Namespace
KSP.Sim.impl
Assembly
Assembly-CSharp.dll
public class PatchedConicSolver
Inheritance
PatchedConicSolver
Inherited Members
Extension Methods

Constructors

PatchedConicSolver(OrbiterComponent, UniverseModel)

public PatchedConicSolver(OrbiterComponent orbiter, UniverseModel universeModel)

Parameters

orbiter OrbiterComponent
universeModel UniverseModel

Properties

CurrentTrajectory

A list of PatchedConicOrbits. May be given an index to obtain a particular trajectory. It’s basically a list of all the trajectories currently associated with this Orbiter object, and you can do things with it like any list. The length of the list will be no longer than MaxTotalPatches, with list members being chronologically organized from the patch that occurs first to the last patch. Unused members are null.

public List<PatchedConicsOrbit> CurrentTrajectory { get; }

Property Value

List<PatchedConicsOrbit>

MaxTotalPatches

The maximum limit on the number of patches. The default value = 10.

public int MaxTotalPatches { get; }

Property Value

int

Orbiter

The ObiterComponent object this class is associated with.

public OrbiterComponent Orbiter { get; }

Property Value

OrbiterComponent

PatchesAhead

The number of patches ahead. The game sets this in the private method PatchedConicSolver.CalculatePatchList()

public int PatchesAhead { get; set; }

Property Value

int

Methods

DecreasePatchLimit()

Decreases the current setting of the private _pathcLimit property by 1 to a value that is never less than 1.

public void DecreasePatchLimit()

FindPatchContainingUT(double)

Accepts a double (the universal time of interest) and returns the PatchedConicOrbit for the patch associated with that time.

public PatchedConicsOrbit FindPatchContainingUT(double UT)

Parameters

UT double

Returns

PatchedConicsOrbit

IncreasePatchLimit()

Increases the current setting of the private _pathcLimit property by 1 to a value that is never more than 5.

public void IncreasePatchLimit()

OnDestroy()

First tests to see if the Orbiter object is null. If it is, then it returns immediately. Otherwise, it will remove the handler for OnReferenceBodyChange which was added by the OnStart method.

public void OnDestroy()

OnStart()

First tests to see if the Orbiter object is null. If it is, then it returns immediately. Otherwise, it will remove the handler for OnReferenceBodyChange which was added by the OnStart method.

public void OnStart()

OnUpdate()

Adds a new handler for the Orbiter.OnReferenceBodyChange method so that OnReferenceBodyChange will be called when necessary. It then sets the private _patchLimit to be the max of PersistentProfileManager.ConicPatchLimit and 1, adds this.Orbiter.PatchedConicsOrbit to the CurrentTrajectory list, and similarly adds any remaining patches from 1 to MaxTotalPatches.

public void OnUpdate()

RefreshPatchLimit()

Clamps the current setting of the private _pathcLimit property to be between 1 and 5 inclusively.

public void RefreshPatchLimit()

SetPatchesInactive(List<PatchedConicsOrbit>, int)

public static void SetPatchesInactive(List<PatchedConicsOrbit> patchedConicsOrbits, int startIndex = 0)

Parameters

patchedConicsOrbits List<PatchedConicsOrbit>
startIndex int

SetTarget(CelestialBodyComponent)

Accepts a CelestialBodyComponent and uses that to set the private _targetBody. This sets the target to be used when generating the patch list.

public void SetTarget(CelestialBodyComponent targetBody)

Parameters

targetBody CelestialBodyComponent