Class GravityEffector
- Namespace
- NominalSystems.Universe
- Assembly
- NominalSystems.Universe.dll
A Gravity Effector class is able to calculate the Gravity at some location in respect to all of the bodies in the Universe that are spawned.
public sealed class GravityEffector : Component
- Inheritance
-
GravityEffector
- Inherited Members
Constructors
GravityEffector()
Constructor that sets up the Gravity Bodies and initialises the fields.
public GravityEffector()
Fields
GravityField
The local gravitational attraction
[EditableVariable("m/s^2", true, "", "")]
public Vector3 GravityField
Field Value
InertialPosition
[m] r_N inertial position relative to system SPICE zeroBase coordinate frame
[EditableVariable("m", true, "", "")]
public Vector3 InertialPosition
Field Value
InertialVelocity
[m/s] r_N inertial velocity relative to system SPICE zeroBase coordinate frame
[EditableVariable("m/s", true, "", "")]
public Vector3 InertialVelocity
Field Value
Methods
ComputeGravityField(Vector3, Vector3, double)
Computes the Gravitational Field at some location
public void ComputeGravityField(Vector3 r_cF_N, Vector3 rDot_cF_N, double step)
Parameters
r_cF_N
Vector3The position of the CoM of the object with reference to the frame it is stored in
rDot_cF_N
Vector3The derivative fo the Position
step
doubleThe step time interval [s]
GetEulerSteppedGravityBodyPosition(GravityBody, double)
Calculates the next frame gravity body position after a certain step time.
public Vector3 GetEulerSteppedGravityBodyPosition(GravityBody body, double step)
Parameters
body
GravityBodyA reference to the gravity body
step
doubleThe time step [seconds]
Returns
- Vector3
The next position of the bodies
OnReset(double)
Called when the 'Component' is reset from a simulation
protected override void OnReset(double time)
Parameters
time
doublereset time (seconds)
RegisterStates(StateProperties)
Sets up the gravity parameters in the states and links them up to the variables
public void RegisterStates(StateProperties properties)
Parameters
properties
StatePropertiesA reference to the dynamic body parameters
UpdateEnergyContributions(Vector3, ref double, double)
Updates the Orbital Potential Energy Calculations
public void UpdateEnergyContributions(Vector3 r_cF_N, ref double orbPotEnergyContr, double step)
Parameters
r_cF_N
Vector3The current position [m]
orbPotEnergyContr
doubleA reference to the current potential energy contributions [J]
step
doubleThe time step [s]
UpdateInertialState(Vector3, Vector3)
Updates the Inertial State of the effector to some new position and velocity.
public void UpdateInertialState(Vector3 position_N, Vector3 velocity_N)