C# Class SpaceSim.Spacecrafts.SpaceCraftBase

Inheritance: SpaceSim.Physics.GravitationalBodyBase, IAerodynamicBody, ISpaceCraft
Mostrar archivo Open project: zlynn1990/SpaceSim Class Usage Examples

Protected Properties

Property Type Description
EntryFlame ReEntryFlame
IspMultiplier double
MachNumber double
MissionName string
StageOffset VectorMath.DVector2
Texture System.Drawing.Bitmap

Public Methods

Method Description
AddChild ( ISpaceCraft child ) : void
ComputeBoundingBox ( ) : RectangleD
DeployFairing ( ) : void

Deploys the fairing.

DeployGridFins ( ) : void

Deploys the grid fins.

DeployLandingLegs ( ) : void

Deploys the landing legs.

FixedUpdate ( SpaceSim.Physics.TimeStep timeStep ) : void
GetAlpha ( ) : double
GetBaseCd ( double baseCd ) : double
GetDownrangeDistance ( DVector2 pointOfReference ) : double

Gets the down range distance along the equator of the parent planet.

GetRelativeAcceleration ( ) : DVector2
GetRelativeAltitude ( ) : double

Gets the relative altitude of the spacecraft from it's parent's surface.

GetRelativePitch ( ) : double
GetRelativeVelocity ( ) : DVector2

Gets the relative velocity of the spacecraft. If the space craft is within the parent's atmosphere than the rotation of the planet is taken in account. Otherwise its a simple difference of velocities.

InitializeController ( EventManager eventManager ) : void
OffsetPitch ( double offset ) : void
OffsetRelativePitch ( double offset ) : void
OffsetRoll ( double offset ) : void
OffsetYaw ( double offset ) : void
RemoveChild ( ISpaceCraft child ) : void
RenderGdi ( Graphics graphics, RectangleD cameraBounds ) : void

Renders the space craft at it's correct scale and rotation according to the camera. The engines are rendered first and then the space craft body.

ResetAccelerations ( ) : void
ResolveAtmopsherics ( IMassiveBody body ) : void
ResolveGravitation ( IPhysicsBody other ) : void
SetParent ( ISpaceCraft craft ) : void
SetPitch ( double pitch ) : void
SetRelativePitch ( double pitch ) : void
SetRoll ( double roll ) : void
SetThrottle ( double throttle, int engineIds = null ) : void
SetYaw ( double yaw ) : void
Stage ( ) : void

Stages the spacecraft according to its mounted angle by applying a normal force.

ToString ( ) : string
ToggleDisplayVectors ( ) : void
Update ( double dt ) : void

Updates the spacecraft and it's children.

UpdateAnimations ( SpaceSim.Physics.TimeStep timeStep ) : void
UpdateChildren ( DVector2 position, DVector2 velocity ) : void
UpdateController ( double dt ) : void
Visibility ( RectangleD cameraBounds ) : double

Protected Methods

Method Description
RenderAbove ( Graphics graphics, RectangleD cameraBounds ) : void
RenderBelow ( Graphics graphics, RectangleD cameraBounds ) : void
RenderShip ( Graphics graphics, RectangleD cameraBounds, RectangleF screenBounds ) : void
SpaceCraftBase ( string craftDirectory, DVector2 position, DVector2 velocity, double payloadMass, double propellantMass, string texturePath, ReEntryFlame entryFlame = null ) : System

Private Methods

Method Description
GetChildDragCoefficient ( List children, double totalDragCoefficient ) : double
GetChildFormDragArea ( List children, double totalFormDragArea ) : double
GetChildLiftArea ( List children, double totalLiftArea ) : double
GetMaxChildLiftCoefficient ( List children, double totalLiftCoefficient ) : double
TotalFormDragArea ( ) : double

Recursively finds the total drag area of all surfaces exposed to air in the spacecraft.

TotalFormDragCoefficient ( ) : double

Recursively finds the total drag of all surfaces exposed to air in the spacecraft.

TotalLiftArea ( ) : double

Recursively finds the total lift area of all surfaces exposed to air in the spacecraft.

TotalLiftCoefficient ( ) : double

Recursively finds the total lift of all surfaces exposed to air in the spacecraft.

TotalSkinFrictionArea ( ) : double

Recursively finds the total drag area of all surfaces exposed to air in the spacecraft.

TotalSkinFrictionCoefficient ( ) : double

Recursively finds the total skin friction due to all surfaces exposed to air in the spacecraft.

UpdateEngines ( double dt ) : void

Recursively updates the engines in the spacecraft and updates propellant mass.

Method Details

AddChild() public method

public AddChild ( ISpaceCraft child ) : void
child ISpaceCraft
return void

ComputeBoundingBox() public method

public ComputeBoundingBox ( ) : RectangleD
return VectorMath.RectangleD

DeployFairing() public method

Deploys the fairing.
public DeployFairing ( ) : void
return void

DeployGridFins() public method

Deploys the grid fins.
public DeployGridFins ( ) : void
return void

DeployLandingLegs() public method

Deploys the landing legs.
public DeployLandingLegs ( ) : void
return void

FixedUpdate() public method

public FixedUpdate ( SpaceSim.Physics.TimeStep timeStep ) : void
timeStep SpaceSim.Physics.TimeStep
return void

GetAlpha() public method

public GetAlpha ( ) : double
return double

GetBaseCd() public method

public GetBaseCd ( double baseCd ) : double
baseCd double
return double

GetDownrangeDistance() public method

Gets the down range distance along the equator of the parent planet.
public GetDownrangeDistance ( DVector2 pointOfReference ) : double
pointOfReference VectorMath.DVector2
return double

GetRelativeAcceleration() public method

public GetRelativeAcceleration ( ) : DVector2
return VectorMath.DVector2

GetRelativeAltitude() public method

Gets the relative altitude of the spacecraft from it's parent's surface.
public GetRelativeAltitude ( ) : double
return double

GetRelativePitch() public method

public GetRelativePitch ( ) : double
return double

GetRelativeVelocity() public method

Gets the relative velocity of the spacecraft. If the space craft is within the parent's atmosphere than the rotation of the planet is taken in account. Otherwise its a simple difference of velocities.
public GetRelativeVelocity ( ) : DVector2
return VectorMath.DVector2

InitializeController() public method

public InitializeController ( EventManager eventManager ) : void
eventManager SpaceSim.Drawing.EventManager
return void

OffsetPitch() public method

public OffsetPitch ( double offset ) : void
offset double
return void

OffsetRelativePitch() public method

public OffsetRelativePitch ( double offset ) : void
offset double
return void

OffsetRoll() public method

public OffsetRoll ( double offset ) : void
offset double
return void

OffsetYaw() public method

public OffsetYaw ( double offset ) : void
offset double
return void

RemoveChild() public method

public RemoveChild ( ISpaceCraft child ) : void
child ISpaceCraft
return void

RenderAbove() protected method

protected RenderAbove ( Graphics graphics, RectangleD cameraBounds ) : void
graphics System.Drawing.Graphics
cameraBounds VectorMath.RectangleD
return void

RenderBelow() protected method

protected RenderBelow ( Graphics graphics, RectangleD cameraBounds ) : void
graphics System.Drawing.Graphics
cameraBounds VectorMath.RectangleD
return void

RenderGdi() public method

Renders the space craft at it's correct scale and rotation according to the camera. The engines are rendered first and then the space craft body.
public RenderGdi ( Graphics graphics, RectangleD cameraBounds ) : void
graphics System.Drawing.Graphics
cameraBounds VectorMath.RectangleD
return void

RenderShip() protected method

protected RenderShip ( Graphics graphics, RectangleD cameraBounds, RectangleF screenBounds ) : void
graphics System.Drawing.Graphics
cameraBounds VectorMath.RectangleD
screenBounds System.Drawing.RectangleF
return void

ResetAccelerations() public method

public ResetAccelerations ( ) : void
return void

ResolveAtmopsherics() public method

public ResolveAtmopsherics ( IMassiveBody body ) : void
body IMassiveBody
return void

ResolveGravitation() public method

public ResolveGravitation ( IPhysicsBody other ) : void
other IPhysicsBody
return void

SetParent() public method

public SetParent ( ISpaceCraft craft ) : void
craft ISpaceCraft
return void

SetPitch() public method

public SetPitch ( double pitch ) : void
pitch double
return void

SetRelativePitch() public method

public SetRelativePitch ( double pitch ) : void
pitch double
return void

SetRoll() public method

public SetRoll ( double roll ) : void
roll double
return void

SetThrottle() public method

public SetThrottle ( double throttle, int engineIds = null ) : void
throttle double
engineIds int
return void

SetYaw() public method

public SetYaw ( double yaw ) : void
yaw double
return void

SpaceCraftBase() protected method

protected SpaceCraftBase ( string craftDirectory, DVector2 position, DVector2 velocity, double payloadMass, double propellantMass, string texturePath, ReEntryFlame entryFlame = null ) : System
craftDirectory string
position VectorMath.DVector2
velocity VectorMath.DVector2
payloadMass double
propellantMass double
texturePath string
entryFlame ReEntryFlame
return System

Stage() public method

Stages the spacecraft according to its mounted angle by applying a normal force.
public Stage ( ) : void
return void

ToString() public method

public ToString ( ) : string
return string

ToggleDisplayVectors() public method

public ToggleDisplayVectors ( ) : void
return void

Update() public method

Updates the spacecraft and it's children.
public Update ( double dt ) : void
dt double
return void

UpdateAnimations() public method

public UpdateAnimations ( SpaceSim.Physics.TimeStep timeStep ) : void
timeStep SpaceSim.Physics.TimeStep
return void

UpdateChildren() public method

public UpdateChildren ( DVector2 position, DVector2 velocity ) : void
position VectorMath.DVector2
velocity VectorMath.DVector2
return void

UpdateController() public method

public UpdateController ( double dt ) : void
dt double
return void

Visibility() public method

public Visibility ( RectangleD cameraBounds ) : double
cameraBounds VectorMath.RectangleD
return double

Property Details

EntryFlame protected_oe property

protected ReEntryFlame EntryFlame
return ReEntryFlame

IspMultiplier protected_oe property

protected double IspMultiplier
return double

MachNumber protected_oe property

protected double MachNumber
return double

MissionName protected_oe property

protected string MissionName
return string

StageOffset protected_oe property

protected DVector2,VectorMath StageOffset
return VectorMath.DVector2

Texture protected_oe property

protected Bitmap,System.Drawing Texture
return System.Drawing.Bitmap