Gravity Engine 12.0
Unity Asset for Gravity
Loading...
Searching...
No Matches
EarthAtmosphere Class Reference

Computes the acceleration due to drag in the Earth's atmosphere for a given height and velocity. More...

Inheritance diagram for EarthAtmosphere:
GEExternalAcceleration

Public Member Functions

void InitFrom (EarthAtmosphere atm, NBody nbody)
 
double GetAccelSI ()
 Get the last "in flight" value for atmosphere deceleration.
 
double[] acceleration (double time, GravityState gravityState, ref double massKg)
 Determine the acceleration due to atmospheric resistance.
 
double[] acceleration (double time, GravityState gravityState, ref double massKg)
 Determine the acceleration at the specified time for the provided gravity state.
 

Public Attributes

double heightEarthSurface = 6371
 
double inertialMassKg = 100
 
double crossSectionalArea
 
double coeefDrag = 2.1
 

Detailed Description

Computes the acceleration due to drag in the Earth's atmosphere for a given height and velocity.

This component is attached to the spaceship and called via the GEExternalAcceleration interface from within the physics integrator as a callback. It will potentially get called a LOT so efforts are made to make the acceleration computation effecient where possible.

Member Function Documentation

◆ acceleration()

double[] EarthAtmosphere.acceleration ( double  time,
GravityState  gravityState,
ref double  massKg 
)

Determine the acceleration due to atmospheric resistance.

Parameters
time(not used)
gravityState
massKgUpdated mass (0 to use the inertial mass from inspector)
Returns

Implements GEExternalAcceleration.

◆ GetAccelSI()

double EarthAtmosphere.GetAccelSI ( )

Get the last "in flight" value for atmosphere deceleration.

Returns
Magnitude of the acceleration in m/s^2

The documentation for this class was generated from the following file: