Class PhysicalObject
- Namespace
- NominalSystems.Universe
- Assembly
- NominalSystems.Universe.dll
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 : Component
- Inheritance
-
PhysicalObject
- Derived
- Inherited Members
Constructors
PhysicalObject()
Default constructor for the physical object that initialises any variables.
public PhysicalObject()
Fields
In_BodyStatesMsg
A reference to the parent's body states message
public BodyStatesMessage In_BodyStatesMsg
Field Value
Out_BodyStatesMsg
Output body states of a physical component. By default, this is set equal to the In_BodyStatesMsg.
public BodyStatesMessage Out_BodyStatesMsg
Field Value
Out_ComponentMassPropsMsg
[-] The component mass props 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 readonly MassPropsMessage Out_ComponentMassPropsMsg
Field Value
Properties
CenterOfMassB_B
[m] 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.
public Vector3 CenterOfMassB_B { get; }
Property Value
CenterOfMassDotB_B
[m/s] 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.
public Vector3 CenterOfMassDotB_B { get; }
Property Value
CenterOfMassDotL_L
[m/s] 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.
[EditableVariable("m/s", true, "Mass", "Center of Mass Dot")]
public Vector3 CenterOfMassDotL_L { get; set; }
Property Value
CenterOfMassL_L
[m] 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.
[EditableVariable("m", false, "Mass", "Center of 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.
public virtual Vector3 CenterOfMassPrimeB_B { get; protected set; }
Property Value
CenterOfMassPrimeL_L
[m/s] 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.
[EditableVariable("m/s", true, "Mass", "Center of Mass Prime")]
public Vector3 CenterOfMassPrimeL_L { 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).
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).
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.
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).
[EditableVariable("-", false, "Transform", "Rotation Matrix")]
public 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.
public bool IsDirty { get; protected set; }
Property Value
LocalForward
[-] The direction of the local transform frame's forward vector, which is along the Y axis.
public Vector3 LocalForward { get; }
Property Value
LocalRight
[-] The direction of the local transform frame's right vector, which is along the X axis.
public Vector3 LocalRight { get; }
Property Value
LocalUp
[-] The direction of the local transform frame's up vector, which is along the Z axis. Only this value can be set as it is defined as the 'front' vector of the transform of the object.
public Vector3 LocalUp { get; set; }
Property Value
Mass
[kg] The component mass defined in the object. This is independent of any parent or children objects and exists in isolation.
[EditableVariable("kg", 0, false, "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.
public bool MassAvailable { get; protected set; }
Property Value
MassDot
[kg/s] The component mass time-derivative defined in the object. This is independent of any parent or children objects and exists in isolation.
[EditableVariable("kg/s", true, "Mass", "Mass Dot")]
public double MassDot { get; set; }
Property Value
MomentOfInertiaB_B
[kg m^2] 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.
public virtual Matrix3 MomentOfInertiaB_B { get; }
Property Value
MomentOfInertiaL_L
[kg m^2] 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.
[EditableVariable("kg m^2", false, "Mass", "Moment of Inertia")]
public virtual Matrix3 MomentOfInertiaL_L { get; set; }
Property Value
MomentOfInertiaPrimeB_B
[kg m^2/s] The derivative of the moment of inertia of the component, represented in the body frame (B). This is independent and exists in isolation.
public virtual Matrix3 MomentOfInertiaPrimeB_B { get; protected set; }
Property Value
MomentOfInertiaPrimeL_L
[kg m^2/s] 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.
[EditableVariable("kg m^2/s", true, "Mass", "Moment of Inertia Prime")]
public Matrix3 MomentOfInertiaPrimeL_L { get; set; }
Property Value
Parent
[-] A reference to the parented object, assuming that it is of the correct physical object type.
public PhysicalObject Parent { get; }
Property Value
Position_BN_N
[m] The position of the body (the root parent B) in the inertial frame relative to the inertial point (N).
public Vector3 Position_BN_N { get; }
Property Value
Position_LB_B
[m] The position of the component relative to the root object of this heriarchy. This is in the inertial frame and if the component is the root object, then there will be no position.
public Vector3 Position_LB_B { get; }
Property Value
Position_LN_N
[m] The position of the inertial world space. This position is derived from the world's transform (N).
public Vector3 Position_LN_N { get; }
Property Value
Position_LP_P
[m] 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.
[EditableVariable("m", false, "Transform", "Position")]
public Vector3 Position_LP_P { get; set; }
Property Value
Root
[-] A reference to the highest object in the root heirarchy that is at the top-most level of the stack.
public PhysicalObject Root { get; }
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.
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.
public Transform Transform_NL { get; }
Property Value
Methods
Cast<T>()
Attempts to cast this object to another object. This will perform a safe check to see if the object can be casted by checking the class of parameter.
public T Cast<T>() where T : PhysicalObject
Returns
- T
The casted object, if it exists. If invalid, a null will return
Type Parameters
T
The type of physical object that will be casted
IsChildTypeSupported(Type)
Returns true if 'Component' type is a supported child
protected override bool IsChildTypeSupported(Type type)
Parameters
type
Typea 'Component' type
Returns
IsClassOf(Type)
Returns whether this object is of a particular type of object or a subclass of that type of object.
public bool IsClassOf(Type type)
Parameters
type
TypeThe type to check
Returns
- bool
A flag whether this class is the correct type
OnBegin(double)
Called when the 'Component' is beginning
protected override void OnBegin(double time)
Parameters
time
doublecurrent time (seconds)
OnEncodeMetadata(JObject)
Called while the "Component" is being saved to save additional metadata.
protected override JObject OnEncodeMetadata(JObject metadata)
Parameters
metadata
JObject
Returns
- JObject
OnHeirarchyChange()
An event that is executed when some object within the chain of components in the heirarchy is added or removed from the system. This can be used to recalculate physics or create a new list of objects.
protected virtual void OnHeirarchyChange()
OnPostAttachChild(Component)
Called after the 'Component' has attached a component
protected override void OnPostAttachChild(Component child)
Parameters
child
ComponentThe child component
OnPreDetachChild(Component)
Called before the 'Component' detaches a component
protected override void OnPreDetachChild(Component child)
Parameters
child
ComponentThe child component
PitchDegrees(double)
Pitches the transform from the Parent to the Local frame by some rotation along the X axis.
public void PitchDegrees(double degrees)
Parameters
degrees
double[deg] The angle to rotate 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 transform from the Parent to the Local frame by some rotation along the Y axis.
public void RollDegrees(double degrees)
Parameters
degrees
double[deg] The angle to rotate 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 transform from the Parent to the Local frame by some rotation along the Z axis.
public void YawDegrees(double degrees)
Parameters
degrees
double[deg] The angle to rotate by