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

Classes

struct  CubeData
 A struct to hold the data calculated for cubes More...
 

Public Member Functions

void AddSurfaceDragDirection (Vector3 direction, float machNumber, ref CubeData retData)
 Calculates all the dragcube data for a given direction and mach More...
 
void ClearCubes ()
 Clears all drag cubes and resets procedural flag to false More...
 
void DrawDragGizmos ()
 Draw the gizmos for debugging purposes More...
 
void ForceUpdate (bool weights, bool occlusion, bool resetProcTiming=false)
 Forces the drag cubes on this part to recalculate it's weights and also all attached parts to recalculate their occlusion More...
 
DragCube GetCube (string name)
 Searches for a drag cube with the given name. More...
 
float GetCubeAreaDir (Vector3 dir, float[] areas)
 Gets the cross-sectional area facing a certain direction, using the specified area array More...
 
float GetCubeAreaDir (Vector3 dir)
 Gets the cross-sectional area facing a certain direction. More...
 
float GetCubeCoeffDir (Vector3 dir)
 Gets the fineness of an object in the given direction, using the drag coefficients. More...
 
float GetCubeDepthDir (Vector3 dir)
 Gets the weighted depth of maximum width of the object in the given direction. (E.g. a Mk1 Pod would have a depth offset of about 0.3m in YN) More...
 
bool LoadCube (DragCubeList cubes, string whichOne)
 Loads an existing drag cube from a drag cube list, specifying the desired name More...
 
bool LoadCubes (ConfigNode node)
 Loads the custom drag cubes defined in the part's cfg More...
 
bool LoadCubes (DragCubeList cubes)
 Loads an existing drag cube list into this part More...
 
void RequestOcclusionUpdate ()
 Forces the drag cubes on this part to recalculate occlusion More...
 
void ResetCubeWeights (float newWeight)
 Resets all cube weights to a given value (useful for clearing all cubes) More...
 
void ResetCubeWeights ()
 Resets all cube weights to 1 More...
 
ConfigNode SaveCubes ()
 
void SetCubeWeight (string name, float weight)
 Sets a given cube weight More...
 
void SetDrag (Vector3 vector, float machNumber)
 Sets the part's drag vector and recalculates the area and drag for the drag cube list More...
 
void SetDragVectorRotation (Quaternion rotation)
 
void SetDragVectorRotation (bool rotateDragVector)
 
void SetDragWeights ()
 Sets the part's weighted drag areas and coefficients More...
 
void SetOcclusionMultiplier (float multiplier)
 
void SetPart (Part part)
 used to assign the part up on start More...
 
void SetPartOcclusion ()
 Sets the state of the occlusion from the attached nodes More...
 

Static Public Member Functions

static Vector3 GetFaceDirection (DragCube.DragFace direction)
 

Public Attributes

PhysicsGlobals.LiftingSurfaceCurve BodyLiftCurve
 
FloatCurve DragCurveCd
 
FloatCurve DragCurveCdPower
 
FloatCurve DragCurveMultiplier
 
PhysicsGlobals.SurfaceCurvesList SurfaceCurves
 

Properties

float Area [get]
 The resulting area More...
 
float AreaDrag [get]
 The resulting area multiplied by the drag coefficient More...
 
float[] AreaOccluded [get]
 
float CrossSectionalArea [get]
 The resulting area without taking mach curves into account More...
 
List< DragCubeCubes [get]
 List of DragCubes contained by this object More...
 
float Depth [get]
 The depth value More...
 
float DragCoeff [get]
 The drag coefficient, unmodified by Mach effects More...
 
Vector3 DragVector [get]
 The part that this drag list is assigned to More...
 
Quaternion DragVectorRotation [get]
 
float ExposedArea [get]
 The resulting area taking mach compressability into acount More...
 
Vector3 LiftForce [get]
 The lift force from blunt body effects More...
 
bool None [get, set]
 If this part has this flag set, it will never generate any drag More...
 
float OcclusionMultiplier [get]
 
Part Part [get]
 The part that this drag list is assigned to More...
 
float PostOcclusionArea [get]
 The resulting area More...
 
bool Procedural [get, set]
 If this part has procedural drag cube setup this flag will be true More...
 
bool RotateDragVector [get]
 
float TaperDot [get]
 The average dot of the surface with the drag vector, representing the cosine of the conic half-angle More...
 
float[] WeightedArea [get]
 
Vector3 WeightedCenter [get]
 
float[] WeightedDepth [get]
 
float[] WeightedDrag [get]
 
Vector3 WeightedSize [get]
 

Member Function Documentation

void DragCubeList.AddSurfaceDragDirection ( Vector3  direction,
float  machNumber,
ref CubeData  retData 
)
inline

Calculates all the dragcube data for a given direction and mach

Parameters
directionthe outgoing direction
machNumberthe part's mach
Returns

< get area multiplier, catching some bad cases

void DragCubeList.ClearCubes ( )
inline

Clears all drag cubes and resets procedural flag to false

void DragCubeList.DrawDragGizmos ( )
inline

Draw the gizmos for debugging purposes

void DragCubeList.ForceUpdate ( bool  weights,
bool  occlusion,
bool  resetProcTiming = false 
)
inline

Forces the drag cubes on this part to recalculate it's weights and also all attached parts to recalculate their occlusion

DragCube DragCubeList.GetCube ( string  name)
inline

Searches for a drag cube with the given name.

Parameters
nameName of the drag cube that we want to get.
Returns
Drag Cube which matches the name. Null if there isn't one.
float DragCubeList.GetCubeAreaDir ( Vector3  dir,
float[]  areas 
)
inline

Gets the cross-sectional area facing a certain direction, using the specified area array

Parameters
dirthe outgoing direction
areasthe area array to use
Returns
float DragCubeList.GetCubeAreaDir ( Vector3  dir)
inline

Gets the cross-sectional area facing a certain direction.

Parameters
dirthe outgoing direction
Returns
float DragCubeList.GetCubeCoeffDir ( Vector3  dir)
inline

Gets the fineness of an object in the given direction, using the drag coefficients.

Parameters
dirthe outgoing direction
Returns
float DragCubeList.GetCubeDepthDir ( Vector3  dir)
inline

Gets the weighted depth of maximum width of the object in the given direction. (E.g. a Mk1 Pod would have a depth offset of about 0.3m in YN)

Parameters
dirthe outgoing direction
Returns
static Vector3 DragCubeList.GetFaceDirection ( DragCube.DragFace  direction)
inlinestatic
bool DragCubeList.LoadCube ( DragCubeList  cubes,
string  whichOne 
)
inline

Loads an existing drag cube from a drag cube list, specifying the desired name

bool DragCubeList.LoadCubes ( ConfigNode  node)
inline

Loads the custom drag cubes defined in the part's cfg

bool DragCubeList.LoadCubes ( DragCubeList  cubes)
inline

Loads an existing drag cube list into this part

void DragCubeList.RequestOcclusionUpdate ( )
inline

Forces the drag cubes on this part to recalculate occlusion

void DragCubeList.ResetCubeWeights ( float  newWeight)
inline

Resets all cube weights to a given value (useful for clearing all cubes)

void DragCubeList.ResetCubeWeights ( )
inline

Resets all cube weights to 1

ConfigNode DragCubeList.SaveCubes ( )
inline
void DragCubeList.SetCubeWeight ( string  name,
float  weight 
)
inline

Sets a given cube weight

Parameters
name
weight
void DragCubeList.SetDrag ( Vector3  vector,
float  machNumber 
)
inline

Sets the part's drag vector and recalculates the area and drag for the drag cube list

Parameters
vector
void DragCubeList.SetDragVectorRotation ( Quaternion  rotation)
inline
void DragCubeList.SetDragVectorRotation ( bool  rotateDragVector)
inline
void DragCubeList.SetDragWeights ( )
inline

Sets the part's weighted drag areas and coefficients

void DragCubeList.SetOcclusionMultiplier ( float  multiplier)
inline
void DragCubeList.SetPart ( Part  part)
inline

used to assign the part up on start

Parameters
part
void DragCubeList.SetPartOcclusion ( )
inline

Sets the state of the occlusion from the attached nodes

Parameters
part

< set occluded area array to weighted area - we will subtract from this occluded area array as required

< set weighted drag back to original - we will modify it based on occlusion

< some helpful things

Member Data Documentation

PhysicsGlobals.LiftingSurfaceCurve DragCubeList.BodyLiftCurve
FloatCurve DragCubeList.DragCurveCd
FloatCurve DragCubeList.DragCurveCdPower
FloatCurve DragCubeList.DragCurveMultiplier
PhysicsGlobals.SurfaceCurvesList DragCubeList.SurfaceCurves

Property Documentation

float DragCubeList.Area
get

The resulting area

float DragCubeList.AreaDrag
get

The resulting area multiplied by the drag coefficient

float [] DragCubeList.AreaOccluded
get
float DragCubeList.CrossSectionalArea
get

The resulting area without taking mach curves into account

List<DragCube> DragCubeList.Cubes
get

List of DragCubes contained by this object

float DragCubeList.Depth
get

The depth value

float DragCubeList.DragCoeff
get

The drag coefficient, unmodified by Mach effects

Vector3 DragCubeList.DragVector
get

The part that this drag list is assigned to

Quaternion DragCubeList.DragVectorRotation
get
float DragCubeList.ExposedArea
get

The resulting area taking mach compressability into acount

Vector3 DragCubeList.LiftForce
get

The lift force from blunt body effects

bool DragCubeList.None
getset

If this part has this flag set, it will never generate any drag

float DragCubeList.OcclusionMultiplier
get
Part DragCubeList.Part
get

The part that this drag list is assigned to

float DragCubeList.PostOcclusionArea
get

The resulting area

bool DragCubeList.Procedural
getset

If this part has procedural drag cube setup this flag will be true

bool DragCubeList.RotateDragVector
get
float DragCubeList.TaperDot
get

The average dot of the surface with the drag vector, representing the cosine of the conic half-angle

float [] DragCubeList.WeightedArea
get
Vector3 DragCubeList.WeightedCenter
get
float [] DragCubeList.WeightedDepth
get
float [] DragCubeList.WeightedDrag
get
Vector3 DragCubeList.WeightedSize
get

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