Class PhysicalObject
- Namespace
- NominalSystems.Universe
- Assembly
- NominalSystems.Universe.dll
[Nominal] The physical object is the root class for all objects in the simulation that have a mass, a position and a transform relative to the world. The physical object class can be attached to other physical objects, creating a chain of components for a spacecraft or other body.
public class PhysicalObject : UniverseObject
- Inheritance
-
PhysicalObject
- Derived
- Extension Methods
Constructors
PhysicalObject()
Default constructor for the physical object that initialises any variables.
protected PhysicalObject()
Fields
Out_ComponentMassMsg
The component mass message defines the set of mass properties and states of the system within this component locally. This is independent of any parent or children properties or objects.
public MassMessage? Out_ComponentMassMsg
Field Value
Properties
CenterOfMassB_B
The center of mass of the component in respect to the body frame (B) of the component. This is isolated from any children and exists in isolation.
[Unit(UnitType.METRE)]
[ReadOnly]
[Metadata(IsAdvanced = true, Category = "Mass")]
public Vector3 CenterOfMassB_B { get; }
Property Value
CenterOfMassDotB_B
The center of mass time-derivative of the component relative to the body frame (B). This does not include any of the sub-components and exists in isolation.
[Unit(UnitType.METRE_PER_SECOND)]
[ReadOnly]
[Metadata(IsAdvanced = true, Category = "Mass")]
public Vector3 CenterOfMassDotB_B { get; }
Property Value
CenterOfMassDot_LB_B
The center of mass time-derivative of the component within its own local coordinates. This does not include any of the sub-components and exists in isolation.
[Unit(UnitType.METRE_PER_SECOND)]
[ReadOnly]
[Metadata(IsAdvanced = true, ContainedIn = "Out_ComponentMassMsg", Category = "Mass")]
public Vector3 CenterOfMassDot_LB_B { get; set; }
Property Value
CenterOfMassL_L
The center of mass of the component within its own local coordinates. This does not include any of the sub-components and exists in isolation.
[Unit(UnitType.METRE)]
[Metadata(DisplayName = "Center of Mass", ContainedIn = "Out_ComponentMassMsg", Category = "Mass")]
public virtual Vector3 CenterOfMassL_L { get; set; }
Property Value
CenterOfMassPrimeB_B
[m/s] The center of mass general-derivative of the component relative to the body frame (B). This does not include any of the sub-components and exists in isolation.
[Unit(UnitType.METRE_PER_SECOND)]
[ReadOnly]
[Metadata(IsAdvanced = true, Category = "Mass")]
public virtual Vector3 CenterOfMassPrimeB_B { get; protected set; }
Property Value
CenterOfMassPrime_LB_B
The center of mass general-derivative of the component within its own local coordinates. This does not include any of the sub-components and exists in isolation.
[Unit(UnitType.METRE_PER_SECOND)]
[ReadOnly]
[Metadata(IsAdvanced = true, ContainedIn = "Out_ComponentMassMsg", Category = "Mass")]
public Vector3 CenterOfMassPrime_LB_B { get; set; }
Property Value
DCM_BN
The rotational DCM matrix between the body frame (B) at the top of this component chain and the inertial frame (N).
[Unit(UnitType.NONE)]
[ReadOnly]
[Metadata(IsAdvanced = true, Category = "Transform")]
public Matrix3 DCM_BN { get; }
Property Value
DCM_LB
The rotational DCM matrix between the component frame of this object (L) relative to the body frame (B).
[Unit(UnitType.NONE)]
[ReadOnly]
[Metadata(IsAdvanced = true, Category = "Transform")]
public Matrix3 DCM_LB { get; }
Property Value
DCM_LN
The DCM rotational matrix of the component relative to the inertial origin (N) of the world.
[Unit(UnitType.NONE)]
[ReadOnly]
[Metadata(IsAdvanced = true, Category = "Transform")]
public Matrix3 DCM_LN { get; }
Property Value
DCM_LP
The DCM matrix of the component in the parent's frame (P), taken from the Component Transform (PL).
[Unit(UnitType.NONE)]
[Metadata(IsAdvanced = true, Category = "Transform")]
public virtual Matrix3 DCM_LP { get; set; }
Property Value
IsDirty
A flag that defines if the mass or transforms are currently dirty and are in need of updating for the dynamic system to update its state. If the flag is dirty, the total mass of the values will be updated.
[Hidden]
public bool IsDirty { get; protected set; }
Property Value
Mass
The component mass defined in the object. This is independent of any parent or children objects and exists in isolation.
[Unit(UnitType.KILOGRAM)]
[Range(0, 1.7976931348623157E+308)]
[Metadata(ContainedIn = "Out_ComponentMassMsg", Category = "Mass")]
public virtual double Mass { get; set; }
Property Value
MassAvailable
A flag that determines if the mass is available for adding and for using components. This will be set to false for array components that store all the mass.
[Hidden]
public bool MassAvailable { get; protected set; }
Property Value
MassDot
The component mass time-derivative defined in the object. This is independent of any parent or children objects and exists in isolation.
[Unit(UnitType.KILOGRAM_PER_SECOND)]
[Metadata(IsAdvanced = true, ContainedIn = "Out_ComponentMassMsg", Category = "Mass")]
public double MassDot { get; set; }
Property Value
MomentOfInertiaB_B
The moment of inertia of this component, measured in the body frame relative to the parented body. This is independent of any children and exists in isolation.
[Unit(UnitType.KILOGRAM_SQUARE_METRE)]
[ReadOnly]
[Metadata(IsAdvanced = true, Category = "Mass")]
public virtual Matrix3 MomentOfInertiaB_B { get; }
Property Value
MomentOfInertiaPrimeB_B
The derivative of the moment of inertia of the component, represented in the body frame (B). This is independent and exists in isolation.
[Unit(UnitType.KILOGRAM_SQUARE_METRE_PER_SECOND)]
[ReadOnly]
[Metadata(IsAdvanced = true, Category = "Mass")]
public virtual Matrix3 MomentOfInertiaPrimeB_B { get; protected set; }
Property Value
MomentOfInertiaPrime_LB
The derivative of the moment of inertia of the component, measured at the local center of mass, represented with its own local coordinates. This does not include any of the sub-components and exists in isolation.
[Unit(UnitType.KILOGRAM_SQUARE_METRE)]
[ReadOnly]
[Metadata(IsAdvanced = true, ContainedIn = "Out_ComponentMassMsg", Category = "Mass")]
public Matrix3 MomentOfInertiaPrime_LB { get; set; }
Property Value
MomentOfInertia_LB
The moment of inertia of the component, measured at the local center of mass, represented with its own local coordinates. This does not include any of the sub-components and exists in isolation.
[Unit(UnitType.KILOGRAM_SQUARE_METRE)]
[Metadata(DisplayName = "Moment of Inertia", ContainedIn = "Out_ComponentMassMsg", Category = "Mass")]
public virtual Matrix3 MomentOfInertia_LB { get; set; }
Property Value
Position_BN_N
The position of the body (the root parent B) in the inertial frame relative to the inertial point (N).
[Unit(UnitType.METRE)]
[ReadOnly]
[Metadata(IsAdvanced = true, Category = "Transform")]
public Vector3 Position_BN_N { get; }
Property Value
Position_LB_B
The position of the component relative to the root object of this hierarchy. This is in the inertial frame and if the component is the root object, then there will be no position.
[Unit(UnitType.METRE)]
[ReadOnly]
[Metadata(IsAdvanced = true, Category = "Transform")]
public Vector3 Position_LB_B { get; }
Property Value
Position_LN_N
The position of the inertial world space. This position is derived from the world's transform (N).
[Unit(UnitType.METRE)]
[ReadOnly]
[Metadata(IsAdvanced = true, Category = "Transform")]
public Vector3 Position_LN_N { get; }
Property Value
Position_LP_P
The position of the object relative to the parented object (P). If there is no parent object, then this will be in the inertial frame.
[Unit(UnitType.METRE)]
[Metadata(IsAdvanced = true, Category = "Transform")]
public virtual Vector3 Position_LP_P { get; set; }
Property Value
Transform_BL
The transform of the object relative to the body frame. If null, then this is the top-most object. This is the transform to L (component) from B (body frame). This is the same as the Transform_PL IF the parent of this component is the top-level parent.
[Hidden]
public Transform Transform_BL { get; }
Property Value
Transform_NL
The transform of the object (L) relative to the world inertial point. This will be determined via the parent's world transform and working up the chain.
[Hidden]
public Transform Transform_NL { get; }
Property Value
Transform_PL
The transform of the object relative to the parent object. If the parent does not exist, this is the inertial transform in the world. This is the Transform to L (component) from P (parent) frame.
[Hidden]
public Transform Transform_PL { get; }
Property Value
Methods
OnBegin(double)
Called when the object is beginning ticking for the first time. This is when the simulation calls the very first tick and will run before the update call.
protected override void OnBegin(double time)
Parameters
time
double[s] Current time of the simulation before the tick
OnChildAttached(UniverseObject)
This event is called when a child has been attached to this object. This will pass in the reference to the child object that was added.
protected override void OnChildAttached(UniverseObject child)
Parameters
child
UniverseObjectThe child object that was added
OnChildDetached(UniverseObject)
This event is called when a child has been detached from this object. This will pass in the child object that was removed.
protected override void OnChildDetached(UniverseObject child)
Parameters
child
UniverseObjectThe child object that was detached
OnCreate()
Called when the 'Component' is created from the controller.
protected override void OnCreate()
OnHierarchyChanged()
An event that is executed when some object within the chain of components in the hierarchy is added or removed from the system. This can be used to recalculate physics or create a new list of objects.
protected virtual void OnHierarchyChanged()
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
OnSave()
Called before the object is saved into the save state. This ensures that any additional metadata can be saved on the object before it is automatically serialized.
protected override void OnSave()
PitchDegrees(double)
Pitches the local transform by some rotation along the X axis.
public override void PitchDegrees(double degrees)
Parameters
degrees
double[deg] The angle to pitch by
ReadBodyTransform()
This method will reset the dirty flag on the mass so that it has been read successfully and is valid.
public bool ReadBodyTransform()
Returns
- bool
The original state of the dirty flag
RollDegrees(double)
Rolls the local transform by some rotation along the Y axis.
public override void RollDegrees(double degrees)
Parameters
degrees
double[deg] The angle to roll by
UpdateMassProperties(double, double)
Updates the mass properties of the current physical object at a particular time.
public virtual void UpdateMassProperties(double time, double step)
Parameters
time
double[s] The current time of the simulation
step
double[s] The delta time between the updates
YawDegrees(double)
Yaws the local transform by some rotation along the Z axis.
public override void YawDegrees(double degrees)
Parameters
degrees
double[deg] The angle to yaw by