Table of Contents

Class GravityModel

Namespace
NominalSystems.Universe
Assembly
NominalSystems.Universe.dll

[Nominal] 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 class GravityModel : UniverseModel<UniverseObject>
Inheritance
GravityModel
Extension Methods

Constructors

GravityModel()

Default constructor

protected GravityModel()

Fields

Out_GravityMsg

The gravitational message that describes the gravitational energy and acceleration of the object.

public GravityMessage? Out_GravityMsg

Field Value

GravityMessage

Properties

Acceleration

The local gravitational attraction

[Unit(UnitType.METRE_PER_SECOND_SQUARED)]
[ReadOnly]
public Vector3 Acceleration { get; }

Property Value

Vector3

PotentialEnergy

The gravitational potential energy of the object

[Unit(UnitType.JOULE)]
[ReadOnly]
public double PotentialEnergy { get; }

Property Value

double

Methods

OnCreate()

Called when the object is created from the controller and has been attached to the parent object. By this point, it has been registered to the simulation and will run after the constructor.

protected override void OnCreate()

OnLoad(double)

Called after all of the data has been loaded from a save state on this object. This enables any post-load operations to be performed and extra data to be loaded from the metadata.

protected override void OnLoad(double time)

Parameters

time double

[s] The current clock time of the simulation

OnUpdate(double, double)

Called when the object should update from the simulation tick. This will take in a time and a step, where the time is the time of the clock before updating the object.

protected override void OnUpdate(double time, double step)

Parameters

time double

[s] Current time of the simulation before the update

step double

[s] The time-step to update during this tick