M&B: Bannerlord 1.2.7
The horns sound, the ravens gather.
Loading...
Searching...
No Matches
TaleWorlds.Library.MathF Class Reference

Static Public Member Functions

static float Sqrt (float x)
 
static float Sin (float x)
 
static float Asin (float x)
 
static float Cos (float x)
 
static float Acos (float x)
 
static float Tan (float x)
 
static float Tanh (float x)
 
static float Atan (float x)
 
static float Atan2 (float y, float x)
 
static double Pow (double x, double y)
 
static double Pow (float x, double y)
 
static float Pow (float x, float y)
 Returns x raised to the power y.
 
static int PowTwo32 (int x)
 
static ulong PowTwo64 (int x)
 
static bool IsValidValue (float f)
 Checks the value.
 
static float Clamp (float value, float minValue, float maxValue)
 Clamps the input value.
 
static float AngleClamp (float angle)
 
static float Lerp (float valueFrom, float valueTo, float amount, float minimumDifference=Epsilon)
 Linear interpolation between two floating values.
 
static float AngleLerp (float angleFrom, float angleTo, float amount, float minimumDifference=Epsilon)
 
static int Round (double f)
 
static int Round (float f)
 
static float Round (float f, int digits)
 
static int Round (int f)
 
static int Floor (double f)
 
static int Floor (float f)
 
static int Floor (int f)
 
static int Ceiling (double f)
 
static int Ceiling (float f)
 
static int Ceiling (int f)
 
static double Abs (double f)
 
static float Abs (float f)
 
static int Abs (int f)
 
static double Max (double a, double b)
 
static float Max (float a, float b)
 
static float Max (float a, int b)
 
static float Max (int a, float b)
 
static int Max (int a, int b)
 
static long Max (long a, long b)
 
static uint Max (uint a, uint b)
 
static float Max (float a, float b, float c)
 
static double Min (double a, double b)
 
static float Min (float a, float b)
 
static short Min (short a, short b)
 
static int Min (int a, int b)
 
static long Min (long a, long b)
 
static uint Min (uint a, uint b)
 
static int Min (int a, float b)
 
static int Min (float a, int b)
 
static float Min (float a, float b, float c)
 
static float PingPong (float min, float max, float time)
 
static int GreatestCommonDivisor (int a, int b)
 Greatest Common Divisor.
 
static float Log (float a)
 
static float Log (float a, float newBase)
 
static int Sign (float f)
 
static int Sign (int f)
 
static void SinCos (float a, out float sa, out float ca)
 
static float Log10 (float val)
 

Static Public Attributes

const float DegToRad = (float)(Math.PI / 180.0f)
 
const float RadToDeg = (float)(180.0f / Math.PI)
 
const float TwoPI = (float)Math.PI * 2
 
const float PI = (float)Math.PI
 
const float HalfPI = (float)Math.PI * 0.5f
 
const float E = (float)Math.E
 
const float Epsilon = 0.00001f
 

Member Function Documentation

◆ Sqrt()

static float TaleWorlds.Library.MathF.Sqrt ( float  x)
static

◆ Sin()

static float TaleWorlds.Library.MathF.Sin ( float  x)
static

◆ Asin()

static float TaleWorlds.Library.MathF.Asin ( float  x)
static

◆ Cos()

static float TaleWorlds.Library.MathF.Cos ( float  x)
static

◆ Acos()

static float TaleWorlds.Library.MathF.Acos ( float  x)
static

◆ Tan()

static float TaleWorlds.Library.MathF.Tan ( float  x)
static

◆ Tanh()

static float TaleWorlds.Library.MathF.Tanh ( float  x)
static

◆ Atan()

static float TaleWorlds.Library.MathF.Atan ( float  x)
static

◆ Atan2()

static float TaleWorlds.Library.MathF.Atan2 ( float  y,
float  x 
)
static

◆ Pow() [1/3]

static double TaleWorlds.Library.MathF.Pow ( double  x,
double  y 
)
static

◆ Pow() [2/3]

static double TaleWorlds.Library.MathF.Pow ( float  x,
double  y 
)
static

◆ Pow() [3/3]

static float TaleWorlds.Library.MathF.Pow ( float  x,
float  y 
)
static

◆ PowTwo32()

static int TaleWorlds.Library.MathF.PowTwo32 ( int  x)
static

◆ PowTwo64()

static ulong TaleWorlds.Library.MathF.PowTwo64 ( int  x)
static

◆ IsValidValue()

static bool TaleWorlds.Library.MathF.IsValidValue ( float  f)
static
Parameters
fValue to be checked.
Returns
true if value is valid float, false if value is NaN (Not A Number).

◆ Clamp()

static float TaleWorlds.Library.MathF.Clamp ( float  value,
float  minValue,
float  maxValue 
)
static
Parameters
valueInput value.
minValueThe min value.
maxValueThe max value.
Returns
Clamped value.

◆ AngleClamp()

static float TaleWorlds.Library.MathF.AngleClamp ( float  angle)
static

◆ Lerp()

static float TaleWorlds.Library.MathF.Lerp ( float  valueFrom,
float  valueTo,
float  amount,
float  minimumDifference = Epsilon 
)
static
Parameters
valueFromFirst source value.
valueToSecond source value.
amountThe weight of parameter valueTo, such that 0≤x≤1.
minimumDifferenceThe minimum difference that can happen between two values. If difference is less than this value, then valueTo is returned immediately.
Returns
Interpolated value.

◆ AngleLerp()

static float TaleWorlds.Library.MathF.AngleLerp ( float  angleFrom,
float  angleTo,
float  amount,
float  minimumDifference = Epsilon 
)
static

◆ Round() [1/4]

static int TaleWorlds.Library.MathF.Round ( double  f)
static

◆ Round() [2/4]

static int TaleWorlds.Library.MathF.Round ( float  f)
static

◆ Round() [3/4]

static float TaleWorlds.Library.MathF.Round ( float  f,
int  digits 
)
static

◆ Round() [4/4]

static int TaleWorlds.Library.MathF.Round ( int  f)
static

◆ Floor() [1/3]

static int TaleWorlds.Library.MathF.Floor ( double  f)
static

◆ Floor() [2/3]

static int TaleWorlds.Library.MathF.Floor ( float  f)
static

◆ Floor() [3/3]

static int TaleWorlds.Library.MathF.Floor ( int  f)
static

◆ Ceiling() [1/3]

static int TaleWorlds.Library.MathF.Ceiling ( double  f)
static

◆ Ceiling() [2/3]

static int TaleWorlds.Library.MathF.Ceiling ( float  f)
static

◆ Ceiling() [3/3]

static int TaleWorlds.Library.MathF.Ceiling ( int  f)
static

◆ Abs() [1/3]

static double TaleWorlds.Library.MathF.Abs ( double  f)
static

◆ Abs() [2/3]

static float TaleWorlds.Library.MathF.Abs ( float  f)
static

◆ Abs() [3/3]

static int TaleWorlds.Library.MathF.Abs ( int  f)
static

◆ Max() [1/8]

static double TaleWorlds.Library.MathF.Max ( double  a,
double  b 
)
static

◆ Max() [2/8]

static float TaleWorlds.Library.MathF.Max ( float  a,
float  b 
)
static

◆ Max() [3/8]

static float TaleWorlds.Library.MathF.Max ( float  a,
int  b 
)
static

◆ Max() [4/8]

static float TaleWorlds.Library.MathF.Max ( int  a,
float  b 
)
static

◆ Max() [5/8]

static int TaleWorlds.Library.MathF.Max ( int  a,
int  b 
)
static

◆ Max() [6/8]

static long TaleWorlds.Library.MathF.Max ( long  a,
long  b 
)
static

◆ Max() [7/8]

static uint TaleWorlds.Library.MathF.Max ( uint  a,
uint  b 
)
static

◆ Max() [8/8]

static float TaleWorlds.Library.MathF.Max ( float  a,
float  b,
float  c 
)
static

◆ Min() [1/9]

static double TaleWorlds.Library.MathF.Min ( double  a,
double  b 
)
static

◆ Min() [2/9]

static float TaleWorlds.Library.MathF.Min ( float  a,
float  b 
)
static

◆ Min() [3/9]

static short TaleWorlds.Library.MathF.Min ( short  a,
short  b 
)
static

◆ Min() [4/9]

static int TaleWorlds.Library.MathF.Min ( int  a,
int  b 
)
static

◆ Min() [5/9]

static long TaleWorlds.Library.MathF.Min ( long  a,
long  b 
)
static

◆ Min() [6/9]

static uint TaleWorlds.Library.MathF.Min ( uint  a,
uint  b 
)
static

◆ Min() [7/9]

static int TaleWorlds.Library.MathF.Min ( int  a,
float  b 
)
static

◆ Min() [8/9]

static int TaleWorlds.Library.MathF.Min ( float  a,
int  b 
)
static

◆ Min() [9/9]

static float TaleWorlds.Library.MathF.Min ( float  a,
float  b,
float  c 
)
static

◆ PingPong()

static float TaleWorlds.Library.MathF.PingPong ( float  min,
float  max,
float  time 
)
static

◆ GreatestCommonDivisor()

static int TaleWorlds.Library.MathF.GreatestCommonDivisor ( int  a,
int  b 
)
static

◆ Log() [1/2]

static float TaleWorlds.Library.MathF.Log ( float  a)
static

◆ Log() [2/2]

static float TaleWorlds.Library.MathF.Log ( float  a,
float  newBase 
)
static

◆ Sign() [1/2]

static int TaleWorlds.Library.MathF.Sign ( float  f)
static

◆ Sign() [2/2]

static int TaleWorlds.Library.MathF.Sign ( int  f)
static

◆ SinCos()

static void TaleWorlds.Library.MathF.SinCos ( float  a,
out float  sa,
out float  ca 
)
static

◆ Log10()

static float TaleWorlds.Library.MathF.Log10 ( float  val)
static

Member Data Documentation

◆ DegToRad

const float TaleWorlds.Library.MathF.DegToRad = (float)(Math.PI / 180.0f)
static

◆ RadToDeg

const float TaleWorlds.Library.MathF.RadToDeg = (float)(180.0f / Math.PI)
static

◆ TwoPI

const float TaleWorlds.Library.MathF.TwoPI = (float)Math.PI * 2
static

◆ PI

const float TaleWorlds.Library.MathF.PI = (float)Math.PI
static

◆ HalfPI

const float TaleWorlds.Library.MathF.HalfPI = (float)Math.PI * 0.5f
static

◆ E

const float TaleWorlds.Library.MathF.E = (float)Math.E
static

◆ Epsilon

const float TaleWorlds.Library.MathF.Epsilon = 0.00001f
static