Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Properties | List of all members
FloatingOrigin Class Reference
Inheritance diagram for FloatingOrigin:

Public Member Functions

void ResetOffset ()
 Sets offset so the launchpad spawn point is at the origin More...
 

Static Public Member Functions

static bool RegisterParticleSystem (ParticleSystem sys)
 Regsiter a worldspace particlesystem with FO. Returns false if no instance of FO, or if FO already has the system. More...
 
static void ResetTerrainShaderOffset ()
 Resets shader offset to avoid the offset getting too large. More...
 
static void SetOffset (Vector3d refPos)
 Shifts the origin so that it center at the given position More...
 
static void SetOutOfFrameOffset (Vector3d add)
 Sets the additional offset for those objects not in the moving Krakensbane frame. Called by Krakensbane. More...
 
static void SetSafeToEngage (bool val)
 Sets whether it's safe to engage. Called by Krakensbane. More...
 
static bool UnregisterParticleSystem (ParticleSystem sys)
 Unregister a worldspace particlesystem with FO. Returns false if no instance of FO, or if the sys is not registered. More...
 

Public Attributes

double altToStopMovingExplosions = 10000d
 
bool canEngageThisFrame = true
 
double CoMRecalcOffsetMaxSqr = (10000d * 10000d)
 
bool continuous
 
Transform forcedCenterTransform
 
Vector3d offset
 
Vector3d outOfFrameAdditional = Vector3d.zero
 
List< ParticleSystem > particleSystems = new List<ParticleSystem>()
 
int pCount
 
Vector3d reverseoffset
 
float threshold = 500f
 
float thresholdSqr
 
double velForContinuous = 5000d
 
double velForContinuousSqr
 

Static Public Attributes

static FloatingOrigin fetch
 
static int particlesLength = 1024
 

Protected Member Functions

void Awake ()
 
void FixedUpdate ()
 Here we check if we can engage, and if so, apply the offset and out-of-frame offset Since Krakensbane engages so quickly now, and therefore FO has to run each frame to apply the out-of-KB-frame velocity, the 'continuous' check is often superfluous. We rely on Krakensbane telling us (since it runs right before us) whether it's safe to engage. That's the 'canEngageThisFrame' check. If Krakensbane is not running to set that, we assume it is safe and therefore reset to true at the end of the method. We also need to disable collision enhancer on large offsets, just in case. More...
 
void OnDestroy ()
 
void setOffset (Vector3d refPos, Vector3d nonFrame)
 Shifts the origin so that it center at the given position More...
 

Properties

static Vector3d Offset [get]
 
static Vector3d OffsetNonKrakensbane [get]
 
static Vector3d ReverseOffset [get]
 
static Vector3d TerrainShaderOffset [get, set]
 Terrain shader offset used by the terrain shader to match up with the floating origin. More...
 

Member Function Documentation

void FloatingOrigin.Awake ( )
inlineprotected
void FloatingOrigin.FixedUpdate ( )
inlineprotected

Here we check if we can engage, and if so, apply the offset and out-of-frame offset Since Krakensbane engages so quickly now, and therefore FO has to run each frame to apply the out-of-KB-frame velocity, the 'continuous' check is often superfluous. We rely on Krakensbane telling us (since it runs right before us) whether it's safe to engage. That's the 'canEngageThisFrame' check. If Krakensbane is not running to set that, we assume it is safe and therefore reset to true at the end of the method. We also need to disable collision enhancer on large offsets, just in case.

void FloatingOrigin.OnDestroy ( )
inlineprotected
static bool FloatingOrigin.RegisterParticleSystem ( ParticleSystem  sys)
inlinestatic

Regsiter a worldspace particlesystem with FO. Returns false if no instance of FO, or if FO already has the system.

Parameters
sys
Returns
void FloatingOrigin.ResetOffset ( )
inline

Sets offset so the launchpad spawn point is at the origin

static void FloatingOrigin.ResetTerrainShaderOffset ( )
inlinestatic

Resets shader offset to avoid the offset getting too large.

void FloatingOrigin.setOffset ( Vector3d  refPos,
Vector3d  nonFrame 
)
inlineprotected

Shifts the origin so that it center at the given position

Parameters
refPosThe position (in global space) to center on
nonFrameThe additional offset to apply to things not in the Krakensbane velocity frame.

< Offset vessel itself–if in the frame, use our regular offset, else use the full (including krakensbane velocity change) offset.

static void FloatingOrigin.SetOffset ( Vector3d  refPos)
inlinestatic

Shifts the origin so that it center at the given position

Parameters
refPosThe position (in global space) to center on
static void FloatingOrigin.SetOutOfFrameOffset ( Vector3d  add)
inlinestatic

Sets the additional offset for those objects not in the moving Krakensbane frame. Called by Krakensbane.

Parameters
add
static void FloatingOrigin.SetSafeToEngage ( bool  val)
inlinestatic

Sets whether it's safe to engage. Called by Krakensbane.

Parameters
val
static bool FloatingOrigin.UnregisterParticleSystem ( ParticleSystem  sys)
inlinestatic

Unregister a worldspace particlesystem with FO. Returns false if no instance of FO, or if the sys is not registered.

Parameters
sys
Returns

Member Data Documentation

double FloatingOrigin.altToStopMovingExplosions = 10000d
bool FloatingOrigin.canEngageThisFrame = true
double FloatingOrigin.CoMRecalcOffsetMaxSqr = (10000d * 10000d)
bool FloatingOrigin.continuous
FloatingOrigin FloatingOrigin.fetch
static
Transform FloatingOrigin.forcedCenterTransform
Vector3d FloatingOrigin.offset
Vector3d FloatingOrigin.outOfFrameAdditional = Vector3d.zero
int FloatingOrigin.particlesLength = 1024
static
List<ParticleSystem> FloatingOrigin.particleSystems = new List<ParticleSystem>()
int FloatingOrigin.pCount
Vector3d FloatingOrigin.reverseoffset
float FloatingOrigin.threshold = 500f
float FloatingOrigin.thresholdSqr
double FloatingOrigin.velForContinuous = 5000d
double FloatingOrigin.velForContinuousSqr

Property Documentation

Vector3d FloatingOrigin.Offset
staticget
Vector3d FloatingOrigin.OffsetNonKrakensbane
staticget
Vector3d FloatingOrigin.ReverseOffset
staticget
Vector3d FloatingOrigin.TerrainShaderOffset
staticgetset

Terrain shader offset used by the terrain shader to match up with the floating origin.


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