Falco Engine 3.9.0.1 (beta)
FalcoEngine.Mathf Class Reference

Static Public Member Functions

static float Sin (float f)
 
static float Cos (float f)
 
static float Tan (float f)
 
static float Asin (float f)
 
static float Acos (float f)
 
static float Atan (float f)
 
static float Atan2 (float y, float x)
 
static float Sqrt (float f)
 
static float Abs (float f)
 
static int Abs (int value)
 
static float Min (float a, float b)
 
static float Min (params float[] values)
 
static int Min (int a, int b)
 
static int Min (params int[] values)
 
static float Max (float a, float b)
 
static float Max (params float[] values)
 
static int Max (int a, int b)
 
static int Max (params int[] values)
 
static float Pow (float f, float p)
 
static float Exp (float power)
 
static float Log (float f, float p)
 
static float Log (float f)
 
static float Log10 (float f)
 
static float Ceil (float f)
 
static float Floor (float f)
 
static float Round (float f)
 
static int CeilToInt (float f)
 
static int FloorToInt (float f)
 
static int RoundToInt (float f)
 
static float Sign (float f)
 
static float Clamp (float value, float min, float max)
 
static int Clamp (int value, int min, int max)
 
static float Clamp01 (float value)
 
static float Lerp (float a, float b, float t)
 
static float LerpUnclamped (float a, float b, float t)
 
static float LerpAngle (float a, float b, float t)
 
static float MoveTowards (float current, float target, float maxDelta)
 
static float MoveTowardsAngle (float current, float target, float maxDelta)
 
static float SmoothStep (float from, float to, float t)
 
static float Gamma (float value, float absmax, float gamma)
 
static float SmoothDamp (float current, float target, ref float currentVelocity, float smoothTime, float maxSpeed, float deltaTime)
 
static float SmoothDampAngle (float current, float target, ref float currentVelocity, float smoothTime, float maxSpeed, float deltaTime)
 
static float Repeat (float t, float length)
 
static float PingPong (float t, float length)
 
static float InverseLerp (float a, float b, float value)
 
static float DeltaAngle (float current, float target)
 
static bool Approximately (float a, float b)
 

Static Public Attributes

const float PI = 3.14159274f
 
const float Infinity = float.PositiveInfinity
 
const float NegativeInfinity = float.NegativeInfinity
 
const float Deg2Rad = 0.0174532924f
 
const float Rad2Deg = 57.29578f
 
static volatile float FloatMinNormal = 1.17549435E-38f
 
static volatile float FloatMinDenormal = 1.401298E-45f
 
static bool IsFlushToZeroEnabled = FloatMinDenormal == 0f
 
static readonly float Epsilon = (!IsFlushToZeroEnabled) ? FloatMinDenormal : FloatMinNormal
 

Detailed Description

Definition at line 9 of file Mathf.cs.

Member Function Documentation

◆ Abs() [1/2]

static float FalcoEngine.Mathf.Abs ( float  f)
static

Returns the absolute value of f.

Parameters
f

Definition at line 130 of file Mathf.cs.

◆ Abs() [2/2]

static int FalcoEngine.Mathf.Abs ( int  value)
static

Returns the absolute value of value.

Parameters
value

Definition at line 139 of file Mathf.cs.

◆ Acos()

static float FalcoEngine.Mathf.Acos ( float  f)
static

Returns the arc-cosine of f - the angle in radians whose cosine is f.

Parameters
f

Definition at line 93 of file Mathf.cs.

◆ Approximately()

static bool FalcoEngine.Mathf.Approximately ( float  a,
float  b 
)
static

Definition at line 685 of file Mathf.cs.

◆ Asin()

static float FalcoEngine.Mathf.Asin ( float  f)
static

Returns the arc-sine of f - the angle in radians whose sine is f.

Parameters
f

Definition at line 84 of file Mathf.cs.

◆ Atan()

static float FalcoEngine.Mathf.Atan ( float  f)
static

Returns the arc-tangent of f - the angle in radians whose tangent is f.

Parameters
f

Definition at line 102 of file Mathf.cs.

◆ Atan2()

static float FalcoEngine.Mathf.Atan2 ( float  y,
float  x 
)
static

Returns the angle in radians whose Tan is y/x.

Parameters
y
x

Definition at line 112 of file Mathf.cs.

◆ Ceil()

static float FalcoEngine.Mathf.Ceil ( float  f)
static

Returns the smallest integer greater to or equal to f.

Parameters
f

Definition at line 335 of file Mathf.cs.

◆ CeilToInt()

static int FalcoEngine.Mathf.CeilToInt ( float  f)
static

Returns the smallest integer greater to or equal to f.

Parameters
f

Definition at line 362 of file Mathf.cs.

◆ Clamp() [1/2]

static float FalcoEngine.Mathf.Clamp ( float  value,
float  min,
float  max 
)
static

Clamps a value between a minimum float and maximum float value.

Parameters
value
min
max

Definition at line 400 of file Mathf.cs.

◆ Clamp() [2/2]

static int FalcoEngine.Mathf.Clamp ( int  value,
int  min,
int  max 
)
static

Clamps value between min and max and returns value.

Parameters
value
min
max

Definition at line 419 of file Mathf.cs.

◆ Clamp01()

static float FalcoEngine.Mathf.Clamp01 ( float  value)
static

Clamps value between 0 and 1 and returns value.

Parameters
value

Definition at line 436 of file Mathf.cs.

◆ Cos()

static float FalcoEngine.Mathf.Cos ( float  f)
static

Returns the cosine of angle f.

Parameters
fThe input angle, in radians.
Returns
The return value between -1 and 1.

Definition at line 66 of file Mathf.cs.

◆ DeltaAngle()

static float FalcoEngine.Mathf.DeltaAngle ( float  current,
float  target 
)
static

Calculates the shortest difference between two given angles given in degrees.

Parameters
current
target

Definition at line 623 of file Mathf.cs.

◆ Exp()

static float FalcoEngine.Mathf.Exp ( float  power)
static

Returns e raised to the specified power.

Parameters
power

Definition at line 298 of file Mathf.cs.

◆ Floor()

static float FalcoEngine.Mathf.Floor ( float  f)
static

Returns the largest integer smaller than or equal to f.

Parameters
f

Definition at line 344 of file Mathf.cs.

◆ FloorToInt()

static int FalcoEngine.Mathf.FloorToInt ( float  f)
static

Returns the largest integer smaller to or equal to f.

Parameters
f

Definition at line 371 of file Mathf.cs.

◆ Gamma()

static float FalcoEngine.Mathf.Gamma ( float  value,
float  absmax,
float  gamma 
)
static

Definition at line 538 of file Mathf.cs.

◆ InverseLerp()

static float FalcoEngine.Mathf.InverseLerp ( float  a,
float  b,
float  value 
)
static

Calculates the linear parameter t that produces the interpolant value within the range [a, b].

Parameters
a
b
value

Definition at line 609 of file Mathf.cs.

◆ Lerp()

static float FalcoEngine.Mathf.Lerp ( float  a,
float  b,
float  t 
)
static

Linearly interpolates between a and b by t.

Parameters
aThe start value.
bThe end value.
tThe interpolation value between the two floats.
Returns
The interpolated float result between the two float values.

Definition at line 458 of file Mathf.cs.

◆ LerpAngle()

static float FalcoEngine.Mathf.LerpAngle ( float  a,
float  b,
float  t 
)
static

Same as Lerp but makes sure the values interpolate correctly when they wrap around 360 degrees.

Parameters
a
b
t

Definition at line 483 of file Mathf.cs.

◆ LerpUnclamped()

static float FalcoEngine.Mathf.LerpUnclamped ( float  a,
float  b,
float  t 
)
static

Linearly interpolates between a and b by t with no limit to t.

Parameters
aThe start value.
bThe end value.
tThe interpolation between the two floats.
Returns
The float value as a result from the linear interpolation.

Definition at line 472 of file Mathf.cs.

◆ Log() [1/2]

static float FalcoEngine.Mathf.Log ( float  f)
static

Returns the natural (base e) logarithm of a specified number.

Parameters
f

Definition at line 317 of file Mathf.cs.

◆ Log() [2/2]

static float FalcoEngine.Mathf.Log ( float  f,
float  p 
)
static

Returns the logarithm of a specified number in a specified base.

Parameters
f
p

Definition at line 308 of file Mathf.cs.

◆ Log10()

static float FalcoEngine.Mathf.Log10 ( float  f)
static

Returns the base 10 logarithm of a specified number.

Parameters
f

Definition at line 326 of file Mathf.cs.

◆ Max() [1/4]

static float FalcoEngine.Mathf.Max ( float  a,
float  b 
)
static

Returns largest of two or more values.

Parameters
a
b
values

Definition at line 220 of file Mathf.cs.

◆ Max() [2/4]

static int FalcoEngine.Mathf.Max ( int  a,
int  b 
)
static

Returns the largest of two or more values.

Parameters
a
b
values

Definition at line 255 of file Mathf.cs.

◆ Max() [3/4]

static float FalcoEngine.Mathf.Max ( params float[]  values)
static

Returns largest of two or more values.

Parameters
a
b
values

Definition at line 231 of file Mathf.cs.

◆ Max() [4/4]

static int FalcoEngine.Mathf.Max ( params int[]  values)
static

Returns the largest of two or more values.

Parameters
a
b
values

Definition at line 266 of file Mathf.cs.

◆ Min() [1/4]

static float FalcoEngine.Mathf.Min ( float  a,
float  b 
)
static

Returns the smallest of two or more values.

Parameters
a
b
values

Definition at line 150 of file Mathf.cs.

◆ Min() [2/4]

static int FalcoEngine.Mathf.Min ( int  a,
int  b 
)
static

Returns the smallest of two or more values.

Parameters
a
b
values

Definition at line 185 of file Mathf.cs.

◆ Min() [3/4]

static float FalcoEngine.Mathf.Min ( params float[]  values)
static

Returns the smallest of two or more values.

Parameters
a
b
values

Definition at line 161 of file Mathf.cs.

◆ Min() [4/4]

static int FalcoEngine.Mathf.Min ( params int[]  values)
static

Returns the smallest of two or more values.

Parameters
a
b
values

Definition at line 196 of file Mathf.cs.

◆ MoveTowards()

static float FalcoEngine.Mathf.MoveTowards ( float  current,
float  target,
float  maxDelta 
)
static

Moves a value current towards target.

Parameters
currentThe current value.
targetThe value to move towards.
maxDeltaThe maximum change that should be applied to the value.

Definition at line 499 of file Mathf.cs.

◆ MoveTowardsAngle()

static float FalcoEngine.Mathf.MoveTowardsAngle ( float  current,
float  target,
float  maxDelta 
)
static

Same as MoveTowards but makes sure the values interpolate correctly when they wrap around 360 degrees.

Parameters
current
target
maxDelta

Definition at line 514 of file Mathf.cs.

◆ PingPong()

static float FalcoEngine.Mathf.PingPong ( float  t,
float  length 
)
static

PingPongs the value t, so that it is never larger than length and never smaller than 0.

Parameters
t
length

Definition at line 597 of file Mathf.cs.

◆ Pow()

static float FalcoEngine.Mathf.Pow ( float  f,
float  p 
)
static

Returns f raised to power p.

Parameters
f
p

Definition at line 289 of file Mathf.cs.

◆ Repeat()

static float FalcoEngine.Mathf.Repeat ( float  t,
float  length 
)
static

Loops the value t, so that it is never larger than length and never smaller than 0.

Parameters
t
length

Definition at line 587 of file Mathf.cs.

◆ Round()

static float FalcoEngine.Mathf.Round ( float  f)
static

Returns f rounded to the nearest integer.

Parameters
f

Definition at line 353 of file Mathf.cs.

◆ RoundToInt()

static int FalcoEngine.Mathf.RoundToInt ( float  f)
static

Returns f rounded to the nearest integer.

Parameters
f

Definition at line 380 of file Mathf.cs.

◆ Sign()

static float FalcoEngine.Mathf.Sign ( float  f)
static

Returns the sign of f.

Parameters
f

Definition at line 389 of file Mathf.cs.

◆ Sin()

static float FalcoEngine.Mathf.Sin ( float  f)
static

Returns the sine of angle f.

Parameters
fThe input angle, in radians.
Returns
The return value between -1 and +1.

Definition at line 54 of file Mathf.cs.

◆ SmoothDamp()

static float FalcoEngine.Mathf.SmoothDamp ( float  current,
float  target,
ref float  currentVelocity,
float  smoothTime,
float  maxSpeed,
float  deltaTime 
)
static

Definition at line 554 of file Mathf.cs.

◆ SmoothDampAngle()

static float FalcoEngine.Mathf.SmoothDampAngle ( float  current,
float  target,
ref float  currentVelocity,
float  smoothTime,
float  maxSpeed,
float  deltaTime 
)
static

Definition at line 576 of file Mathf.cs.

◆ SmoothStep()

static float FalcoEngine.Mathf.SmoothStep ( float  from,
float  to,
float  t 
)
static

Interpolates between min and max with smoothing at the limits.

Parameters
from
to
t

Definition at line 531 of file Mathf.cs.

◆ Sqrt()

static float FalcoEngine.Mathf.Sqrt ( float  f)
static

Returns square root of f.

Parameters
f

Definition at line 121 of file Mathf.cs.

◆ Tan()

static float FalcoEngine.Mathf.Tan ( float  f)
static

Returns the tangent of angle f in radians.

Parameters
f

Definition at line 75 of file Mathf.cs.

Member Data Documentation

◆ Deg2Rad

const float FalcoEngine.Mathf.Deg2Rad = 0.0174532924f
static

Degrees-to-radians conversion constant (Read Only).

Definition at line 29 of file Mathf.cs.

◆ Epsilon

readonly float FalcoEngine.Mathf.Epsilon = (!IsFlushToZeroEnabled) ? FloatMinDenormal : FloatMinNormal
static

A tiny floating point value (Read Only).

Definition at line 45 of file Mathf.cs.

◆ FloatMinDenormal

volatile float FalcoEngine.Mathf.FloatMinDenormal = 1.401298E-45f
static

Definition at line 38 of file Mathf.cs.

◆ FloatMinNormal

volatile float FalcoEngine.Mathf.FloatMinNormal = 1.17549435E-38f
static

Definition at line 36 of file Mathf.cs.

◆ Infinity

const float FalcoEngine.Mathf.Infinity = float.PositiveInfinity
static

A representation of positive infinity (Read Only).

Definition at line 19 of file Mathf.cs.

◆ IsFlushToZeroEnabled

bool FalcoEngine.Mathf.IsFlushToZeroEnabled = FloatMinDenormal == 0f
static

Definition at line 40 of file Mathf.cs.

◆ NegativeInfinity

const float FalcoEngine.Mathf.NegativeInfinity = float.NegativeInfinity
static

A representation of negative infinity (Read Only).

Definition at line 24 of file Mathf.cs.

◆ PI

const float FalcoEngine.Mathf.PI = 3.14159274f
static

The infamous 3.14159265358979... value (Read Only).

Definition at line 14 of file Mathf.cs.

◆ Rad2Deg

const float FalcoEngine.Mathf.Rad2Deg = 57.29578f
static

Radians-to-degrees conversion constant (Read Only).

Definition at line 34 of file Mathf.cs.


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