Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_Math Class Reference

Static Protected Member Functions

static float RandomFloat (float min, float max)
static float RandomFloatInclusive (float min, float max)
static float RandomGaussFloat (float min, float mid, float max)
static int RandomInt (int min, int max)
static int RandomIntInclusive (int min, int max)
static float fmod (float dividend, float divisor)
static float LerpAngle (float a, float b, float t)
static float DeltaAngle (float a, float b)
static int IntegerMask (int x)
static float GetDistanceToStop (float speed, float deceleration)
static float GetSpeedToReachDistance (float distance, float deceleration)
static float GetSpeedToReachDistanceInTime (float distance, float deceleration, float time)
static float GetGaussianDistributionRandom (float min, float mid, float max)
static float GetBatesDistributionRandom (float min, float mid, float max)
static RandomGenerator GetMathRandomGenerator ()
static float FixAngle (float angle, float units=Math.PI)
static float ConvertFromRadians (float radianAngleFrom, SCR_EOpticsAngleUnits toUnitType)
static float ConvertToRadians (float angleFrom, SCR_EOpticsAngleUnits fromUnitType)

Static Protected Attributes

static const ref RandomGenerator RANDOM_GENERATOR = new RandomGenerator()
static const float MILS_NATO2DEG = 0.05625
static const float MILS_WP2DEG = 0.06
static const float MILS_STRECK2DEG = 0.05714
static const int MAX_RANDOM = 0x7FFF

Detailed Description

Definition at line 1 of file SCR_Math.c.

Member Function Documentation

◆ ConvertFromRadians()

float SCR_Math::ConvertFromRadians ( float radianAngleFrom,
SCR_EOpticsAngleUnits toUnitType )
inlinestaticprotected

Converts angle to provided unit type from radians

Parameters
[in]radianAngleFrom
[in]toUnitType
Returns

Definition at line 290 of file SCR_Math.c.

◆ ConvertToRadians()

float SCR_Math::ConvertToRadians ( float angleFrom,
SCR_EOpticsAngleUnits fromUnitType )
inlinestaticprotected

Converts angle from provided unit type to radians

Parameters
[in]angleFrom
[in]fromUnitType
Returns

Definition at line 323 of file SCR_Math.c.

◆ DeltaAngle()

float SCR_Math::DeltaAngle ( float a,
float b )
inlinestaticprotected

Get shortest angle between two angles.

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

Definition at line 142 of file SCR_Math.c.

◆ FixAngle()

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

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

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

Definition at line 280 of file SCR_Math.c.

◆ fmod()

float SCR_Math::fmod ( float dividend,
float divisor )
inlinestaticprotected

Takes two floats and returns the remainder after division

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

Definition at line 114 of file SCR_Math.c.

◆ GetBatesDistributionRandom()

float SCR_Math::GetBatesDistributionRandom ( float min,
float mid,
float max )
inlinestaticprotected

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

Definition at line 242 of file SCR_Math.c.

◆ GetDistanceToStop()

float SCR_Math::GetDistanceToStop ( float speed,
float deceleration )
inlinestaticprotected

Get distance to stop with given deceleration

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

Definition at line 166 of file SCR_Math.c.

◆ GetGaussianDistributionRandom()

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

Definition at line 213 of file SCR_Math.c.

◆ GetMathRandomGenerator()

RandomGenerator SCR_Math::GetMathRandomGenerator ( )
inlinestaticprotected

Get the math random Generator

Returns
the one SCR_Math's random generator

Definition at line 270 of file SCR_Math.c.

◆ GetSpeedToReachDistance()

float SCR_Math::GetSpeedToReachDistance ( float distance,
float deceleration )
inlinestaticprotected

Get speed necessary to reach given distance with specified deceleration.

Parameters
[in]distance
[in]deceleration
Returns

Definition at line 182 of file SCR_Math.c.

◆ GetSpeedToReachDistanceInTime()

float SCR_Math::GetSpeedToReachDistanceInTime ( float distance,
float deceleration,
float time )
inlinestaticprotected

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

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

Definition at line 196 of file SCR_Math.c.

◆ IntegerMask()

int SCR_Math::IntegerMask ( int x)
inlinestaticprotected

Minimum mask that can cover a provided number

Parameters
[in]xPositive integer value
Returns
Minimum mask

Definition at line 151 of file SCR_Math.c.

◆ LerpAngle()

float SCR_Math::LerpAngle ( float a,
float b,
float t )
inlinestaticprotected

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

Definition at line 128 of file SCR_Math.c.

◆ RandomFloat()

float SCR_Math::RandomFloat ( float min,
float max )
inlinestaticprotected

Returns a random float number between min [inclusive] and max [exclusive]. Will run checks to make sure the values are valid for Math.RandomFloat, and fix them if not correct

Parameters
[in]minMinimum Value
[in]maxMaximum Value
Returns
Random float value

Definition at line 18 of file SCR_Math.c.

◆ RandomFloatInclusive()

float SCR_Math::RandomFloatInclusive ( float min,
float max )
inlinestaticprotected

Returns a random float number between min [inclusive] and max [inclusive]. Will run checks to make sure the values are valid for Math.RandomFloatInclusive, and fix them if not correct

Parameters
[in]minMinimum Value
[in]maxMaximum Value
Returns
Random float value

Definition at line 34 of file SCR_Math.c.

◆ RandomGaussFloat()

float SCR_Math::RandomGaussFloat ( float min,
float mid,
float max )
inlinestaticprotected

Returns random number with Gauss/Normal distribution (https://en.wikipedia.org/wiki/Normal_distribution)

Parameters
[in]minincluded
[in]midcan be outside min..max range
[in]maxincluded
Returns
a float in min..max range

Definition at line 50 of file SCR_Math.c.

◆ RandomInt()

int SCR_Math::RandomInt ( int min,
int max )
inlinestaticprotected

Returns a random int number between min [inclusive] and max [exclusive]. Will run checks to make sure the values are valid for Math.RandomInt, and fix them if not correct

Parameters
[in]minMinimum Value
[in]maxMaximum Value
Returns
Random int value

Definition at line 79 of file SCR_Math.c.

◆ RandomIntInclusive()

int SCR_Math::RandomIntInclusive ( int min,
int max )
inlinestaticprotected

Returns a random int number between min [inclusive] and max [inclusive]. Will run checks to make sure the values are valid for Math.RandomIntInclusive, and fix them if not correct

Parameters
[in]minMinimum Value
[in]maxMaximum Value
Returns
Random int value

Definition at line 95 of file SCR_Math.c.

Member Data Documentation

◆ MAX_RANDOM

const int SCR_Math::MAX_RANDOM = 0x7FFF
staticprotected

Definition at line 10 of file SCR_Math.c.

◆ MILS_NATO2DEG

const float SCR_Math::MILS_NATO2DEG = 0.05625
staticprotected

Definition at line 6 of file SCR_Math.c.

◆ MILS_STRECK2DEG

const float SCR_Math::MILS_STRECK2DEG = 0.05714
staticprotected

Definition at line 8 of file SCR_Math.c.

◆ MILS_WP2DEG

const float SCR_Math::MILS_WP2DEG = 0.06
staticprotected

Definition at line 7 of file SCR_Math.c.

◆ RANDOM_GENERATOR

const ref RandomGenerator SCR_Math::RANDOM_GENERATOR = new RandomGenerator()
staticprotected

Definition at line 4 of file SCR_Math.c.


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