Namespace: Astra · Assembly: Astra.Scripting · Tipo: Class
Gameplay math in radians, with explicit time and velocity state. Unity 6000.0 Mathf is the capability reference; Astra angles are radians.
Deg2Rad
public const float Deg2Rad = 0.017453292
Pi
public const float Pi = 3.1415927
Rad2Deg
public const float Rad2Deg = 57.295776
Tau
public const float Tau = 6.2831855
Clamp
public static float Clamp(float value, float minimum, float maximum)
| Parâmetro |
Tipo |
Contrato |
value |
float |
|
minimum |
float |
|
maximum |
float |
|
Clamp01
public static float Clamp01(float value)
| Parâmetro |
Tipo |
Contrato |
value |
float |
|
Damp
public static float Damp(float current, float target, float halfLifeSeconds, float deltaSeconds)
Frame-rate independent half-life damping. Zero half-life snaps to target.
| Parâmetro |
Tipo |
Contrato |
current |
float |
|
target |
float |
|
halfLifeSeconds |
float |
|
deltaSeconds |
float |
|
DeltaAngle
public static float DeltaAngle(float current, float target)
Signed shortest displacement in [-pi,pi], angles in radians.
| Parâmetro |
Tipo |
Contrato |
current |
float |
|
target |
float |
|
InverseLerp
public static float InverseLerp(float from, float to, float value)
| Parâmetro |
Tipo |
Contrato |
from |
float |
|
to |
float |
|
value |
float |
|
Lerp
public static float Lerp(float from, float to, float t)
| Parâmetro |
Tipo |
Contrato |
from |
float |
|
to |
float |
|
t |
float |
|
LerpAngle
public static float LerpAngle(float from, float to, float t)
| Parâmetro |
Tipo |
Contrato |
from |
float |
|
to |
float |
|
t |
float |
|
LerpUnclamped
public static float LerpUnclamped(float from, float to, float t)
| Parâmetro |
Tipo |
Contrato |
from |
float |
|
to |
float |
|
t |
float |
|
MoveTowards
public static float MoveTowards(float current, float target, float maximumDelta)
| Parâmetro |
Tipo |
Contrato |
current |
float |
|
target |
float |
|
maximumDelta |
float |
|
MoveTowardsAngle
public static float MoveTowardsAngle(float current, float target, float maximumDelta)
| Parâmetro |
Tipo |
Contrato |
current |
float |
|
target |
float |
|
maximumDelta |
float |
|
PingPong
public static float PingPong(float value, float length)
| Parâmetro |
Tipo |
Contrato |
value |
float |
|
length |
float |
|
Repeat
public static float Repeat(float value, float length)
| Parâmetro |
Tipo |
Contrato |
value |
float |
|
length |
float |
|
SmoothDamp
public static float SmoothDamp(float current, float target, ref float velocity, float smoothSeconds, float deltaSeconds, float maximumSpeed = Infinity)
Critically damped spring. Velocity must be retained by the caller; no hidden global time. Zero delta leaves current value and velocity intact.
| Parâmetro |
Tipo |
Contrato |
current |
float |
|
target |
float |
|
velocity |
float |
· Ref |
smoothSeconds |
float |
|
deltaSeconds |
float |
|
maximumSpeed |
float |
· Opcional: Infinity |
SmoothDampAngle
public static float SmoothDampAngle(float current, float target, ref float velocity, float smoothSeconds, float deltaSeconds, float maximumSpeed = Infinity)
| Parâmetro |
Tipo |
Contrato |
current |
float |
|
target |
float |
|
velocity |
float |
· Ref |
smoothSeconds |
float |
|
deltaSeconds |
float |
|
maximumSpeed |
float |
· Opcional: Infinity |
SmoothStep
public static float SmoothStep(float from, float to, float t)
| Parâmetro |
Tipo |
Contrato |
from |
float |
|
to |
float |
|
t |
float |
|