Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Static Public Member Functions | Public Attributes | Properties | List of all members
VehiclePhysics.Gravity Class Reference

Static utility class for handling gravity in Vehicle Physics Pro More...

Static Public Member Functions

static void Refresh ()
 Call Gravity.Refresh() after modifying Physics.gravity by scripting. More...
 

Public Attributes

const float forceToMass = 1.0f / reference
 Factor for converting a force value into earth-equivalent mass. This is used for calculating an equivalent mass out of a force regardless of the actual gravity value and direction. More...
 
const float massToForce = reference
 Factor for converting a mass into earth-equivalent force. Used for calculating the force that mass would cause in earth gravity. More...
 
const float reference = 9.807f
 Reference gravity value. This is used for calculating accelerations in earth-equivalent G factors. More...
 

Properties

static float magnitude [get]
 Absolute magnitude of the gravity acceleration (m/s2). More...
 
static Vector3 up [get]
 Normalized vector pointing "up" in current gravity value. More...
 
static Vector3 value [get, set]
 Actual physics gravity value. Some handy values are also cached when modifying this (magnitude, up). More...
 

Detailed Description

Static utility class for handling gravity in Vehicle Physics Pro

Member Function Documentation

static void VehiclePhysics.Gravity.Refresh ( )
inlinestatic

Call Gravity.Refresh() after modifying Physics.gravity by scripting.

Member Data Documentation

const float VehiclePhysics.Gravity.forceToMass = 1.0f / reference

Factor for converting a force value into earth-equivalent mass. This is used for calculating an equivalent mass out of a force regardless of the actual gravity value and direction.

const float VehiclePhysics.Gravity.massToForce = reference

Factor for converting a mass into earth-equivalent force. Used for calculating the force that mass would cause in earth gravity.

const float VehiclePhysics.Gravity.reference = 9.807f

Reference gravity value. This is used for calculating accelerations in earth-equivalent G factors.

Property Documentation

float VehiclePhysics.Gravity.magnitude
staticget

Absolute magnitude of the gravity acceleration (m/s2).

Vector3 VehiclePhysics.Gravity.up
staticget

Normalized vector pointing "up" in current gravity value.

Vector3 VehiclePhysics.Gravity.value
staticgetset

Actual physics gravity value. Some handy values are also cached when modifying this (magnitude, up).


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