C# Класс Kramax.Utility.Utils

Показать файл Открыть проект

Открытые методы

Метод Описание
Clamp ( this val, double min, double max ) : double
Clamp ( this val, float min, float max ) : float
CurrentAngleTargetRel ( double current, double target, double maxAngle ) : double

calculates the angle to feed corrected for 0/360 crossings eg. if the target is 350 and the current is 10, it will return 370 giving a diff of -20 degrees else you get +ve 340 and the turn is in the wrong direction

IsNeutral ( AxisBinding axis ) : bool
SpeedUnitToMSec ( this speedUnit, SpeedMode mode, SpeedUnits units, Vessel vessel ) : double
TryGetValue ( this node, string key, KeyCode defaultValue ) : KeyCode
TryGetValue ( this node, string key, Rect defaultValue ) : Rect
TryGetValue ( this node, string key, bool defaultValue ) : bool
TryGetValue ( this node, string key, double defaultValue ) : double
TryGetValue ( this node, string key, float defaultValue ) : float
TryGetValue ( this node, string key, int defaultValue ) : int
TryGetValue ( this node, string key, string defaultValue ) : string
calcStagnationPres ( Vessel vessel ) : double
calculateTargetHeading ( Quaternion rotation, Vessel vessel, VesselData vdata ) : double

calculate current heading from plane rotation

calculateTargetHeading ( Vector3 direction, VesselData vdata ) : double

calculate current heading from plane normal vector

getPlaneNormal ( Quaternion rotation, Vessel vessel ) : Vector3
getPlaneRotation ( Vector3 planeNormal, Vessel vessel ) : Quaternion

calculate the planet relative rotation from the plane normal vector

getPlaneRotation ( double heading, Vessel vessel, VesselData vdata ) : Quaternion
hasPitchInput ( ) : bool
hasRollInput ( ) : bool
hasThrottleInput ( ) : bool
hasYawInput ( ) : bool
headingClamp ( this valToClamp, double maxHeading ) : double

Circular rounding to keep compass measurements within a 360 degree range maxHeading is the top limit, bottom limit is maxHeading - 360

mSecToSpeedUnit ( this mSec, SpeedMode mode, SpeedUnits units, Vessel vessel ) : double
projectOnPlane ( this vector, UnityEngine.Vector3d planeNormal ) : UnityEngine.Vector3d
speedUnitTransform ( SpeedUnits units, double soundSpeed ) : double
unitString ( SpeedUnits unit ) : string
vecHeading ( double target, VesselData vdata ) : Vector3

Plane normal vector from a given heading (surface right vector)

Описание методов

Clamp() публичный статический Метод

public static Clamp ( this val, double min, double max ) : double
val this
min double
max double
Результат double

Clamp() публичный статический Метод

public static Clamp ( this val, float min, float max ) : float
val this
min float
max float
Результат float

CurrentAngleTargetRel() публичный статический Метод

calculates the angle to feed corrected for 0/360 crossings eg. if the target is 350 and the current is 10, it will return 370 giving a diff of -20 degrees else you get +ve 340 and the turn is in the wrong direction
public static CurrentAngleTargetRel ( double current, double target, double maxAngle ) : double
current double
target double
maxAngle double
Результат double

IsNeutral() публичный статический Метод

public static IsNeutral ( AxisBinding axis ) : bool
axis AxisBinding
Результат bool

SpeedUnitToMSec() публичный статический Метод

public static SpeedUnitToMSec ( this speedUnit, SpeedMode mode, SpeedUnits units, Vessel vessel ) : double
speedUnit this
mode SpeedMode
units SpeedUnits
vessel Vessel
Результат double

TryGetValue() публичный статический Метод

public static TryGetValue ( this node, string key, KeyCode defaultValue ) : KeyCode
node this
key string
defaultValue KeyCode
Результат KeyCode

TryGetValue() публичный статический Метод

public static TryGetValue ( this node, string key, Rect defaultValue ) : Rect
node this
key string
defaultValue UnityEngine.Rect
Результат UnityEngine.Rect

TryGetValue() публичный статический Метод

public static TryGetValue ( this node, string key, bool defaultValue ) : bool
node this
key string
defaultValue bool
Результат bool

TryGetValue() публичный статический Метод

public static TryGetValue ( this node, string key, double defaultValue ) : double
node this
key string
defaultValue double
Результат double

TryGetValue() публичный статический Метод

public static TryGetValue ( this node, string key, float defaultValue ) : float
node this
key string
defaultValue float
Результат float

TryGetValue() публичный статический Метод

public static TryGetValue ( this node, string key, int defaultValue ) : int
node this
key string
defaultValue int
Результат int

TryGetValue() публичный статический Метод

public static TryGetValue ( this node, string key, string defaultValue ) : string
node this
key string
defaultValue string
Результат string

calcStagnationPres() публичный статический Метод

public static calcStagnationPres ( Vessel vessel ) : double
vessel Vessel
Результат double

calculateTargetHeading() публичный статический Метод

calculate current heading from plane rotation
public static calculateTargetHeading ( Quaternion rotation, Vessel vessel, VesselData vdata ) : double
rotation UnityEngine.Quaternion
vessel Vessel
vdata VesselData
Результат double

calculateTargetHeading() публичный статический Метод

calculate current heading from plane normal vector
public static calculateTargetHeading ( Vector3 direction, VesselData vdata ) : double
direction Vector3
vdata VesselData
Результат double

getPlaneNormal() публичный статический Метод

public static getPlaneNormal ( Quaternion rotation, Vessel vessel ) : Vector3
rotation UnityEngine.Quaternion
vessel Vessel
Результат Vector3

getPlaneRotation() публичный статический Метод

calculate the planet relative rotation from the plane normal vector
public static getPlaneRotation ( Vector3 planeNormal, Vessel vessel ) : Quaternion
planeNormal Vector3
vessel Vessel
Результат UnityEngine.Quaternion

getPlaneRotation() публичный статический Метод

public static getPlaneRotation ( double heading, Vessel vessel, VesselData vdata ) : Quaternion
heading double
vessel Vessel
vdata VesselData
Результат UnityEngine.Quaternion

hasPitchInput() публичный статический Метод

public static hasPitchInput ( ) : bool
Результат bool

hasRollInput() публичный статический Метод

public static hasRollInput ( ) : bool
Результат bool

hasThrottleInput() публичный статический Метод

public static hasThrottleInput ( ) : bool
Результат bool

hasYawInput() публичный статический Метод

public static hasYawInput ( ) : bool
Результат bool

headingClamp() публичный статический Метод

Circular rounding to keep compass measurements within a 360 degree range maxHeading is the top limit, bottom limit is maxHeading - 360
public static headingClamp ( this valToClamp, double maxHeading ) : double
valToClamp this
maxHeading double
Результат double

mSecToSpeedUnit() публичный статический Метод

public static mSecToSpeedUnit ( this mSec, SpeedMode mode, SpeedUnits units, Vessel vessel ) : double
mSec this
mode SpeedMode
units SpeedUnits
vessel Vessel
Результат double

projectOnPlane() публичный статический Метод

public static projectOnPlane ( this vector, UnityEngine.Vector3d planeNormal ) : UnityEngine.Vector3d
vector this
planeNormal UnityEngine.Vector3d
Результат UnityEngine.Vector3d

speedUnitTransform() публичный статический Метод

public static speedUnitTransform ( SpeedUnits units, double soundSpeed ) : double
units SpeedUnits
soundSpeed double
Результат double

unitString() публичный статический Метод

public static unitString ( SpeedUnits unit ) : string
unit SpeedUnits
Результат string

vecHeading() публичный статический Метод

Plane normal vector from a given heading (surface right vector)
public static vecHeading ( double target, VesselData vdata ) : Vector3
target double
vdata VesselData
Результат Vector3