Hatch Game Engine Documentation v1.4.0
The documentation for the Hatch Game Engine
Loading...
Searching...
No Matches
RSDK.Math Class Reference

RSDK math functions. More...

Public Member Functions

integer GetRandSeed ()
 Gets the engine's random seed value.
void SetRandSeed (integer key)
 Sets the engine's random seed value.
integer RandomInteger (integer min, integer max)
 Gets a random number between specified minimum integer and a specified maximum integer.
integer RandomIntegerSeeded (integer min, integer max, integer seed)
 Gets a random number between specified minimum integer and a specified maximum integer based off of a given seed.
void ClearTrigLookupTables ()
 Clears the engine's angle lookup tables.
void CalculateTrigAngles ()
 Sets the engine's angle lookup tables.
integer Sin1024 (integer angle)
 Returns the sine of an angle of x based on a max of 1024.
integer Cos1024 (integer angle)
 Returns the cosine of an angle of x based on a max of 1024.
integer Tan1024 (integer angle)
 Returns the tangent of an angle of x based on a max of 1024.
integer ASin1024 (integer angle)
 Returns the arc sine of an angle of x based on a max of 1024.
integer ACos1024 (integer angle)
 Returns the arc cosine of an angle of x based on a max of 1024.
integer Cos512 (integer angle)
 Returns the cosine of an angle of x based on a max of 512.
integer Tan512 (integer angle)
 Returns the tangent of an angle of x based on a max of 512.
integer ASin512 (integer angle)
 Returns the arc sine of an angle of x based on a max of 512.
integer ACos512 (integer angle)
 Returns the arc cosine of an angle of x based on a max of 512.
integer Cos256 (integer angle)
 Returns the cosine of an angle of x based on a max of 256.
integer Tan256 (integer angle)
 Returns the tangent of an angle of x based on a max of 256.
integer ASin256 (integer angle)
 Returns the arc sine of an angle of x based on a max of 256.
integer ACos256 (integer angle)
 Returns the arc cosine of an angle of x based on a max of 256.
integer ATan2 (decimal x, decimal y)
 Returns the arc tangent of a position.
integer RadianToInteger (decimal radian)
 Gets the integer conversion of a radian, based on 256.
decimal IntegerToRadian (integer integer)
 Gets the radian decimal conversion of an integer, based on 256.
integer ToFixed (number n)
 Converts a decimal number to its fixed-point equivalent.
decimal FromFixed (number n)
 Converts a fixed-point number to its decimal equivalent.

Detailed Description

RSDK math functions.

Member Function Documentation

◆ ACos1024()

integer RSDK.Math.ACos1024 ( integer angle)

Returns the arc cosine of an angle of x based on a max of 1024.

Parameters
angleAngle to get the arc cosine of.
Returns
The arc cosine 1024 of the angle.

◆ ACos256()

integer RSDK.Math.ACos256 ( integer angle)

Returns the arc cosine of an angle of x based on a max of 256.

Parameters
angleAngle to get the arc cosine of.
Returns
The arc cosine 256 of the angle.

◆ ACos512()

integer RSDK.Math.ACos512 ( integer angle)

Returns the arc cosine of an angle of x based on a max of 512.

Parameters
angleAngle to get the arc cosine of.
Returns
The arc cosine 512 of the angle.

◆ ASin1024()

integer RSDK.Math.ASin1024 ( integer angle)

Returns the arc sine of an angle of x based on a max of 1024.

Parameters
angleAngle to get the arc sine of.
Returns
The arc sine 1024 of the angle.

◆ ASin256()

integer RSDK.Math.ASin256 ( integer angle)

Returns the arc sine of an angle of x based on a max of 256.

Parameters
angleAngle to get the arc sine of.
Returns
The arc sine 256 of the angle.

◆ ASin512()

integer RSDK.Math.ASin512 ( integer angle)

Returns the arc sine of an angle of x based on a max of 512.

Parameters
angleAngle to get the arc sine of.
Returns
The arc sine 512 of the angle.

◆ ATan2()

integer RSDK.Math.ATan2 ( decimal x,
decimal y )

Returns the arc tangent of a position.

Parameters
xX value of the position.
yY value of the position.
Returns
The arc tangent of the position.

◆ Cos1024()

integer RSDK.Math.Cos1024 ( integer angle)

Returns the cosine of an angle of x based on a max of 1024.

Parameters
angleAngle to get the cosine of.
Returns
The cosine 1024 of the angle.

◆ Cos256()

integer RSDK.Math.Cos256 ( integer angle)

Returns the cosine of an angle of x based on a max of 256.

Parameters
angleAngle to get the cosine of.
Returns
The cosine 256 of the angle.

◆ Cos512()

integer RSDK.Math.Cos512 ( integer angle)

Returns the cosine of an angle of x based on a max of 512.

Parameters
angleAngle to get the cosine of.
Returns
The cosine 512 of the angle.

◆ FromFixed()

decimal RSDK.Math.FromFixed ( number n)

Converts a fixed-point number to its decimal equivalent.

Parameters
nNumber value.
Returns
Returns the converted decimal Number value.

◆ GetRandSeed()

integer RSDK.Math.GetRandSeed ( )

Gets the engine's random seed value.

Returns
Returns an integer of the engine's random seed value.

◆ IntegerToRadian()

decimal RSDK.Math.IntegerToRadian ( integer integer)

Gets the radian decimal conversion of an integer, based on 256.

Parameters
integerInteger value to convert.
Returns
A radian decimal value of the converted integer.

◆ RadianToInteger()

integer RSDK.Math.RadianToInteger ( decimal radian)

Gets the integer conversion of a radian, based on 256.

Parameters
radianRadian value to convert.
Returns
An integer value of the converted radian.

◆ RandomInteger()

integer RSDK.Math.RandomInteger ( integer min,
integer max )

Gets a random number between specified minimum integer and a specified maximum integer.

Parameters
minMinimum non-inclusive integer value.
maxMaximum non-inclusive integer value.
Returns
Returns the random number as an integer.

◆ RandomIntegerSeeded()

integer RSDK.Math.RandomIntegerSeeded ( integer min,
integer max,
integer seed )

Gets a random number between specified minimum integer and a specified maximum integer based off of a given seed.

Parameters
minMinimum non-inclusive integer value.
maxMaximum non-inclusive integer value.
seedSeed of which to base the number.
Returns
Returns the random number.

◆ SetRandSeed()

void RSDK.Math.SetRandSeed ( integer key)

Sets the engine's random seed value.

Parameters
keyValue to set the seed to.

◆ Sin1024()

integer RSDK.Math.Sin1024 ( integer angle)

Returns the sine of an angle of x based on a max of 1024.

Parameters
angleAngle to get the sine of.
Returns
The sine 1024 of the angle.

◆ Tan1024()

integer RSDK.Math.Tan1024 ( integer angle)

Returns the tangent of an angle of x based on a max of 1024.

Parameters
angleAngle to get the tangent of.
Returns
The tangent 1024 of the angle.

◆ Tan256()

integer RSDK.Math.Tan256 ( integer angle)

Returns the tangent of an angle of x based on a max of 256.

Parameters
angleAngle to get the tangent of.
Returns
The tangent 256 of the angle.

◆ Tan512()

integer RSDK.Math.Tan512 ( integer angle)

Returns the tangent of an angle of x based on a max of 512.

Parameters
angleAngle to get the tangent of.
Returns
The tangent 512 of the angle.

◆ ToFixed()

integer RSDK.Math.ToFixed ( number n)

Converts a decimal number to its fixed-point equivalent.

Parameters
nNumber value.
Returns
Returns the converted fixed-point Number value.