Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Math Common Functions

Notice
Common C++ and C# math methods can be found in the Unigine Namespace class.

floatabs(float v)

Absolute value.

Arguments

• float v - The float value.

doubleabs(double v)

Absolute value.

Arguments

• double v - The doublevalue.

doubleclamp(double v, double v0, double v1)

Clamps the value within the specified min and max limits.

Arguments

• double v - The double value.
• double v0 - The minimum double value.
• double v1 - The maximum double value.

Return value

The clamped value.

floatclamp(float v, float v0, float v1)

Clamps the value within the specified min and max limits.

Arguments

• float v - The float value to be clamped.
• float v0 - The minimum float value.
• float v1 - The maximum float value.

Return value

The clamped value.

intclamp(int v, int v0, int v1)

Clamps the value within the specified min and max limits.

Arguments

• int v - The int value.
• int v0 - The minimum int value.
• int v1 - The maximum int value.

Return value

The clamped value.

intcompare(float v0, float v1)

Compares two scalars of the float type according to the degree of precision equal to 1.0e-6f.

Arguments

• float v0 - The first float scalar.
• float v1 - The second float scalar.

Return value

1 if the v0 is equal to v1; otherwise, 0.

intcompare(double v0, double v1)

Compares two scalars of the double type according to the degree of precision equal to 1.0e-6f.

Arguments

• double v0 - The first double scalar.
• double v1 - The second double scalar.

Return value

1 if the v0 is equal to v1; otherwise, 0.

intcompare(float v0, float v1, float epsilon)

Compares two scalars of the float type according to the specified degree of precision.

Arguments

• float v0 - The first scalar.
• float v1 - The second scalar.
• float epsilon - The epsilon (degree of precision).

Return value

1 if the v0 is equal to v1; otherwise, 0.

intcompare(double v0, double v1, double epsilon)

Compares two scalars of the double type according to the specified degree of precision.

Arguments

• double v0 - The first scalar.
• double v1 - The second scalar.
• double epsilon - The epsilon (degree of precision).

Return value

1 if the v0 is equal to v1; otherwise, 0.

ivec3cross(const ivec3 & v0, const ivec3 & v1)

Cross product of vectors.

Arguments

• const ivec3 & v0 - The value of the first vector.
• const ivec3 & v1 - The value of the second vector.

Return value

The resulting vector.

dvec3cross(const dvec3 & v0, const dvec3 & v1)

Cross product of vectors.

Arguments

• const dvec3 & v0 - The value of the first vector.
• const dvec3 & v1 - The value of the second vector.

Return value

The resulting vector.

vec3cross(const vec3 & v0, const vec3 & v1)

Cross product of vectors.

Arguments

• const vec3 & v0 - The value of the first vector.
• const vec3 & v1 - The value of the second vector.

Return value

The resulting vector.

floatdot(const vec3 & v0, const vec4 & v1)

Dot product of vectors.

Arguments

• const vec3 & v0 - The value of the first vector.
• const vec4 & v1 - The value of the second vector.

Return value

The resulting scalar.

floatdot(const vec4 & v0, const vec3 & v1)

Dot product of vectors.

Arguments

• const vec4 & v0 - The value of the first vector.
• const vec3 & v1 - The value of the second vector.

Return value

The resulting scalar.

floatdot(const vec4 & v0, const vec4 & v1)

Dot product of vectors.

Arguments

• const vec4 & v0 - The value of the first vector.
• const vec4 & v1 - The value of the second vector.

Return value

The resulting scalar.

floatdot(const vec3 & v0, const vec3 & v1)

Dot product of vectors.

Arguments

• const vec3 & v0 - The value of the first vector.
• const vec3 & v1 - The value of the second vector.

Return value

The resulting scalar.

floatdot(const vec2 & v0, const vec2 & v1)

Dot product of vectors.

Arguments

• const vec2 & v0 - The value of the first vector.
• const vec2 & v1 - The value of the second vector.

Return value

The resulting scalar.

intdot(const ivec3 & v0, const ivec3 & v1)

Dot product of vectors.

Arguments

• const ivec3 & v0 - The value of the first vector.
• const ivec3 & v1 - The value of the second vector.

Return value

The resulting scalar.

intdot(const ivec2 & v0, const ivec2 & v1)

Dot product of vectors.

Arguments

• const ivec2 & v0 - The value of the first vector.
• const ivec2 & v1 - The value of the second vector.

Return value

The resulting scalar.

intdot(const ivec4 & v0, const ivec3 & v1)

Dot product of vectors.

Arguments

• const ivec4 & v0 - The value of the first vector.
• const ivec3 & v1 - The value of the second vector.

Return value

The resulting scalar.

intdot(const ivec4 & v0, const ivec4 & v1)

Dot product of vectors.

Arguments

• const ivec4 & v0 - The value of the first vector.
• const ivec4 & v1 - The value of the second vector.

Return value

The resulting scalar.

doubledot(const dvec3 & v0, const dvec3 & v1)

Dot product of vectors.

Arguments

• const dvec3 & v0 - The value of the first vector.
• const dvec3 & v1 - The value of the second vector.

Return value

The resulting scalar.

doubledot(const dvec3 & v0, const dvec4 & v1)

Dot product of vectors.

Arguments

• const dvec3 & v0 - The value of the first vector.
• const dvec4 & v1 - The value of the second vector.

Return value

The resulting scalar.

doubledot(const dvec4 & v0, const dvec3 & v1)

Dot product of vectors.

Arguments

• const dvec4 & v0 - The value of the first vector.
• const dvec3 & v1 - The value of the second vector.

Return value

The resulting scalar.

doubledot(const dvec4 & v0, const dvec4 & v1)

Dot product of vectors.

Arguments

• const dvec4 & v0 - The value of the first vector.
• const dvec4 & v1 - The value of the second vector.

Return value

The resulting scalar.

floatlerp(float v0, float v1, float k)

Returns the interpolated value.

Arguments

• float v0 - The first float value.
• float v1 - The second float value.
• float k - Interpolation coefficient.

Return value

The interpolated value.

doublelerp(double v0, double v1, double k)

Returns the interpolated value.

Arguments

• double v0 - The first double value.
• double v1 - The second double value.
• double k - Interpolation coefficient.

Return value

The interpolated value.

intlerp(int v0, int v1, int k)

Returns the interpolated value.

Arguments

• int v0 - The first int value.
• int v1 - The second int value.
• int k - Interpolation coefficient.

Return value

The interpolated value.

vec2lerp(const vec2 & v0, const vec2 & v1, float k)

Returns the interpolated value.

Arguments

• const vec2 & v0 - The first value.
• const vec2 & v1 - The second value.
• float k - Interpolation coefficient.

Return value

The interpolated value.

vec3lerp(const vec3 & v0, const vec3 & v1, float k)

Returns the interpolated value.

Arguments

• const vec3 & v0 - The first value.
• const vec3 & v1 - The second value.
• float k - Interpolation coefficient.

Return value

The interpolated value.

vec4lerp(const vec4 & v0, const vec4 & v1, float k)

Returns the interpolated value.

Arguments

• const vec4 & v0 - The first value.
• const vec4 & v1 - The second value.
• float k - Interpolation coefficient.

Return value

The interpolated value.

dvec2lerp(const dvec2 & v0, const dvec2 & v1, double k)

Returns the interpolated value.

Arguments

• const dvec2 & v0 - The first value.
• const dvec2 & v1 - The second value.
• double k - Interpolation coefficient.

Return value

The interpolated value.

dvec3lerp(const dvec3 & v0, const dvec3 & v1, double k)

Returns the interpolated value.

Arguments

• const dvec3 & v0 - The first value.
• const dvec3 & v1 - The second value.
• double k - Interpolation coefficient.

Return value

The interpolated value.

dvec4lerp(const dvec4 & v0, const dvec4 & v1, double k)

Returns the interpolated value.

Arguments

• const dvec4 & v0 - The first value.
• const dvec4 & v1 - The second value.
• double k - Interpolation coefficient.

Return value

The interpolated value.

ivec2lerp(const ivec2 & v0, const ivec2 & v1, int k)

Returns the interpolated value.

Arguments

• const ivec2 & v0 - The first value.
• const ivec2 & v1 - The second value.
• int k - Interpolation coefficient.

Return value

The interpolated value.

ivec3lerp(const ivec3 & v0, const ivec3 & v1, int k)

Returns the interpolated value.

Arguments

• const ivec3 & v0 - The first value.
• const ivec3 & v1 - The second value.
• int k - Interpolation coefficient.

Return value

The interpolated value.

ivec4lerp(const ivec4 & v0, const ivec4 & v1, int k)

Returns the interpolated value.

Arguments

• const ivec4 & v0 - The first value.
• const ivec4 & v1 - The second value.
• int k - Interpolation coefficient.

Return value

The interpolated value.

Typelerp(Type v0, Type v1, Type k)

Returns the interpolated value.

Arguments

• Type v0 - The first value.
• Type v1 - The second value.
• Type k - Interpolation coefficient.

Return value

The interpolated value.

floatmax(float v0, float v1)

Returns the maximum float value.

Arguments

• float v0 - The first float value.
• float v1 - The second float value.

Return value

The maximum value.

doublemax(double v0, double v1)

Returns the maximum double value.

Arguments

• double v0 - The first double value.
• double v1 - The second double value.

Return value

The maximum value.

intmax(int v0, int v1)

Returns the maximum int value.

Arguments

• int v0 - The first int value.
• int v1 - The second int value.

Return value

The maximum value.

vec2max(const vec2 & v0, const vec2 & v1)

Returns the maximum value.

Arguments

• const vec2 & v0 - The first value.
• const vec2 & v1 - The second value.

Return value

The maximum value.

vec3max(const vec3 & v0, const vec3 & v1)

Returns the maximum value.

Arguments

• const vec3 & v0 - The first value.
• const vec3 & v1 - The second value.

Return value

The maximum value.

vec4max(const vec4 & v0, const vec4 & v1)

Returns the maximum value.

Arguments

• const vec4 & v0 - The first value.
• const vec4 & v1 - The second value.

Return value

The maximum value.

dvec2max(const dvec2 & v0, const dvec2 & v1)

Returns the maximum value.

Arguments

• const dvec2 & v0 - The first value.
• const dvec2 & v1 - The second value.

Return value

The maximum value.

dvec3max(const dvec3 & v0, const dvec3 & v1)

Returns the maximum value.

Arguments

• const dvec3 & v0 - The first value.
• const dvec3 & v1 - The second value.

Return value

The maximum value.

dvec4max(const dvec4 & v0, const dvec4 & v1)

Returns the maximum value.

Arguments

• const dvec4 & v0 - The first value.
• const dvec4 & v1 - The second value.

Return value

The maximum value.

ivec2max(const ivec2 & v0, const ivec2 & v1)

Returns the maximum value.

Arguments

• const ivec2 & v0 - The first value.
• const ivec2 & v1 - The second value.

Return value

The maximum value.

ivec3max(const ivec3 & v0, const ivec3 & v1)

Returns the maximum value.

Arguments

• const ivec3 & v0 - The first value.
• const ivec3 & v1 - The second value.

Return value

The maximum value.

ivec4max(const ivec4 & v0, const ivec4 & v1)

Returns the maximum value.

Arguments

• const ivec4 & v0 - The first value.
• const ivec4 & v1 - The second value.

Return value

The maximum value.

bvec4max(const bvec4 & v0, const bvec4 & v1)

Returns the maximum value.

Arguments

• const bvec4 & v0 - The first value.
• const bvec4 & v1 - The second value.

Return value

The maximum value.

Typemax(Type v0, Type v1)

Returns the maximum value.

Arguments

• Type v0 - The first value.
• Type v1 - The second value.

Return value

The maximum value.

floatmin(float v0, float v1)

Returns the minimum float value.

Arguments

• float v0 - The first float value.
• float v1 - The second float value.

Return value

The minimum value.

doublemin(double v0, double v1)

Returns the minimum double value.

Arguments

• double v0 - The first double value.
• double v1 - The second double value.

Return value

The minimum value.

intmin(int v0, int v1)

Returns the minimum int value.

Arguments

• int v0 - The first int value.
• int v1 - The second int value.

Return value

The minimum value.

vec2min(const vec2 & v0, const vec2 & v1)

Returns the minimum value.

Arguments

• const vec2 & v0 - The first value.
• const vec2 & v1 - The second value.

Return value

The minimum value.

vec3min(const vec3 & v0, const vec3 & v1)

Returns the minimum value.

Arguments

• const vec3 & v0 - The first value.
• const vec3 & v1 - The second value.

Return value

The minimum value.

vec4min(const vec4 & v0, const vec4 & v1)

Returns the minimum value.

Arguments

• const vec4 & v0 - The first value.
• const vec4 & v1 - The second value.

Return value

The minimum value.

dvec2min(const dvec2 & v0, const dvec2 & v1)

Returns the minimum value.

Arguments

• const dvec2 & v0 - The first value.
• const dvec2 & v1 - The second value.

Return value

The minimum value.

dvec3min(const dvec3 & v0, const dvec3 & v1)

Returns the minimum value.

Arguments

• const dvec3 & v0 - The first value.
• const dvec3 & v1 - The second value.

Return value

The minimum value.

dvec4min(const dvec4 & v0, const dvec4 & v1)

Returns the minimum value.

Arguments

• const dvec4 & v0 - The first value.
• const dvec4 & v1 - The second value.

Return value

The minimum value.

ivec2min(const ivec2 & v0, const ivec2 & v1)

Returns the minimum value.

Arguments

• const ivec2 & v0 - The first value.
• const ivec2 & v1 - The second value.

Return value

The minimum value.

ivec3min(const ivec3 & v0, const ivec3 & v1)

Returns the minimum value.

Arguments

• const ivec3 & v0 - The first value.
• const ivec3 & v1 - The second value.

Return value

The minimum value.

ivec4min(const ivec4 & v0, const ivec4 & v1)

Returns the minimum value.

Arguments

• const ivec4 & v0 - The first value.
• const ivec4 & v1 - The second value.

Return value

The minimum value.

bvec4min(const bvec4 & v0, const bvec4 & v1)

Returns the minimum value.

Arguments

• const bvec4 & v0 - The first value.
• const bvec4 & v1 - The second value.

Return value

The minimum value.

Typemin(Type v0, Type v1)

Returns the minimum value.

Arguments

• Type v0 - The first value.
• Type v1 - The second value.

Return value

The minimum value.

intoperator==(const ControlsPtr & c0, const ControlsPtr & c1, g0, g1, i0, i1, m0, m1, m0, m1, p0, p1, m0, m1, s0, s1, s0, s1, t0, t1, t0, t1, ui0, ui1, w0, w1, x0, x1)

Checks if two controls are actually the same controls.

Arguments

• const ControlsPtr & c0 - The first control.
• const ControlsPtr & c1 - The second control.

Return value

Returns 1 if two values are the same; otherwise, 0.

intoperator!=(const ControlsPtr & c0, const ControlsPtr & c1, g0, g1, i0, i1, m0, m1, m0, m1, p0, p1, m0, m1, s0, s1, s0, s1, t0, t1, t0, t1, ui0, ui1, w0, w1, x0, x1)

Checks if two controls are not the same controls.

Arguments

• const ControlsPtr & c0 - The first control.
• const ControlsPtr & c1 - The second control.

Return value

Returns 1 if two values are not the same; otherwise, 0.

intoperator==(const vec2 & v0, const vec2 & v1)

Vector equal comparison.

Arguments

• const vec2 & v0 - The first vector.
• const vec2 & v1 - The second vector.

intoperator!=(const vec2 & v0, const vec2 & v1)

Vector not equal comparison.

Arguments

• const vec2 & v0 - The first vector.
• const vec2 & v1 - The second vector.

vec2operator*(const vec2 & v0, float v1)

Scalar multiplication.

Arguments

• const vec2 & v0 - The value of the vector.
• float v1 - The value of the scalar.

Return value

The resulting vector.

vec2operator*(const vec2 & v0, const vec2 & v1)

Vector multiplication.

Arguments

• const vec2 & v0 - The value of the first vector.
• const vec2 & v1 - The value of the second vector.

Return value

The resulting vector.

vec2operator+(const vec2 & v0, const vec2 & v1)

Arguments

• const vec2 & v0 - The value of the first vector.
• const vec2 & v1 - The value of the second vector.

Return value

The resulting vector.

vec2operator-(const vec2 & v0, const vec2 & v1)

Vector subtraction.

Arguments

• const vec2 & v0 - The value of the first vector.
• const vec2 & v1 - The value of the second vector.

Return value

The resulting vector.

vec2clamp(const vec2 & v, const vec2 & v0, const vec2 & v1)

Clamps the value.

Arguments

• const vec2 & v - The value.
• const vec2 & v0 - The minimum value.
• const vec2 & v1 - The maximum value.

Return value

The clamped value.

intoperator==(const vec3 & v0, const vec3 & v1)

Vector equal comparison.

Arguments

• const vec3 & v0 - The first vector.
• const vec3 & v1 - The second vector.

intoperator!=(const vec3 & v0, const vec3 & v1)

Vector not equal comparison.

Arguments

• const vec3 & v0 - The first vector.
• const vec3 & v1 - The second vector.

vec3operator*(const vec3 & v0, float v1)

Scalar multiplication.

Arguments

• const vec3 & v0 - The value of the vector.
• float v1 - The value of the scalar.

Return value

The resulting vector.

vec3operator*(const vec3 & v0, const vec3 & v1)

Vector multiplication.

Arguments

• const vec3 & v0 - The value of the first vector.
• const vec3 & v1 - The value of the second vector.

Return value

The resulting vector.

vec3operator+(const vec3 & v0, const vec3 & v1)

Arguments

• const vec3 & v0 - The value of the first vector.
• const vec3 & v1 - The value of the second vector.

Return value

The resulting vector.

vec3operator-(const vec3 & v0, const vec3 & v1)

Vector subtraction.

Arguments

• const vec3 & v0 - The value of the first vector.
• const vec3 & v1 - The value of the second vector.

Return value

The resulting vector.

vec3clamp(const vec3 & v, const vec3 & v0, const vec3 & v1)

Clamps the value.

Arguments

• const vec3 & v - The value.
• const vec3 & v0 - The minimum value.
• const vec3 & v1 - The maximum value.

Return value

The clamped value.

intoperator==(const vec4 & v0, const vec4 & v1)

Vector equal comparison.

Arguments

• const vec4 & v0 - The first vector.
• const vec4 & v1 - The second vector.

intoperator!=(const vec4 & v0, const vec4 & v1)

Vector not equal comparison.

Arguments

• const vec4 & v0 - The first vector.
• const vec4 & v1 - The second vector.

vec4operator*(const vec4 & v0, float v1)

Scalar multiplication.

Arguments

• const vec4 & v0 - The value of the vector.
• float v1 - The value of the scalar.

Return value

The resulting vector.

vec4operator*(const vec4 & v0, const vec4 & v1)

Vector multiplication.

Arguments

• const vec4 & v0 - The value of the first vector.
• const vec4 & v1 - The value of the second vector.

Return value

The resulting vector.

vec4operator+(const vec4 & v0, const vec4 & v1)

Arguments

• const vec4 & v0 - The value of the first vector.
• const vec4 & v1 - The value of the second vector.

Return value

The resulting vector.

vec4operator-(const vec4 & v0, const vec4 & v1)

Vector subtraction.

Arguments

• const vec4 & v0 - The value of the first vector.
• const vec4 & v1 - The value of the second vector.

Return value

The resulting vector.

vec4clamp(const vec4 & v, const vec4 & v0, const vec4 & v1)

Clamps the value.

Arguments

• const vec4 & v - The value.
• const vec4 & v0 - The minimum value.
• const vec4 & v1 - The maximum value.

Return value

The clamped value.

intoperator==(const dvec2 & v0, const dvec2 & v1)

Vector equal comparison.

Arguments

• const dvec2 & v0 - The first vector.
• const dvec2 & v1 - The second vector.

intoperator!=(const dvec2 & v0, const dvec2 & v1)

Vector not equal comparison.

Arguments

• const dvec2 & v0 - The first vector.
• const dvec2 & v1 - The second vector.

dvec2operator*(const dvec2 & v0, double v1)

Scalar multiplication.

Arguments

• const dvec2 & v0 - The value of the vector.
• double v1 - The value of the scalar.

Return value

The resulting vector.

dvec2operator*(const dvec2 & v0, const dvec2 & v1)

Vector multiplication.

Arguments

• const dvec2 & v0 - The value of the first vector.
• const dvec2 & v1 - The value of the second vector.

Return value

The resulting vector.

dvec2operator+(const dvec2 & v0, const dvec2 & v1)

Arguments

• const dvec2 & v0 - The value of the first vector.
• const dvec2 & v1 - The value of the second vector.

Return value

The resulting vector.

dvec2operator-(const dvec2 & v0, const dvec2 & v1)

Vector subtraction.

Arguments

• const dvec2 & v0 - The value of the first vector.
• const dvec2 & v1 - The value of the second vector.

Return value

The resulting vector.

doubledot(const dvec2 & v0, const dvec2 & v1)

Dot product of vectors.

Arguments

• const dvec2 & v0 - The value of the first vector.
• const dvec2 & v1 - The value of the second vector.

Return value

The resulting scalar.

dvec2clamp(const dvec2 & v, const dvec2 & v0, const dvec2 & v1)

Clamps the value.

Arguments

• const dvec2 & v - The value.
• const dvec2 & v0 - The minimum value.
• const dvec2 & v1 - The maximum value.

Return value

The clamped value.

intoperator==(const dvec3 & v0, const dvec3 & v1)

Vector equal comparison.

Arguments

• const dvec3 & v0 - The first vector.
• const dvec3 & v1 - The second vector.

intoperator!=(const dvec3 & v0, const dvec3 & v1)

Vector not equal comparison.

Arguments

• const dvec3 & v0 - The first vector.
• const dvec3 & v1 - The second vector.

dvec3operator*(const dvec3 & v0, double v1)

Scalar multiplication.

Arguments

• const dvec3 & v0 - The value of the vector.
• double v1 - The value of the scalar.

Return value

The resulting vector.

dvec3operator*(const dvec3 & v0, const dvec3 & v1)

Vector multiplication.

Arguments

• const dvec3 & v0 - The value of the first vector.
• const dvec3 & v1 - The value of the second vector.

Return value

The resulting vector.

dvec3operator+(const dvec3 & v0, const dvec3 & v1)

Arguments

• const dvec3 & v0 - The value of the first vector.
• const dvec3 & v1 - The value of the second vector.

Return value

The resulting vector.

dvec3operator-(const dvec3 & v0, const dvec3 & v1)

Vector subtraction.

Arguments

• const dvec3 & v0 - The value of the first vector.
• const dvec3 & v1 - The value of the second vector.

Return value

The resulting vector.

dvec3clamp(const dvec3 & v, const dvec3 & v0, const dvec3 & v1)

Clamps the value.

Arguments

• const dvec3 & v - The value.
• const dvec3 & v0 - The minimum value.
• const dvec3 & v1 - The maximum value.

Return value

The clamped value.

intoperator==(const dvec4 & v0, const dvec4 & v1)

Vector equal comparison.

Arguments

• const dvec4 & v0 - The first vector.
• const dvec4 & v1 - The second vector.

intoperator!=(const dvec4 & v0, const dvec4 & v1)

Vector not equal comparison.

Arguments

• const dvec4 & v0 - The first vector.
• const dvec4 & v1 - The second vector.

dvec4operator*(const dvec4 & v0, double v1)

Scalar multiplication.

Arguments

• const dvec4 & v0 - The value of the vector.
• double v1 - The value of the scalar.

Return value

The resulting vector.

dvec4operator*(const dvec4 & v0, const dvec4 & v1)

Vector multiplication.

Arguments

• const dvec4 & v0 - The value of the first vector.
• const dvec4 & v1 - The value of the second vector.

Return value

The resulting vector.

dvec4operator+(const dvec4 & v0, const dvec4 & v1)

Arguments

• const dvec4 & v0 - The value of the first vector.
• const dvec4 & v1 - The value of the second vector.

Return value

The resulting vector.

dvec4operator-(const dvec4 & v0, const dvec4 & v1)

Vector subtraction.

Arguments

• const dvec4 & v0 - The value of the first vector.
• const dvec4 & v1 - The value of the second vector.

Return value

The resulting vector.

dvec4clamp(const dvec4 & v, const dvec4 & v0, const dvec4 & v1)

Clamps the value.

Arguments

• const dvec4 & v - The value.
• const dvec4 & v0 - The minimum value.
• const dvec4 & v1 - The maximum value.

Return value

The clamped value.

intoperator==(const ivec2 & v0, const ivec2 & v1)

Vector equal comparison.

Arguments

• const ivec2 & v0 - The first vector.
• const ivec2 & v1 - The second vector.

intoperator!=(const ivec2 & v0, const ivec2 & v1)

Vector not equal comparison.

Arguments

• const ivec2 & v0 - The first vector.
• const ivec2 & v1 - The second vector.

ivec2operator*(const ivec2 & v0, int v1)

Scalar multiplication.

Arguments

• const ivec2 & v0 - The value of the vector.
• int v1 - The value of the scalar.

Return value

The resulting vector.

ivec2operator*(const ivec2 & v0, const ivec2 & v1)

Vector multiplication.

Arguments

• const ivec2 & v0 - The value of the first vector.
• const ivec2 & v1 - The value of the second vector.

Return value

The resulting vector.

ivec2operator/(const ivec2 & v0, int v1)

Scalar division.

Arguments

• const ivec2 & v0 - The value of the vector.
• int v1 - The value of the scalar.

Return value

The resulting vector.

ivec2operator/(const ivec2 & v0, const ivec2 & v1)

Vector division.

Arguments

• const ivec2 & v0 - The value of the first vector.
• const ivec2 & v1 - The value of the second vector.

Return value

The resulting vector.

ivec2operator+(const ivec2 & v0, const ivec2 & v1)

Arguments

• const ivec2 & v0 - The value of the first vector.
• const ivec2 & v1 - The value of the second vector.

Return value

The resulting vector.

ivec2operator-(const ivec2 & v0, const ivec2 & v1)

Vector subtraction.

Arguments

• const ivec2 & v0 - The value of the first vector.
• const ivec2 & v1 - The value of the second vector.

Return value

The resulting vector.

ivec2operator<<(const ivec2 & v0, int v1)

Left bit shift.

Arguments

• const ivec2 & v0 - The value of the vector.
• int v1 - The shift amount.

Return value

The resulting vector.

ivec2operator>>(const ivec2 & v0, int v1)

Right bit shift.

Arguments

• const ivec2 & v0 - The value of the vector.
• int v1 - The shift amount.

Return value

The resulting vector.

ivec2clamp(const ivec2 & v, const ivec2 & v0, const ivec2 & v1)

Clamps the value.

Arguments

• const ivec2 & v - The value.
• const ivec2 & v0 - The minimum value.
• const ivec2 & v1 - The maximum value.

Return value

The clamped value.

intoperator==(const ivec3 & v0, const ivec3 & v1)

Vector equal comparison.

Arguments

• const ivec3 & v0 - The first vector.
• const ivec3 & v1 - The second vector.

intoperator!=(const ivec3 & v0, const ivec3 & v1)

Vector not equal comparison.

Arguments

• const ivec3 & v0 - The first vector.
• const ivec3 & v1 - The second vector.

ivec3operator*(const ivec3 & v0, int v1)

Scalar multiplication.

Arguments

• const ivec3 & v0 - The value of the vector.
• int v1 - The value of the scalar.

Return value

The resulting vector.

ivec3operator*(const ivec3 & v0, const ivec3 & v1)

Vector multiplication.

Arguments

• const ivec3 & v0 - The value of the first vector.
• const ivec3 & v1 - The value of the second vector.

Return value

The resulting vector.

ivec3operator/(const ivec3 & v0, int v1)

Scalar division.

Arguments

• const ivec3 & v0 - The value of the vector.
• int v1 - The value of the scalar.

Return value

The resulting vector.

ivec3operator/(const ivec3 & v0, const ivec3 & v1)

Vector division.

Arguments

• const ivec3 & v0 - The value of the first vector.
• const ivec3 & v1 - The value of the second vector.

Return value

The resulting vector.

ivec3operator+(const ivec3 & v0, const ivec3 & v1)

Arguments

• const ivec3 & v0 - The value of the first vector.
• const ivec3 & v1 - The value of the second vector.

Return value

The resulting vector.

ivec3operator-(const ivec3 & v0, const ivec3 & v1)

Vector subtraction.

Arguments

• const ivec3 & v0 - The value of the first vector.
• const ivec3 & v1 - The value of the second vector.

Return value

The resulting vector.

ivec3operator<<(const ivec3 & v0, int v1)

Left bit shift.

Arguments

• const ivec3 & v0 - The value of the vector.
• int v1 - The shift amount.

Return value

The resulting vector.

ivec3operator>>(const ivec3 & v0, int v1)

Right bit shift.

Arguments

• const ivec3 & v0 - The value of the vector.
• int v1 - The shift amount.

Return value

The resulting vector.

ivec3clamp(const ivec3 & v, const ivec3 & v0, const ivec3 & v1)

Clamps the value.

Arguments

• const ivec3 & v - The value.
• const ivec3 & v0 - The minimum value.
• const ivec3 & v1 - The maximum value.

Return value

The clamped value.

intoperator==(const ivec4 & v0, const ivec4 & v1)

Vector equal comparison.

Arguments

• const ivec4 & v0 - The first vector.
• const ivec4 & v1 - The second vector.

intoperator!=(const ivec4 & v0, const ivec4 & v1)

Vector not equal comparison.

Arguments

• const ivec4 & v0 - The first vector.
• const ivec4 & v1 - The second vector.

ivec4operator*(const ivec4 & v0, int v1)

Scalar multiplication.

Arguments

• const ivec4 & v0 - The value of the vector.
• int v1 - The value of the scalar.

Return value

The resulting vector.

ivec4operator*(const ivec4 & v0, const ivec4 & v1)

Vector multiplication.

Arguments

• const ivec4 & v0 - The value of the first vector.
• const ivec4 & v1 - The value of the second vector.

Return value

The resulting vector.

ivec4operator/(const ivec4 & v0, int v1)

Scalar division.

Arguments

• const ivec4 & v0 - The value of the vector.
• int v1 - The value of the scalar.

Return value

The resulting vector.

ivec4operator/(const ivec4 & v0, const ivec4 & v1)

Vector division.

Arguments

• const ivec4 & v0 - The value of the first vector.
• const ivec4 & v1 - The value of the second vector.

Return value

The resulting vector.

ivec4operator+(const ivec4 & v0, const ivec4 & v1)

Arguments

• const ivec4 & v0 - The value of the first vector.
• const ivec4 & v1 - The value of the second vector.

Return value

The resulting vector.

ivec4operator-(const ivec4 & v0, const ivec4 & v1)

Vector subtraction.

Arguments

• const ivec4 & v0 - The value of the first vector.
• const ivec4 & v1 - The value of the second vector.

Return value

The resulting vector.

ivec4operator<<(const ivec4 & v0, int v1)

Left bit shift.

Arguments

• const ivec4 & v0 - The value of the vector.
• int v1 - The shift amount.

Return value

The resulting vector.

ivec4operator>>(const ivec4 & v0, int v1)

Right bit shift.

Arguments

• const ivec4 & v0 - The value of the vector.
• int v1 - The shift amount.

Return value

The resulting vector.

ivec4clamp(const ivec4 & v, const ivec4 & v0, const ivec4 & v1)

Clamps the value.

Arguments

• const ivec4 & v - The value.
• const ivec4 & v0 - The minimum value.
• const ivec4 & v1 - The maximum value.

Return value

The clamped value.

intoperator==(const bvec4 & v0, const bvec4 & v1)

Vector equal comparison.

Arguments

• const bvec4 & v0 - The first vector.
• const bvec4 & v1 - The second vector.

intoperator!=(const bvec4 & v0, const bvec4 & v1)

Vector not equal comparison.

Arguments

• const bvec4 & v0 - The first vector.
• const bvec4 & v1 - The second vector.

bvec4clamp(const bvec4 & v, const bvec4 & v0, const bvec4 & v1)

Clamps the value.

Arguments

• const bvec4 & v - The value.
• const bvec4 & v0 - The minimum value.
• const bvec4 & v1 - The maximum value.

Return value

The clamped value.

intoperator==(const mat4 & m0, const mat4 & m1)

Matrix equal comparison.

Arguments

• const mat4 & m0 - The first matrix.
• const mat4 & m1 - The second matrix.

intoperator!=(const mat4 & m0, const mat4 & m1)

Matrix not equal comparison.

Arguments

• const mat4 & m0 - The first matrix.
• const mat4 & m1 - The second matrix.

mat4operator*(const mat4 & m, const float v)

Matrix multiplication.

Arguments

• const mat4 & m - The value of the matrix.
• const float v - The value of the scalar.

Return value

The resulting matrix.

vec3operator*(const mat4 & m, const vec3 & v)

Vector multiplication.

Arguments

• const mat4 & m - The value of the matrix.
• const vec3 & v - The value of the vector.

Return value

The resulting vector.

vec3operator*(const vec3 & v, const mat4 & m)

Vector multiplication.

Arguments

• const vec3 & v - The value of the vector.
• const mat4 & m - The value of the matrix.

Return value

The resulting vector.

vec4operator*(const mat4 & m, const vec4 & v)

Vector multiplication.

Arguments

• const mat4 & m - The value of the matrix.
• const vec4 & v - The value of the vector.

Return value

The resulting vector.

vec4operator*(const vec4 & v, const mat4 & m)

Vector multiplication.

Arguments

• const vec4 & v - The value of the vector.
• const mat4 & m - The value of the matrix.

Return value

The resulting vector.

dvec3operator*(const mat4 & m, const dvec3 & v)

Vector multiplication.

Arguments

• const mat4 & m - The value of the matrix.
• const dvec3 & v - The value of the vector.

Return value

The resulting vector.

dvec3operator*(const dvec3 & v, const mat4 & m)

Vector multiplication.

Arguments

• const dvec3 & v - The value of the vector.
• const mat4 & m - The value of the matrix.

Return value

The resulting vector.

dvec4operator*(const mat4 & m, const dvec4 & v)

Vector multiplication.

Arguments

• const mat4 & m - The value of the matrix.
• const dvec4 & v - The value of the vector.

Return value

The resulting vector.

dvec4operator*(const dvec4 & v, const mat4 & m)

Vector multiplication.

Arguments

• const dvec4 & v - The value of the vector.
• const mat4 & m - The value of the matrix.

Return value

The resulting vector.

mat4operator*(const mat4 & m0, const mat4 & m1)

Matrix multiplication.

Arguments

• const mat4 & m0 - The value of the first matrix.
• const mat4 & m1 - The value of the second matrix.

Return value

The resulting matrix.

mat4operator+(const mat4 & m0, const mat4 & m1)

Arguments

• const mat4 & m0 - The value of the first matrix.
• const mat4 & m1 - The value of the second matrix.

Return value

The resulting matrix.

mat4operator-(const mat4 & m0, const mat4 & m1)

Matrix subtraction.

Arguments

• const mat4 & m0 - The value of the first matrix.
• const mat4 & m1 - The value of the second matrix.

Return value

The resulting matrix.

mat4hardwareProjection(const mat4 & projection)

Return hardware projection matrix.

Arguments

• const mat4 & projection - Projection matrix.

Return value

The hardware projection matrix.

voiddecomposeTransform(const mat4 & m, vec4 & position, quat & rot)

Decompose transformation.

Arguments

• const mat4 & m - The value of the matrix.
• vec4 & position - Position part of transformation.
• quat & rot - Rotation part of transformation.

mat4composeTransform(const vec4 & position, const quat & rot)

Compose transformation.

Arguments

• const vec4 & position - Position part of transformation.
• const quat & rot - Rotation part of transformation.

Return value

The transformation matrix.

voiddecomposeTransform(const mat4 & m, vec3 & position, quat & rot, vec3 & scale)

Decompose transformation.

Arguments

• const mat4 & m - The value of the matrix.
• vec3 & position - Position part of transformation.
• quat & rot - Rotation part of transformation.
• vec3 & scale - Scale part of transformation.

mat4composeTransform(const vec3 & position, const quat & rot, const vec3 & scale)

Compose transformation.

Arguments

• const vec3 & position - Position part of transformation.
• const quat & rot - Rotation part of transformation.
• const vec3 & scale - Scale part of transformation.

Return value

The transformation matrix.

voiddecomposeProjection(const mat4 & projection, float & znear, float & zfar)

Decompose projection matrix.

Arguments

• const mat4 & projection - The projection matrix.
• float & znear - Near clipping plane.
• float & zfar - Far clipping plane.

intoperator==(const dmat4 & m0, const dmat4 & m1)

Matrix equal comparison.

Arguments

• const dmat4 & m0 - The first matrix.
• const dmat4 & m1 - The second matrix.

intoperator!=(const dmat4 & m0, const dmat4 & m1)

Matrix not equal comparison.

Arguments

• const dmat4 & m0 - The first matrix.
• const dmat4 & m1 - The second matrix.

dmat4operator*(const dmat4 & m, const double v)

Matrix multiplication.

Arguments

• const dmat4 & m - The value of the matrix.
• const double v - The value of the scalar.

Return value

The resulting matrix.

vec3operator*(const dmat4 & m, const vec3 & v)

Vector multiplication.

Arguments

• const dmat4 & m - The value of the matrix.
• const vec3 & v - The value of the vector.

Return value

The resulting vector.

vec3operator*(const vec3 & v, const dmat4 & m)

Vector multiplication.

Arguments

• const vec3 & v - The value of the vector.
• const dmat4 & m - The value of the matrix.

Return value

The resulting vector.

vec4operator*(const dmat4 & m, const vec4 & v)

Vector multiplication.

Arguments

• const dmat4 & m - The value of the matrix.
• const vec4 & v - The value of the vector.

Return value

The resulting vector.

vec4operator*(const vec4 & v, const dmat4 & m)

Vector multiplication.

Arguments

• const vec4 & v - The value of the vector.
• const dmat4 & m - The value of the matrix.

Return value

The resulting vector.

dvec3operator*(const dmat4 & m, const dvec3 & v)

Vector multiplication.

Arguments

• const dmat4 & m - The value of the matrix.
• const dvec3 & v - The value of the vector.

Return value

The resulting vector.

dvec3operator*(const dvec3 & v, const dmat4 & m)

Vector multiplication.

Arguments

• const dvec3 & v - The value of the vector.
• const dmat4 & m - The value of the matrix.

Return value

The resulting vector.

dvec4operator*(const dmat4 & m, const dvec4 & v)

Vector multiplication.

Arguments

• const dmat4 & m - The value of the matrix.
• const dvec4 & v - The value of the vector.

Return value

The resulting vector.

dvec4operator*(const dvec4 & v, const dmat4 & m)

Vector multiplication.

Arguments

• const dvec4 & v - The value of the vector.
• const dmat4 & m - The value of the matrix.

Return value

The resulting vector.

dmat4operator*(const dmat4 & m0, const dmat4 & m1)

Matrix multiplication.

Arguments

• const dmat4 & m0 - The value of the first matrix.
• const dmat4 & m1 - The value of the second matrix.

Return value

The resulting matrix.

dmat4operator+(const dmat4 & m0, const dmat4 & m1)

Arguments

• const dmat4 & m0 - The value of the first matrix.
• const dmat4 & m1 - The value of the second matrix.

Return value

The resulting matrix.

dmat4operator-(const dmat4 & m0, const dmat4 & m1)

Matrix subtraction.

Arguments

• const dmat4 & m0 - The value of the first matrix.
• const dmat4 & m1 - The value of the second matrix.

Return value

The resulting matrix.

dmat4rotation(const dmat4 & m)

Return rotation matrix.

Arguments

• const dmat4 & m - The value of the matrix.

Return value

The resulting matrix.

voiddecomposeTransform(const dmat4 & m, dvec3 & position, quat & rot, vec3 & scale)

Decompose transformation.

Arguments

• const dmat4 & m - The value of the matrix.
• dvec3 & position - Position part of transformation.
• quat & rot - Rotation part of transformation.
• vec3 & scale - Scale part of transformation.

dmat4composeTransform(const dvec3 & position, const quat & rot, const vec3 & scale)

Compose transformation.

Arguments

• const dvec3 & position - Position part of transformation.
• const quat & rot - Rotation part of transformation.
• const vec3 & scale - Scale part of transformation.

Return value

The transformation matrix.

intoperator==(const quat & q0, const quat & q1)

Quaternion equal comparison.

Arguments

• const quat & q0 - The first quaternion.
• const quat & q1 - The second quaternion.

intoperator!=(const quat & q0, const quat & q1)

Quaternion not equal comparison.

Arguments

• const quat & q0 - The first quaternion.
• const quat & q1 - The second quaternion.

quatoperator*(const quat & q, float v)

Quaternion multiplication.

Arguments

• const quat & q - The value of the quaternion.
• float v - The value of the scalar.

Return value

The resulting quaternion.

vec3operator*(const quat & q, const vec3 & v)

Quaternion multiplication.

Arguments

• const quat & q - The value of the quaternion.
• const vec3 & v - The value of the vector.

Return value

The resulting vector.

vec3operator*(const vec3 & v, const quat & q)

Quaternion multiplication.

Arguments

• const vec3 & v - The value of the vector.
• const quat & q - The value of the quaternion.

Return value

The resulting vector.

dvec3operator*(const quat & q, const dvec3 & v)

Quaternion multiplication.

Arguments

• const quat & q - The value of the quaternion.
• const dvec3 & v - The value of the vector.

Return value

The resulting vector.

dvec3operator*(const dvec3 & v, const quat & q)

Quaternion multiplication.

Arguments

• const dvec3 & v - The value of the vector.
• const quat & q - The value of the quaternion.

Return value

The resulting vector.

quatoperator*(const quat & q0, const quat & q1)

Quaternion multiplication.

Arguments

• const quat & q0 - The value of the first quaternion.
• const quat & q1 - The value of the second quaternion.

Return value

The resulting quaternion.

quatoperator+(const quat & q0, const quat & q1)

Arguments

• const quat & q0 - The value of the first quaternion.
• const quat & q1 - The value of the second quaternion.

Return value

The resulting quaternion.

quatoperator-(const quat & q0, const quat & q1)

Quaternion subtraction.

Arguments

• const quat & q0 - The value of the first quaternion.
• const quat & q1 - The value of the second quaternion.

Return value

The resulting quaternion.

quatslerp(const quat & q0, const quat & q1, float k)

Spherical interpolation.

Arguments

• const quat & q0 - The value of the first quaternion.
• const quat & q1 - The value of the second quaternion.
• float k - The current position (from 0 to 1).

Return value

The resulting quaternion.

Stringoperator+(const String & s0, const String & s1)

Arguments

• const String & s0 - The first string.
• const String & s1 - The second string.

intoperator==(const String & s0, const String & s1)

String equal comparison.

Arguments

• const String & s0 - The first string.
• const String & s1 - The second string.

intoperator!=(const String & s0, const String & s1)

String not equal comparison.

Arguments

• const String & s0 - The first string.
• const String & s1 - The second string.

intoperator<(const String & s0, const String & s1)

String less than comparison.

Arguments

• const String & s0 - The first string.
• const String & s1 - The second string.

intoperator>(const String & s0, const String & s1)

String greater than comparison.

Arguments

• const String & s0 - The first string.
• const String & s1 - The second string.

intoperator<=(const String & s0, const String & s1)

String less or equal to comparison.

Arguments

• const String & s0 - The first string.
• const String & s1 - The second string.

intoperator>=(const String & s0, const String & s1)

String greater or equal to comparison.

Arguments

• const String & s0 - The first string.
• const String & s1 - The second string.

intoperator==(const TypeInfo & t0, const TypeInfo & t1)

Check if two TypeInfo classes are referenced the same types.

Arguments

• const TypeInfo & t0 - The first TypeIndo class.
• const TypeInfo & t1 - The second TypeIndo class.

Return value

Returns 1 if types are the same; otherwise, 0 is returned.

intoperator!=(const TypeInfo & t0, const TypeInfo & t1)

Check if two TypeInfo classes are not referenced the same types.

Arguments

• const TypeInfo & t0 - The first TypeIndo class.
• const TypeInfo & t1 - The second TypeIndo class.

Return value

Returns 1 if types are not the same; otherwise, 0 is returned.

Typeclamp(Type v, Type v0, Type v1)

Clamps the value.

Arguments

• Type v - The value.
• Type v0 - The minimum value.
• Type v1 - The maximum value.

Return value

The clamped value.

voidswap(Type & v0, Type & v1)

Swaps two values.

Arguments

• Type & v0 - The first value.
• Type & v1 - The second value.

voidswap(Type * v0, Type * v1, int size)

Swaps two arrays.

Arguments

• Type * v0 - The first array.
• Type * v1 - The second array.
• int size - The array size.
Last update: 2017-07-03