Trackmania ManiaScript Reference 2025.6.19.2137
A ManiaScript Reference of the new Trackmania.
Loading...
Searching...
No Matches
MathLib Namespace Reference

Standard mathematical operations, angles are in radians unless specified. More...

Functions

Integer Abs (Integer _Argument1)
 
Real Abs (Real _Argument1)
 
Real ToReal (Integer _Argument1)
 
Real DegToRad (Real _Degree)
 Converts an angle from degrees to radians.
 
Real RadToDeg (Real _Radian)
 Converts an angle from radians to degrees.
 
Real Sin (Real _Argument1)
 
Real Cos (Real _Argument1)
 
Real Tan (Real _Argument1)
 
Real Atan2 (Real _Argument1, Real _Argument2)
 
Real Exp (Real _Argument1)
 
Real Rand (Real _Argument1, Real _Argument2)
 
Real Rand (Real _Argument1, Real _Argument2, Integer _Argument3)
 
Integer Rand (Integer _Argument1, Integer _Argument2)
 
Integer Rand (Integer _Argument1, Integer _Argument2, Integer _Argument3)
 
Real NearestReal (Integer _Argument1)
 
Integer NearestInteger (Real _Argument1)
 
Integer FloorInteger (Real _Argument1)
 
Integer TruncInteger (Real _Argument1)
 
Integer CeilingInteger (Real _Argument1)
 
Real Distance (Real _Argument1, Real _Argument2)
 
Real Distance (Vec2 _Argument1, Vec2 _Argument2)
 Euclidian distance between two 2d points.
 
Real Distance (Vec3 _Argument1, Vec3 _Argument2)
 Euclidian distance between two 3d points.
 
Real Length (Vec2 _Argument1)
 Euclidian norm of the vector.
 
Real Length (Vec3 _Argument1)
 Euclidian norm of the vector.
 
Real Norm0 (Vec2 _Argument1)
 Returns maximum of the absolute value of each component.
 
Real Norm1 (Vec2 _Argument1)
 Returns the sum of the absolute value of each component.
 
Real Norm0 (Vec3 _Argument1)
 Returns maximum of the absolute value of each component.
 
Real Norm1 (Vec3 _Argument1)
 Returns the sum of the absolute value of each component.
 
Integer Norm0 (Int2 _Argument1)
 Returns maximum of the absolute value of each component.
 
Integer Norm1 (Int2 _Argument1)
 Returns the sum of the absolute value of each component.
 
Integer Norm0 (Int3 _Argument1)
 Returns maximum of the absolute value of each component.
 
Integer Norm1 (Int3 _Argument1)
 Returns the sum of the absolute value of each component.
 
Real DotProduct (Vec3 _Argument1, Vec3 _Argument2)
 
Vec3 CrossProduct (Vec3 _Argument1, Vec3 _Argument2)
 
Real DotProduct (Vec2 _Argument1, Vec2 _Argument2)
 
Integer DotProduct (Int3 _Argument1, Int3 _Argument2)
 
Int3 CrossProduct (Int3 _Argument1, Int3 _Argument2)
 
Integer DotProduct (Int2 _Argument1, Int2 _Argument2)
 
Real Angle (Vec3 _Argument1, Vec3 _Argument2)
 
Real OrientedAngle (Vec3 _Argument1, Vec3 _Argument2)
 
Real Angle (Real _Radian1, Real _Radian2)
 Returns the smallest angle from A to B.
 
Real Angle (Vec2 _Argument1, Vec2 _Argument2)
 
Real OrientedAngle (Vec2 _Argument1, Vec2 _Argument2)
 
Real PI ()
 
Real Asin (Real _Argument1)
 
Real Acos (Real _Argument1)
 
Real Pow (Real _Argument1, Real _Argument2)
 
Real Ln (Real _Argument1)
 
Real Sqrt (Real _Argument1)
 
Integer Max (Integer _A, Integer _B)
 Returns the maximum between A and B.
 
Integer Min (Integer _A, Integer _B)
 Returns the minimum between A and B.
 
Integer Clamp (Integer _X, Integer _Min, Integer _Max)
 Returns the value X clamped to the range Min..Max.
 
Real Max (Real _A, Real _B)
 Returns the maximum between A and B.
 
Real Min (Real _A, Real _B)
 Returns the minimum between A and B.
 
Real Clamp (Real _X, Real _Min, Real _Max)
 Returns the value X clamped to the range Min..Max.
 
Real Mod (Real _X, Real _Min, Real _Max)
 Returns the modulus of X in the range Min..Max.
 
Vec2 Max (Vec2 _A, Vec2 _B)
 Returns the maximum between A and B.
 
Vec2 Min (Vec2 _A, Vec2 _B)
 Returns the minimum between A and B.
 
Vec2 Clamp (Vec2 _X, Vec2 _Min, Vec2 _Max)
 Returns the value X clamped to the range Min..Max.
 
Vec3 Max (Vec3 _A, Vec3 _B)
 Returns the maximum between A and B.
 
Vec3 Min (Vec3 _A, Vec3 _B)
 Returns the minimum between A and B.
 
Vec3 Clamp (Vec3 _X, Vec3 _Min, Vec3 _Max)
 Returns the value X clamped to the range Min..Max.
 
Int2 Max (Int2 _A, Int2 _B)
 Returns the maximum between A and B.
 
Int2 Min (Int2 _A, Int2 _B)
 Returns the minimum between A and B.
 
Int2 Clamp (Int2 _X, Int2 _Min, Int2 _Max)
 Returns the value X clamped to the range Min..Max.
 
Int3 Max (Int3 _A, Int3 _B)
 Returns the maximum between A and B.
 
Int3 Min (Int3 _A, Int3 _B)
 Returns the minimum between A and B.
 
Int3 Clamp (Int3 _X, Int3 _Min, Int3 _Max)
 Returns the value X clamped to the range Min..Max.
 

Variables

const Real Pi = 3.14159
 
const Real Tau = 6.28319
 

Detailed Description

Standard mathematical operations, angles are in radians unless specified.

Function Documentation

◆ Abs() [1/2]

Integer MathLib::Abs ( Integer _Argument1)

◆ Abs() [2/2]

Real MathLib::Abs ( Real _Argument1)

◆ Acos()

Real MathLib::Acos ( Real _Argument1)

◆ Angle() [1/3]

Real MathLib::Angle ( Real _Radian1,
Real _Radian2 )

Returns the smallest angle from A to B.

◆ Angle() [2/3]

Real MathLib::Angle ( Vec2 _Argument1,
Vec2 _Argument2 )

◆ Angle() [3/3]

Real MathLib::Angle ( Vec3 _Argument1,
Vec3 _Argument2 )

◆ Asin()

Real MathLib::Asin ( Real _Argument1)

◆ Atan2()

Real MathLib::Atan2 ( Real _Argument1,
Real _Argument2 )

◆ CeilingInteger()

Integer MathLib::CeilingInteger ( Real _Argument1)

◆ Clamp() [1/6]

Int2 MathLib::Clamp ( Int2 _X,
Int2 _Min,
Int2 _Max )

Returns the value X clamped to the range Min..Max.

◆ Clamp() [2/6]

Int3 MathLib::Clamp ( Int3 _X,
Int3 _Min,
Int3 _Max )

Returns the value X clamped to the range Min..Max.

◆ Clamp() [3/6]

Integer MathLib::Clamp ( Integer _X,
Integer _Min,
Integer _Max )

Returns the value X clamped to the range Min..Max.

◆ Clamp() [4/6]

Real MathLib::Clamp ( Real _X,
Real _Min,
Real _Max )

Returns the value X clamped to the range Min..Max.

◆ Clamp() [5/6]

Vec2 MathLib::Clamp ( Vec2 _X,
Vec2 _Min,
Vec2 _Max )

Returns the value X clamped to the range Min..Max.

◆ Clamp() [6/6]

Vec3 MathLib::Clamp ( Vec3 _X,
Vec3 _Min,
Vec3 _Max )

Returns the value X clamped to the range Min..Max.

◆ Cos()

Real MathLib::Cos ( Real _Argument1)

◆ CrossProduct() [1/2]

Int3 MathLib::CrossProduct ( Int3 _Argument1,
Int3 _Argument2 )

◆ CrossProduct() [2/2]

Vec3 MathLib::CrossProduct ( Vec3 _Argument1,
Vec3 _Argument2 )

◆ DegToRad()

Real MathLib::DegToRad ( Real _Degree)

Converts an angle from degrees to radians.

◆ Distance() [1/3]

Real MathLib::Distance ( Real _Argument1,
Real _Argument2 )

◆ Distance() [2/3]

Real MathLib::Distance ( Vec2 _Argument1,
Vec2 _Argument2 )

Euclidian distance between two 2d points.

◆ Distance() [3/3]

Real MathLib::Distance ( Vec3 _Argument1,
Vec3 _Argument2 )

Euclidian distance between two 3d points.

◆ DotProduct() [1/4]

Integer MathLib::DotProduct ( Int2 _Argument1,
Int2 _Argument2 )

◆ DotProduct() [2/4]

Integer MathLib::DotProduct ( Int3 _Argument1,
Int3 _Argument2 )

◆ DotProduct() [3/4]

Real MathLib::DotProduct ( Vec2 _Argument1,
Vec2 _Argument2 )

◆ DotProduct() [4/4]

Real MathLib::DotProduct ( Vec3 _Argument1,
Vec3 _Argument2 )

◆ Exp()

Real MathLib::Exp ( Real _Argument1)

◆ FloorInteger()

Integer MathLib::FloorInteger ( Real _Argument1)

◆ Length() [1/2]

Real MathLib::Length ( Vec2 _Argument1)

Euclidian norm of the vector.

◆ Length() [2/2]

Real MathLib::Length ( Vec3 _Argument1)

Euclidian norm of the vector.

◆ Ln()

Real MathLib::Ln ( Real _Argument1)

◆ Max() [1/6]

Int2 MathLib::Max ( Int2 _A,
Int2 _B )

Returns the maximum between A and B.

◆ Max() [2/6]

Int3 MathLib::Max ( Int3 _A,
Int3 _B )

Returns the maximum between A and B.

◆ Max() [3/6]

Integer MathLib::Max ( Integer _A,
Integer _B )

Returns the maximum between A and B.

◆ Max() [4/6]

Real MathLib::Max ( Real _A,
Real _B )

Returns the maximum between A and B.

◆ Max() [5/6]

Vec2 MathLib::Max ( Vec2 _A,
Vec2 _B )

Returns the maximum between A and B.

◆ Max() [6/6]

Vec3 MathLib::Max ( Vec3 _A,
Vec3 _B )

Returns the maximum between A and B.

◆ Min() [1/6]

Int2 MathLib::Min ( Int2 _A,
Int2 _B )

Returns the minimum between A and B.

◆ Min() [2/6]

Int3 MathLib::Min ( Int3 _A,
Int3 _B )

Returns the minimum between A and B.

◆ Min() [3/6]

Integer MathLib::Min ( Integer _A,
Integer _B )

Returns the minimum between A and B.

◆ Min() [4/6]

Real MathLib::Min ( Real _A,
Real _B )

Returns the minimum between A and B.

◆ Min() [5/6]

Vec2 MathLib::Min ( Vec2 _A,
Vec2 _B )

Returns the minimum between A and B.

◆ Min() [6/6]

Vec3 MathLib::Min ( Vec3 _A,
Vec3 _B )

Returns the minimum between A and B.

◆ Mod()

Real MathLib::Mod ( Real _X,
Real _Min,
Real _Max )

Returns the modulus of X in the range Min..Max.

◆ NearestInteger()

Integer MathLib::NearestInteger ( Real _Argument1)

◆ NearestReal()

Real MathLib::NearestReal ( Integer _Argument1)

◆ Norm0() [1/4]

Integer MathLib::Norm0 ( Int2 _Argument1)

Returns maximum of the absolute value of each component.

◆ Norm0() [2/4]

Integer MathLib::Norm0 ( Int3 _Argument1)

Returns maximum of the absolute value of each component.

◆ Norm0() [3/4]

Real MathLib::Norm0 ( Vec2 _Argument1)

Returns maximum of the absolute value of each component.

◆ Norm0() [4/4]

Real MathLib::Norm0 ( Vec3 _Argument1)

Returns maximum of the absolute value of each component.

◆ Norm1() [1/4]

Integer MathLib::Norm1 ( Int2 _Argument1)

Returns the sum of the absolute value of each component.

◆ Norm1() [2/4]

Integer MathLib::Norm1 ( Int3 _Argument1)

Returns the sum of the absolute value of each component.

◆ Norm1() [3/4]

Real MathLib::Norm1 ( Vec2 _Argument1)

Returns the sum of the absolute value of each component.

◆ Norm1() [4/4]

Real MathLib::Norm1 ( Vec3 _Argument1)

Returns the sum of the absolute value of each component.

◆ OrientedAngle() [1/2]

Real MathLib::OrientedAngle ( Vec2 _Argument1,
Vec2 _Argument2 )

◆ OrientedAngle() [2/2]

Real MathLib::OrientedAngle ( Vec3 _Argument1,
Vec3 _Argument2 )

◆ PI()

Real MathLib::PI ( )

◆ Pow()

Real MathLib::Pow ( Real _Argument1,
Real _Argument2 )

◆ RadToDeg()

Real MathLib::RadToDeg ( Real _Radian)

Converts an angle from radians to degrees.

◆ Rand() [1/4]

Integer MathLib::Rand ( Integer _Argument1,
Integer _Argument2 )

◆ Rand() [2/4]

Integer MathLib::Rand ( Integer _Argument1,
Integer _Argument2,
Integer _Argument3 )

◆ Rand() [3/4]

Real MathLib::Rand ( Real _Argument1,
Real _Argument2 )

◆ Rand() [4/4]

Real MathLib::Rand ( Real _Argument1,
Real _Argument2,
Integer _Argument3 )

◆ Sin()

Real MathLib::Sin ( Real _Argument1)

◆ Sqrt()

Real MathLib::Sqrt ( Real _Argument1)

◆ Tan()

Real MathLib::Tan ( Real _Argument1)

◆ ToReal()

Real MathLib::ToReal ( Integer _Argument1)

◆ TruncInteger()

Integer MathLib::TruncInteger ( Real _Argument1)

Variable Documentation

◆ Pi

const Real MathLib::Pi = 3.14159

◆ Tau

const Real MathLib::Tau = 6.28319