Table of Contents

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

Vector3

InertialPosition

[m] r_N inertial position relative to system SPICE zeroBase coordinate frame

[EditableVariable("m", true, "", "")]
public Vector3 InertialPosition

Field Value

Vector3

InertialVelocity

[m/s] r_N inertial velocity relative to system SPICE zeroBase coordinate frame

[EditableVariable("m/s", true, "", "")]
public Vector3 InertialVelocity

Field Value

Vector3

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 Vector3

The position of the CoM of the object with reference to the frame it is stored in

rDot_cF_N Vector3

The derivative fo the Position

step double

The 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 GravityBody

A reference to the gravity body

step double

The 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 double

reset 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 StateProperties

A 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 Vector3

The current position [m]

orbPotEnergyContr double

A reference to the current potential energy contributions [J]

step double

The 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)

Parameters

position_N Vector3

Position of the Body [m]

velocity_N Vector3

Velocity of the Body [m/s]