Arma Reforger Script API
Loading...
Searching...
No Matches
SCR_Math Interface Reference

Static Public Member Functions

static float fmod (float dividend, float divisor)
 Takes two floats and returns the remainder after division.
 
static float LerpAngle (float a, float b, float t)
 Shortest linear interpolation between two angles.
 
static float DeltaAngle (float a, float b)
 Get shortest angle between two angles.
 
static int IntegerMask (int x)
 Minimum mask that can cover a provided number.
 
static float GetDistanceToStop (float speed, float deceleration)
 Get distance to stop with given deceleration.
 
static float GetSpeedToReachDistance (float distance, float deceleration)
 Get speed necessary to reach given distance with specified deceleration.
 
static float GetSpeedToReachDistanceInTime (float distance, float deceleration, float time)
 Get speed necessary to reach given distance with specified deceleration in specified time.
 
static float GetGaussianDistributionRandom (float min, float mid, float max)
 
static float GetBatesDistributionRandom (float min, float mid, float max)
 This is Arma 3's random (syntax 2) formula.
 
static RandomGenerator GetMathRandomGenerator ()
 Get the math random Generator.
 
static float FixAngle (float angle, float units=Math.PI)
 Ensures the angle is in range <-units; +units>
 
static float ConvertFromRadians (float radianAngleFrom, SCR_EOpticsAngleUnits toUnitType)
 Converts angle to provided unit type from radians.
 
static float ConvertToRadians (float angleFrom, SCR_EOpticsAngleUnits fromUnitType)
 Converts angle from provided unit type to radians.
 

Static Public Attributes

static const float MILS_NATO2DEG = 0.05625
 
static const float MILS_WP2DEG = 0.06
 
static const float MILS_STRECK2DEG = 0.05714
 

Static Protected Attributes

const static ref RandomGenerator RANDOM_GENERATOR = new RandomGenerator()
 

Member Function Documentation

◆ ConvertFromRadians()

static float SCR_Math.ConvertFromRadians ( float radianAngleFrom,
SCR_EOpticsAngleUnits toUnitType )
static

Converts angle to provided unit type from radians.

Parameters
[in]radianAngleFrom
[in]toUnitType
Returns

◆ ConvertToRadians()

static float SCR_Math.ConvertToRadians ( float angleFrom,
SCR_EOpticsAngleUnits fromUnitType )
static

Converts angle from provided unit type to radians.

Parameters
[in]angleFrom
[in]fromUnitType
Returns

◆ DeltaAngle()

static float SCR_Math.DeltaAngle ( float a,
float b )
static

Get shortest angle between two angles.

Parameters
[in]aStart angle in degrees
[in]bTarget angle in degrees
Returns
Difference in degrees

◆ FixAngle()

static float SCR_Math.FixAngle ( float angle,
float units = Math::PI )
static

Ensures the angle is in range <-units; +units>

Parameters
[in]angleangle value
[in]unitsMath.PI or 180
Returns
float angle in range <-units; +units>

◆ fmod()

static float SCR_Math.fmod ( float dividend,
float divisor )
static

Takes two floats and returns the remainder after division.

Parameters
[in]dividend
[in]divisor
Returns
an always-positive modulo (unlike Math.Mod)

◆ GetBatesDistributionRandom()

static float SCR_Math.GetBatesDistributionRandom ( float min,
float mid,
float max )
static

This is Arma 3's random (syntax 2) formula.

Parameters
[in]min(included)
[in]midBates curve's middle point
[in]max(included)
Returns
the random value

◆ GetDistanceToStop()

static float SCR_Math.GetDistanceToStop ( float speed,
float deceleration )
static

Get distance to stop with given deceleration.

Parameters
[in]speed
[in]deceleration
Returns
stop distance in metres

◆ GetGaussianDistributionRandom()

static float SCR_Math.GetGaussianDistributionRandom ( float min,
float mid,
float max )
static
Parameters
[in]min(included)
[in]midGaussian curve's middle point
[in]max(included)
Returns
the random value

◆ GetMathRandomGenerator()

static RandomGenerator SCR_Math.GetMathRandomGenerator ( )
static

Get the math random Generator.

Returns
the one SCR_Math's random generator

◆ GetSpeedToReachDistance()

static float SCR_Math.GetSpeedToReachDistance ( float distance,
float deceleration )
static

Get speed necessary to reach given distance with specified deceleration.

Parameters
[in]distance
[in]deceleration
Returns

◆ GetSpeedToReachDistanceInTime()

static float SCR_Math.GetSpeedToReachDistanceInTime ( float distance,
float deceleration,
float time )
static

Get speed necessary to reach given distance with specified deceleration in specified time.

Parameters
[in]distance
[in]deceleration
[in]time
Returns

◆ IntegerMask()

static int SCR_Math.IntegerMask ( int x)
static

Minimum mask that can cover a provided number.

Parameters
[in]xPositive integer value
Returns
Minimum mask

◆ LerpAngle()

static float SCR_Math.LerpAngle ( float a,
float b,
float t )
static

Shortest linear interpolation between two angles.

Parameters
[in]aStart angle in degrees
[in]bTarget angle in degrees
[in]timeProgress in range [0,1]
Returns
Interpolated angle

Member Data Documentation

◆ MILS_NATO2DEG

const float SCR_Math.MILS_NATO2DEG = 0.05625
static

◆ MILS_STRECK2DEG

const float SCR_Math.MILS_STRECK2DEG = 0.05714
static

◆ MILS_WP2DEG

const float SCR_Math.MILS_WP2DEG = 0.06
static

◆ RANDOM_GENERATOR

const static ref RandomGenerator SCR_Math.RANDOM_GENERATOR = new RandomGenerator()
staticprotected

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