Math Common Functions

This class represents a collection of common math functions.

Notice
Math common functions are the members of the Unigine::Math namespace.

AXIS#

NameDescription
AXIS_X = = 0Positive X axis.
AXIS_Y = = 1Positive Y axis.
AXIS_Z = = 2Positive Z axis.
AXIS_NX = = 3Negative X axis.
AXIS_NY = = 4Negative Y axis.
AXIS_NZ = = 5Negative Z axis.

floatabs ( float v ) #

Returns the absolute value of the argument.

Arguments

• float v - Float value.

Absolute value.

doubleabs ( double v ) #

Returns the absolute value of the argument.

Arguments

• double v - Value.

Absolute value.

intabs ( int v ) #

Returns the absolute value of the argument.

Arguments

• int v - Value.

Absolute value.

long longabs ( long long v ) #

Returns the absolute value of the argument.

Arguments

• long long v - Value.

Absolute value.

vec2abs ( vec2 v ) #

Returns the absolute values of the vector components.

Arguments

• vec2 v - Source vector.

Return value

Vector with absolute values.

vec3abs ( vec3 v ) #

Returns the absolute values of the vector components.

Arguments

• vec3 v - Source vector.

Return value

Vector with absolute values.

vec4abs ( vec4 v ) #

Returns the absolute values of the vector components.

Arguments

• vec4 v - Source vector.

Return value

Vector with absolute values.

dvec2abs ( dvec2 v ) #

Returns the absolute values of the vector components.

Return value

Vector with absolute values.

dvec3abs ( dvec3 v ) #

Returns the absolute values of the vector components.

Return value

Vector with absolute values.

dvec4abs ( dvec4 v ) #

Returns the absolute values of the vector components.

Return value

Vector with absolute values.

ivec2abs ( ivec2 v ) #

Returns the absolute values of the vector components.

Return value

Vector with absolute values.

ivec3abs ( ivec3 v ) #

Returns the absolute values of the vector components.

Return value

Vector with absolute values.

ivec4abs ( ivec4 v ) #

Returns the absolute values of the vector components.

Return value

Vector with absolute values.

floatbezier ( const float * t, const float * v, float time ) #

Calculates the value of a cubic Bezier function for t = time.

A cubic Bezier curve is represented by 4 points. Po is the start point, P1 and P2 are control points 1 and 2 and P3 is the end point. The start and end point denote the beginning and end points of the path and the control points determine how the path moves from the start to the finish. As can be seen from the image, the only variable changing is t which determines how far the path has progressed from P0 to P3. Cubic Bezier curves are used as timing functions particularly for keyframe interpolation.

Arguments

• const float * t - Coordinates of the four points of the curve along the horizontal T (times) axis in the range [0.0f, 1.0f].
• const float * v - Coordinates of the four points of the curve along the vertical V (values) axis in the range [0.0f, 1.0f].
• float time - Time in the range [0, 1], for which the value of the Bezier function is to be calculated.

Return value

Value of the Bezier function.

doublebezier ( const float * t, const double * v, float time ) #

Calculates the value of a cubic Bezier function for t = time.

A cubic Bezier curve is represented by 4 points. Po is the start point, P1 and P2 are control points 1 and 2 and P3 is the end point. The start and end point denote the beginning and end points of the path and the control points determine how the path moves from the start to the finish. As can be seen from the image, the only variable changing is t which determines how far the path has progressed from P0 to P3. Cubic Bezier curves are used as timing functions particularly for keyframe interpolation.

Arguments

• const float * t - Coordinates of the four points of the curve along the horizontal T (times) axis in the range [0.0f, 1.0f].
• const double * v - Coordinates of the four points of the curve along the vertical V (values) axis in the range [0.0f, 1.0f].
• float time - Time in the range [0, 1], for which the value of the Bezier function is to be calculated.

Return value

Value of the Bezier function.

vec4blueNoise ( int x, int y ) #

Returns a blue noise value for the given pixel coordinates.

Arguments

• int x - X coordinate of the pixel.
• int y - Y coordinate of the pixel.

Return value

Blue noise value.

floatceil ( float v ) #

Ceiling function that returns the smallest integer value that is not less than the argument.
Source code
``float a = ceil(3.141593); // a = 4.0``

Arguments

• float v - Argument.

Return value

Smallest integer value not less than v.

doubleceil ( double v ) #

Ceiling function that returns the smallest integer value that is not less than the argument.
Source code
``double a = ceil(3.141593); // a = 4.0``

Arguments

• double v - Argument.

Return value

Smallest integer value not less than v.

const vec2 &ceil ( const vec2 & v ) #

Ceiling function that returns the vector storing the smallest integer values that are not less than the argument.

Arguments

• const vec2 & v - Vector storing values.

Return value

Vector storing the smallest integer values not less than v.

const vec3 &ceil ( const vec3 & v ) #

Ceiling function that returns the vector storing the smallest integer values that are not less than the argument.

Arguments

• const vec3 & v - Vector storing values.

Return value

Vector storing the smallest integer values not less than v.

const vec4 &ceil ( const vec4 & v ) #

Ceiling function that returns the vector storing the smallest integer values that are not less than the argument.

Arguments

• const vec4 & v - Vector storing values.

Return value

Vector storing the smallest integer values not less than v.

const dvec2 &ceil ( const dvec2 & v ) #

Ceiling function that returns the vector storing the smallest integer values that are not less than the argument.

Arguments

• const dvec2 & v - Vector storing values.

Return value

Vector storing the smallest integer values not less than v.

const dvec3 &ceil ( const dvec3 & v ) #

Ceiling function that returns the vector storing the smallest integer values that are not less than the argument.

Arguments

• const dvec3 & v - Vector storing values.

Return value

Vector storing the smallest integer values not less than v.

const dvec4 &ceil ( const dvec4 & v ) #

Ceiling function that returns the vector storing the smallest integer values that are not less than the argument.

Arguments

• const dvec4 & v - Vector storing values.

Return value

Vector storing the smallest integer values not less than v.

doublechangeRange ( double value, const dvec4 & range ) #

Transforms the value from the source range to the corresponding value within target range.

Arguments

• double value - The value within the source range.
• const dvec4 & range - The vector containing 4 values: values X and Y define the source range, values Z and W define the target range.

Return value

The value within the target range.

doubleclamp ( double v, double v0, double v1 ) #

Clamps a value within the specified min and max limits.

Arguments

• double v - Value to be clamped.
• double v0 - Minimum value.
• double v1 - Maximum value.

Clamped value.

floatclamp ( float v, float v0, float v1 ) #

Clamps a value within the specified min and max limits.

Arguments

• float v - Value to be clamped.
• float v0 - Minimum value.
• float v1 - Maximum value.

Clamped value.

intclamp ( int v, int v0, int v1 ) #

Clamps a value within the specified min and max limits.

Arguments

• int v - Value to be clamped.
• int v0 - Minimum value.
• int v1 - Maximum value.

Clamped value.

charclamp ( char v, char v0, char v1 ) #

Clamps a value within the specified min and max limits.

Arguments

• char v - Value to be clamped.
• char v0 - Minimum value.
• char v1 - Maximum value.

Clamped value.

long longclamp ( long long v, long long v0, long long v1 ) #

Clamps a value within the specified min and max limits.

Arguments

• long long v - Value to be clamped.
• long long v0 - Minimum value.
• long long v1 - Maximum value.

Clamped value.

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

Clamps a value within the specified min and max limits.

Arguments

• const dvec2 & v - Value to be clamped.
• const dvec2 & v0 - Minimum value.
• const dvec2 & v1 - Maximum value.

Clamped value.

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

Clamps a value within the specified min and max limits.

Arguments

• const ivec2 & v - The value.
• const ivec2 & v0 - Minimum value.
• const ivec2 & v1 - Maximum value.

Clamped value.

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

Clamps a value within the specified min and max limits.

Arguments

• const vec2 & v - Value to be clamped.
• const vec2 & v0 - Minimum value.
• const vec2 & v1 - Maximum value.

Clamped value.

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

Clamps a value within the specified min and max limits.

Arguments

• const dvec3 & v - Value to be clamped.
• const dvec3 & v0 - Minimum value.
• const dvec3 & v1 - Maximum value.

Clamped value.

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

Clamps a value within the specified min and max limits.

Arguments

• const ivec3 & v - Value to be clamped.
• const ivec3 & v0 - Minimum value.
• const ivec3 & v1 - Maximum value.

Clamped value.

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

Clamps a value within the specified min and max limits.

Arguments

• const vec3 & v - Value to be clamped.
• const vec3 & v0 - Minimum value.
• const vec3 & v1 - Maximum value.

Clamped value.

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

Clamps a value within the specified min and max limits.

Arguments

• const bvec4 & v - Value to be clamped.
• const bvec4 & v0 - Minimum value.
• const bvec4 & v1 - Maximum value.

Clamped value.

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

Clamps a value within the specified min and max limits.

Arguments

• const dvec4 & v - Value to be clamped.
• const dvec4 & v0 - Minimum value.
• const dvec4 & v1 - Maximum value.

Clamped value.

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

Clamps a value within the specified min and max limits.

Arguments

• const ivec4 & v - Value to be clamped.
• const ivec4 & v0 - Minimum value.
• const ivec4 & v1 - Maximum value.

Clamped value.

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

Clamps a value within the specified min and max limits.

Arguments

• const vec4 & v - Value to be clamped.
• const vec4 & v0 - Minimum value.
• const vec4 & v1 - Maximum value.

Clamped value.

Typeclamp ( Type v, Type v0, Type v1 ) #

Clamps the value within the specified min and max limits.

Arguments

• Type v - Value to be clamped.
• Type v0 - Minimum value.
• Type v1 - Maximum value.

Clamped value.

intcompare ( int v0, int v1 ) #

Compares two scalars of the int type.

Arguments

• int v0 - First int scalar.
• int v1 - Second int scalar.

Return value

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

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 - First float scalar.
• float v1 - Second float scalar.

Return value

1 if 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 - First double scalar.
• double v1 - 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 - First scalar.
• float v1 - Second scalar.
• float epsilon - 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 - First scalar.
• double v1 - Second scalar.
• double epsilon - Epsilon (degree of precision).

Return value

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

intcompare ( const vec2 & v0, const vec2 & v1 ) #

Compares two vectors according to the degree of precision equal to 1.0e-6f.

Arguments

• const vec2 & v0 - First vector.
• const vec2 & v1 - Second vector.

Return value

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

intcompare ( const vec2 & v0, const vec2 & v1, float epsilon ) #

Compares two vectors according to the specified degree of precision.

Arguments

• const vec2 & v0 - First vector.
• const vec2 & v1 - Second vector.
• float epsilon - Epsilon (degree of precision).

Return value

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

intcompare ( const dvec2 & v0, const dvec2 & v1 ) #

Compares two vectors according to the degree of precision equal to 1.0e-6f.

Arguments

• const dvec2 & v0 - First vector.
• const dvec2 & v1 - Second vector.

Return value

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

intcompare ( const dvec2 & v0, const dvec2 & v1, double epsilon ) #

Compares two vectors according to the specified degree of precision.

Arguments

• const dvec2 & v0 - First vector.
• const dvec2 & v1 - Second vector.
• double epsilon - Epsilon (degree of precision).

Return value

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

intcompare ( const vec3 & v0, const vec3 & v1 ) #

Compares two vectors according to the degree of precision equal to 1.0e-6f.

Arguments

• const vec3 & v0 - First vector.
• const vec3 & v1 - Second vector.

Return value

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

intcompare ( const vec3 & v0, const vec3 & v1, float epsilon ) #

Compares two vectors according to the specified degree of precision.

Arguments

• const vec3 & v0 - First vector.
• const vec3 & v1 - Second vector.
• float epsilon - Epsilon (degree of precision).

Return value

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

intcompare ( const dvec3 & v0, const dvec3 & v1 ) #

Compares two vectors according to the degree of precision equal to 1.0e-6f.

Arguments

• const dvec3 & v0 - First vector.
• const dvec3 & v1 - Second vector.

Return value

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

intcompare ( const dvec3 & v0, const dvec3 & v1, double epsilon ) #

Compares two vectors according to the specified degree of precision.

Arguments

• const dvec3 & v0 - First vector.
• const dvec3 & v1 - Second vector.
• double epsilon - Epsilon (degree of precision).

Return value

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

intcompare ( const vec4 & v0, const vec4 & v1 ) #

Compares two vectors according to the degree of precision equal to 1.0e-6f.

Arguments

• const vec4 & v0 - First vector.
• const vec4 & v1 - Second vector.

Return value

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

intcompare ( const vec4 & v0, const vec4 & v1, float epsilon ) #

Compares two vectors according to the specified degree of precision.

Arguments

• const vec4 & v0 - First vector.
• const vec4 & v1 - Second vector.
• float epsilon - Epsilon (degree of precision).

Return value

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

intcompare ( const dvec4 & v0, const dvec4 & v1 ) #

Compares two vectors according to the degree of precision equal to 1.0e-6f.

Arguments

• const dvec4 & v0 - First vector.
• const dvec4 & v1 - Second vector.

Return value

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

intcompare ( const dvec4 & v0, const dvec4 & v1, double epsilon ) #

Compares two vectors according to the specified degree of precision.

Arguments

• const dvec4 & v0 - First vector.
• const dvec4 & v1 - Second vector.
• double epsilon - Epsilon (degree of precision).

Return value

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

intcompare ( const quat & q0, const quat & q1 ) #

Compares two quaternions according to the degree of precision equal to 1.0e-6f.

Arguments

• const quat & q0 - First quaternion.
• const quat & q1 - Second quaternion.

Return value

1 if the q0 is equal to q1; otherwise, 0.

intcompare ( const quat & q0, const quat & q1, float epsilon ) #

Compares two quaternions according to the specified degree of precision.

Arguments

• const quat & q0 - First quaternion.
• const quat & q1 - Second quaternion.
• float epsilon - Epsilon (degree of precision).

Return value

1 if the q0 is equal to q1; otherwise, 0.

intcompare ( const mat2 & m0, const mat2 & m1 ) #

Compares two matrices according to the degree of precision equal to 1.0e-6f.

Arguments

• const mat2 & m0 - First matrix.
• const mat2 & m1 - Second matrix.

Return value

1 if the m0 is equal to m1; otherwise, 0.

intcompare ( const mat2 & m0, const mat2 & m1, float epsilon ) #

Compares two matrices according to the specified degree of precision.

Arguments

• const mat2 & m0 - First matrix.
• const mat2 & m1 - Second matrix.
• float epsilon - Epsilon (degree of precision).

Return value

1 if the m0 is equal to m1; otherwise, 0.

intcompare ( const mat3 & m0, const mat3 & m1 ) #

Compares two matrices according to the degree of precision equal to 1.0e-6f.

Arguments

• const mat3 & m0 - First matrix.
• const mat3 & m1 - Second matrix.

Return value

1 if the m0 is equal to m1; otherwise, 0.

intcompare ( const mat3 & m0, const mat3 & m1, float epsilon ) #

Compares two matrices according to the specified degree of precision.

Arguments

• const mat3 & m0 - First matrix.
• const mat3 & m1 - Second matrix.
• float epsilon - Epsilon (degree of precision).

Return value

1 if the m0 is equal to m1; otherwise, 0.

intcompare ( const mat4 & m0, const mat4 & m1 ) #

Compares two matrices according to the degree of precision equal to 1.0e-6f.

Arguments

• const mat4 & m0 - First matrix.
• const mat4 & m1 - Second matrix.

Return value

1 if the m0 is equal to m1; otherwise, 0.

intcompare ( const mat4 & m0, const mat4 & m1, float epsilon ) #

Compares two matrices according to the specified degree of precision.

Arguments

• const mat4 & m0 - First matrix.
• const mat4 & m1 - Second matrix.
• float epsilon - Epsilon (degree of precision).

Return value

1 if the m0 is equal to m1; otherwise, 0.

intcompare ( const dmat4 & m0, const dmat4 & m1 ) #

Compares two matrices according to the degree of precision equal to 1.0e-6f.

Arguments

• const dmat4 & m0 - First matrix.
• const dmat4 & m1 - Second matrix.

Return value

1 if the m0 is equal to m1; otherwise, 0.

intcompare ( const dmat4 & m0, const dmat4 & m1, double epsilon ) #

Compares two matrices according to the specified degree of precision.

Arguments

• const dmat4 & m0 - First matrix.
• const dmat4 & m1 - Second matrix.
• double epsilon - Epsilon (degree of precision).

Return value

1 if the m0 is equal to m1; otherwise, 0.

quatconjugate ( const quat & q ) #

Returns the conjugate of a given quaternion.

Arguments

• const quat & q - Quaternion.

Return value

Conjugate of a given quaternion.

floatcross ( const vec2 & v0, const vec2 & v1 ) #

Cross product of vectors.

Arguments

• const vec2 & v0 - First vector.
• const vec2 & v1 - Second vector.

Return value

Cross product of the two 2d vectors: v0.x * v1.y - v0.y*v1.x.

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

Cross product of vectors.

Arguments

• const ivec3 & v0 - First vector.
• const ivec3 & v1 - Second vector.

Return value

Resulting vector.

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

Cross product of vectors.

Arguments

• const dvec3 & v0 - First vector.
• const dvec3 & v1 - Second vector.

Return value

Resulting vector.

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

Cross product of vectors.

Arguments

• const vec3 & v0 - First vector.
• const vec3 & v1 - Second vector.

Return value

Resulting vector.

ivec3 &cross ( ivec3 & ret, const ivec3 & v0, const ivec3 & v1 ) #

Cross product of vectors.

Arguments

• ivec3 & ret - Output vector, to which the resulting vector will be put.
• const ivec3 & v0 - First vector.
• const ivec3 & v1 - Second vector.

Return value

Resulting vector.

vec3 &cross ( vec3 & ret, const vec3 & v0, const vec3 & v1 ) #

Cross product of vectors.

Arguments

• vec3 & ret - Output vector, to which the resulting vector will be put.
• const vec3 & v0 - First vector.
• const vec3 & v1 - Second vector.

Return value

Resulting vector.

vec4 &cross ( vec4 & ret, const vec3 & v0, const vec3 & v1 ) #

Cross product of vectors.

Arguments

• vec4 & ret - Output vector, to which the resulting vector will be put.
• const vec3 & v0 - First vector.
• const vec3 & v1 - Second vector.

Return value

Resulting vector.

dvec3 &cross ( dvec3 & ret, const dvec3 & v0, const dvec3 & v1 ) #

Cross product of vectors.

Arguments

• dvec3 & ret - Output vector, to which the resulting vector will be put.
• const dvec3 & v0 - First vector.
• const dvec3 & v1 - Second vector.

Return value

Resulting vector.

dvec4 &cross ( dvec4 & ret, const dvec3 & v0, const dvec3 & v1 ) #

Cross product of vectors.

Arguments

• dvec4 & ret - Output vector, to which the resulting vector will be put.
• const dvec3 & v0 - First vector.
• const dvec3 & v1 - Second vector.

Return value

Resulting vector.

floatdistance ( const vec2 & v0, const vec2 & v1 ) #

Calculates the distance between the two given vectors. The distance is calculated as: length(v0 - v1).

Arguments

• const vec2 & v0 - First vector.
• const vec2 & v1 - Second vector.

Return value

Distance between the two given vectors.

floatdistance ( const vec3 & v0, const vec3 & v1 ) #

Calculates the distance between the two given vectors. The distance is calculated as: length(v0 - v1).

Arguments

• const vec3 & v0 - First vector.
• const vec3 & v1 - Second vector.

Return value

Distance between the two given vectors.

floatdistance ( const vec4 & v0, const vec4 & v1 ) #

Calculates the distance between the two given vectors. The distance is calculated as: length(v0 - v1).

Arguments

• const vec4 & v0 - First vector.
• const vec4 & v1 - Second vector.

Return value

Distance between the two given vectors.

floatdistance2 ( const vec2 & v0, const vec2 & v1 ) #

Calculates the squared distance between the two given vectors. The squared distance is calculated as: length2(v0 - v1). This method is much faster than distance() - the calculation is basically the same only without the slow Sqrt call. If you simply want to compare distances, then it is faster to compare squared distances against the squares of distances as the comparison gives the same result.

Arguments

• const vec2 & v0 - First vector.
• const vec2 & v1 - Second vector.

Return value

Squared distance between the two given vectors.

floatdistance2 ( const vec3 & v0, const vec3 & v1 ) #

Calculates the squared distance between the two given vectors. The squared distance is calculated as: length2(v0 - v1). This method is much faster than distance() - the calculation is basically the same only without the slow Sqrt call. If you simply want to compare distances, then it is faster to compare squared distances against the squares of distances as the comparison gives the same result.

Arguments

• const vec3 & v0 - First vector.
• const vec3 & v1 - Second vector.

Return value

Squared distance between the two given vectors.

floatdistance2 ( const vec4 & v0, const vec4 & v1 ) #

Calculates the squared distance between the two given vectors. The squared distance is calculated as: length2(v0 - v1). This method is much faster than distance() - the calculation is basically the same only without the slow Sqrt call. If you simply want to compare distances, then it is faster to compare squared distances against the squares of distances as the comparison gives the same result.

Arguments

• const vec4 & v0 - First vector.
• const vec4 & v1 - Second vector.

Return value

Squared distance between the two given vectors.

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

Dot product of vectors.

Arguments

• const vec2 & v0 - First vector.
• const vec2 & v1 - Second vector.

Return value

Resulting scalar.

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

Dot product of vectors.

Arguments

• const vec3 & v0 - First vector.
• const vec3 & v1 - Second vector.

Return value

Resulting scalar.

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

Dot product of vectors.

Arguments

• const dvec2 & v0 - First vector.
• const dvec2 & v1 - Second vector.

Return value

Resulting scalar.

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

Dot product of vectors. In this case, w component of the four-component vector is added to the dot product of first three components of vectors.

Arguments

• const vec3 & v0 - First vector.
• const vec4 & v1 - Second vector.

Return value

Resulting scalar.

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

Dot product of vectors. In this case, w component of the four-component vector is added to the dot product of first three components of vectors.

Arguments

• const vec4 & v0 - First vector.
• const vec3 & v1 - Second vector.

Return value

Resulting scalar.

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

Dot product of vectors.

Arguments

• const vec4 & v0 - First vector.
• const vec4 & v1 - Second vector.

Return value

Resulting scalar.

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

Dot product of vectors.

Arguments

• const ivec3 & v0 - First vector.
• const ivec3 & v1 - Second vector.

Return value

Resulting scalar.

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

Dot product of vectors.

Arguments

• const ivec2 & v0 - First vector.
• const ivec2 & v1 - Second vector.

Return value

Resulting scalar.

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

Dot product of vectors. In this case, w component of the four-component vector is added to the dot product of first three components of vectors.

Arguments

• const ivec4 & v0 - First vector.
• const ivec3 & v1 - Second vector.

Return value

Resulting scalar.

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

Dot product of vectors.

Arguments

• const ivec4 & v0 - First vector.
• const ivec4 & v1 - Second vector.

Return value

Resulting scalar.

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

Dot product of vectors.

Arguments

• const dvec3 & v0 - First vector.
• const dvec3 & v1 - Second vector.

Return value

Resulting scalar.

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

Dot product of vectors. In this case, w component of the four-component vector is added to the dot product of first three components of vectors.

Arguments

• const dvec3 & v0 - First vector.
• const dvec4 & v1 - Second vector.

Return value

Resulting scalar.

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

Dot product of vectors. In this case, w component of the four-component vector is added to the dot product of first three components of vectors.

Arguments

• const dvec4 & v0 - First vector.
• const dvec3 & v1 - Second vector.

Return value

Resulting scalar.

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

Dot product of vectors.

Arguments

• const dvec4 & v0 - First vector.
• const dvec4 & v1 - Second vector.

Return value

Resulting scalar.

doubledot3 ( const dvec3 & v0, const dvec4 & v1 ) #

Dot product of three components of vectors. W components of four-component vectors are ignored.
Source code (C++)
``````float a = dot3(vec3(1, 2, 3), vec4(1, 2, 3, 4));
double b = dot3(dvec4(1, 2, 3, 4), dvec4(1, 2, 3, 4));
/*
result is:
a = 14.000000
b = 14.000000
*/``````

Arguments

• const dvec3 & v0 - First vector.
• const dvec4 & v1 - Second vector.

Return value

Resulting scalar.

doubledot3 ( const dvec4 & v0, const dvec3 & v1 ) #

Dot product of three components of vectors. W components of four-component vectors are ignored.
Source code (C++)
``````float a = dot3(vec3(1, 2, 3), vec4(1, 2, 3, 4));
double b = dot3(dvec4(1, 2, 3, 4), dvec4(1, 2, 3, 4));
/*
result is:
a = 14.000000
b = 14.000000
*/``````

Arguments

• const dvec4 & v0 - First vector.
• const dvec3 & v1 - Second vector.

Return value

Resulting scalar.

doubledot3 ( const dvec4 & v0, const dvec4 & v1 ) #

Dot product of three components of vectors. W components of four-component vectors are ignored.
Source code (C++)
``````float a = dot3(vec3(1, 2, 3), vec4(1, 2, 3, 4));
double b = dot3(dvec4(1, 2, 3, 4), dvec4(1, 2, 3, 4));
/*
result is:
a = 14.000000
b = 14.000000
*/``````

Arguments

• const dvec4 & v0 - First vector.
• const dvec4 & v1 - Second vector.

Return value

Resulting scalar.

floatdot3 ( const vec3 & v0, const vec4 & v1 ) #

Dot product of three components of vectors. W components of four-component vectors are ignored.
Source code (C++)
``````float a = dot3(vec3(1, 2, 3), vec4(1, 2, 3, 4));
double b = dot3(dvec4(1, 2, 3, 4), dvec4(1, 2, 3, 4));
/*
result is:
a = 14.000000
b = 14.000000
*/``````

Arguments

• const vec3 & v0 - First vector.
• const vec4 & v1 - Second vector.

Return value

Resulting scalar.

floatdot3 ( const vec4 & v0, const vec3 & v1 ) #

Dot product of three components of vectors. W components of four-component vectors are ignored.
Source code (C++)
``````float a = dot3(vec3(1, 2, 3), vec4(1, 2, 3, 4));
double b = dot3(dvec4(1, 2, 3, 4), dvec4(1, 2, 3, 4));
/*
result is:
a = 14.000000
b = 14.000000
*/``````

Arguments

• const vec4 & v0 - First vector.
• const vec3 & v1 - Second vector.

Return value

Resulting scalar.

floatdot3 ( const vec4 & v0, const vec4 & v1 ) #

Dot product of three components of vectors. W components of four-component vectors are ignored.
Source code (C++)
``````float a = dot3(vec3(1, 2, 3), vec4(1, 2, 3, 4));
double b = dot3(dvec4(1, 2, 3, 4), dvec4(1, 2, 3, 4));
/*
result is:
a = 14.000000
b = 14.000000
*/``````

Arguments

• const vec4 & v0 - First vector.
• const vec4 & v1 - Second vector.

Return value

Resulting scalar.

floatdtof ( double v ) #

Converts a double value to an integer value.

Arguments

• double v - Double value.

Float value.

intdtoi ( double v ) #

Converts a double value to an integer value.

Arguments

• double v - Double value.

Integer value.

long longdtol ( double v ) #

Converts a double value to a long value.

Arguments

• double v - Double value.

Long value.

doublefloor ( double v ) #

Rounds an argument down to the nearest integer.
Source code
``float a = floor(2.3) // a = 2.0``

Arguments

• double v - Argument.

Return value

Largest integer value not greater than arg.

floatfloor ( float v ) #

Rounds an argument down to the nearest integer.
Source code
``double a = floor(2.3) // a = 2.0``

Arguments

• float v - Argument.

Return value

Largest integer value not greater than arg.

const vec2 &floor ( const vec2 & v ) #

Ceiling function that returns the vector storing the largest integer values that are not greater than the argument.

Arguments

• const vec2 & v - Vector storing values.

Return value

Vector storing the largest integer values not greater than v.

const vec3 &floor ( const vec3 & v ) #

Ceiling function that returns the vector storing the largest integer values that are not greater than the argument.

Arguments

• const vec3 & v - Vector storing values.

Return value

Vector storing the largest integer values not greater than v.

const vec4 &floor ( const vec4 & v ) #

Ceiling function that returns the vector storing the largest integer values that are not greater than the argument.

Arguments

• const vec4 & v - Vector storing values.

Return value

Vector storing the largest integer values not greater than v.

const dvec2 &floor ( const dvec2 & v ) #

Ceiling function that returns the vector storing the largest integer values that are not greater than the argument.

Arguments

• const dvec2 & v - Vector storing values.

Return value

Vector storing the largest integer values not greater than v.

const dvec3 &floor ( const dvec3 & v ) #

Ceiling function that returns the vector storing the largest integer values that are not greater than the argument.

Arguments

• const dvec3 & v - Vector storing values.

Return value

Vector storing the largest integer values not greater than v.

const dvec4 &floor ( const dvec4 & v ) #

Ceiling function that returns the vector storing the largest integer values that are not greater than the argument.

Arguments

• const dvec4 & v - Vector storing values.

Return value

Vector storing the largest integer values not greater than v.

floatfrac ( float v ) #

Returns the fractional part of the argument.
Source code
``float a = frac(3.141593); // a = 0.141593``

Arguments

• float v - Argument.

Return value

Fractional part of the argument.

doublefrac ( double v ) #

Returns the fractional part of the argument.
Source code
``double a = frac(3.141593); // a = 0.141593``

Arguments

• double v - Argument.

Return value

Fractional part of the argument.

vec3frac ( const vec3 & v ) #

Returns the fractional part every component of the argument.

Arguments

• const vec3 & v - Argument.

Return value

Fractional part of every component of the argument.

vec4frac ( const vec4 & v ) #

Returns the fractional part every component of the argument.

Arguments

• const vec4 & v - Argument.

Return value

Fractional part of every component of the argument.

charftoc ( float v ) #

Converts a float value to a char value.

Arguments

• float v - Float value.

Char value.

intftoi ( float v ) #

Converts a float value to an integer value.

Arguments

• float v - Float value.

Integer value.

long longftol ( float v ) #

Converts a float value to a long value.

Arguments

• float v - Float value.

Long value.

floatgetAngle ( const quat & q0, const quat & q1 ) #

Returns the angle (in degrees) between the given first and second quaternions. The angle returned is the unsigned acute angle between the two quaternions. This means the smaller of the two possible angles is used.

Arguments

• const quat & q0 - First quaternion (from which the angular difference is measured).
• const quat & q1 - Second quaternion (to which the angular difference is measured).

Return value

Angle between the given quaternions, in degrees within the range [0.0; 180.0].

floatgetAngle ( const vec3 & v0, const vec3 & v1 ) #

Returns the angle (in degrees) between the given first and second vectors. The angle returned is the unsigned acute angle between the two vectors. This means the smaller of the two possible angles is used.

Arguments

• const vec3 & v0 - First vector (from which the angular difference is measured).
• const vec3 & v1 - Second vector (to which the angular difference is measured).

Return value

Angle between the given vectors, in degrees within the range [0.0; 180.0].

floatgetAngle ( const vec3 & v0, const vec3 & v1, const vec3 & up ) #

Returns the signed angle (in degrees) between the given first and second vectors relative to the specified "up" vector.

Arguments

• const vec3 & v0 - First vector (from which the angular difference is measured).
• const vec3 & v1 - Second vector (to which the angular difference is measured).
• const vec3 & up - Up vector, around which the other two vectors are rotated.

Return value

Angle between the given vectors, in degrees within the range [-180.0; 180.0].

Returns a gradient value for the specified argument using four key components. The gradient value is determined as follows:
Source code
``smoothstep(gradient.x, gradient.y, x) - smoothstep(gradient.z, gradient.w, x);``
See the smoothstep() method.

Arguments

• float x - Argument.
• const vec4 & gradient - Vector with four key components.

floatinverseLerp ( float v0, float v1, float v ) #

Returns the value calculated according to the following formula: (v - v0) / (v1 - v0) clamped within 0.0f and 1.0f.

Arguments

• float v0 - The value specifying the beginning of the interval.
• float v1 - The value specifying the ending of the interval.
• float v - The value within the specified interval.

Return value

Coefficient of the value within a specified interval.

doubleinverseLerp ( double v0, double v1, double v ) #

Returns the value calculated according to the following formula: (v - v0) / (v1 - v0) clamped within 0.0 and 1.0.

Arguments

• double v0 - The value specifying the beginning of the interval.
• double v1 - The value specifying the ending of the interval.
• double v - The value within the specified interval.

Return value

Coefficient of the value within a specified interval.

vec2inverseLerp ( const vec2 & v0, const vec2 & v1, const vec2 & v ) #

Returns the vector with two float values calculated according to the following formula: (v - v0) / (v1 - v0) clamped within 0.0f and 1.0f.

Arguments

• const vec2 & v0 - Vector storing the values that specify the beginnings of the intervals.
• const vec2 & v1 - Vector storing the values that specify the endings of the intervals.
• const vec2 & v - The values within the specified intervals.

Return value

Coefficients of the values within a specified intervals.

vec3inverseLerp ( const vec3 & v0, const vec3 & v1, const vec3 & v ) #

Returns the vector with three float values calculated according to the following formula: (v - v0) / (v1 - v0) clamped within 0.0f and 1.0f.

Arguments

• const vec3 & v0 - Vector storing the values that specify the beginnings of the intervals.
• const vec3 & v1 - Vector storing the values that specify the endings of the intervals.
• const vec3 & v - The values within the specified intervals.

Return value

Coefficients of the values within a specified intervals.

vec4inverseLerp ( const vec4 & v0, const vec4 & v1, const vec4 & v ) #

Returns the vector with four float values calculated according to the following formula: (v - v0) / (v1 - v0) clamped within 0.0f and 1.0f.

Arguments

• const vec4 & v0 - Vector storing the values that specify the beginnings of the intervals.
• const vec4 & v1 - Vector storing the values that specify the endings of the intervals.
• const vec4 & v - The values within the specified intervals.

Return value

Coefficients of the values within a specified intervals.

dvec2inverseLerp ( const dvec2 & v0, const dvec2 & v1, const dvec2 & v ) #

Returns the vector with two double values calculated according to the following formula: (v - v0) / (v1 - v0) clamped within 0.0 and 1.0.

Arguments

• const dvec2 & v0 - Vector storing the values that specify the beginnings of the intervals.
• const dvec2 & v1 - Vector storing the values that specify the endings of the intervals.
• const dvec2 & v - The values within the specified intervals.

Return value

Coefficients of the values within a specified intervals.

dvec3inverseLerp ( const dvec3 & v0, const dvec3 & v1, const dvec3 & v ) #

Returns the vector with three double values calculated according to the following formula: (v - v0) / (v1 - v0) clamped within 0.0 and 1.0.

Arguments

• const dvec3 & v0 - Vector storing the values that specify the beginnings of the intervals.
• const dvec3 & v1 - Vector storing the values that specify the endings of the intervals.
• const dvec3 & v - The values within the specified intervals.

Return value

Coefficients of the values within a specified intervals.

vec4inverseLerp ( const dvec4 & v0, const dvec4 & v1, const dvec4 & v ) #

Returns the vector with four double values calculated according to the following formula: (v - v0) / (v1 - v0) clamped within 0.0 and 1.0.

Arguments

• const dvec4 & v0 - Vector storing the values that specify the beginnings of the intervals.
• const dvec4 & v1 - Vector storing the values that specify the endings of the intervals.
• const dvec4 & v - The values within the specified intervals.

Return value

Coefficients of the values within a specified intervals.

floatisrgb ( float x ) #

Converts sRGB color value to RGB format.

Arguments

• float x - sRGB value to convert.

RGB color value.

vec2isrgb ( const vec2 & color ) #

Converts sRGB color value to RGB format.

Arguments

• const vec2 & color - sRGB value to convert.

RGB color value.

vec3isrgb ( const vec3 & color ) #

Converts sRGB color value to RGB format.

Arguments

• const vec3 & color - sRGB value to convert.

RGB color value.

vec4isrgb ( const vec4 & color ) #

Converts sRGB color value and alpha to RGB format.

Arguments

• const vec4 & color - sRGB value to convert.

RGB color value.

vec4isrgbColor ( const vec4 & color ) #

Converts sRGB color value to RGB format without converting alpha.

Arguments

• const vec4 & color - sRGB value to convert.

RGB color value.

doubleitod ( int v ) #

Converts an integer value to a double value.

Arguments

• int v - Integer value.

Double value.

floatitof ( int v ) #

Converts an integer value to a float value.

Arguments

• int v - Integer value.

Float value.

Scalaritos ( int v ) #

Converts an integer value to a scalar value (float or double, depending on the precision).

Arguments

• int v - Integer value.

Return value

Scalar value (float or double, depending on the precision).

floatlength ( const vec2 & v ) #

Calculates the length of a given vector.

Arguments

• const vec2 & v - Vector.

Vector length.

doublelength ( const dvec2 & v ) #

Calculates the length of a given vector.

Arguments

• const dvec2 & v - Vector.

Vector length.

floatlength ( const vec3 & v ) #

Calculates the length of a given vector.

Arguments

• const vec3 & v - Vector.

Vector length.

doublelength ( const dvec3 & v ) #

Calculates the length of a given vector.

Arguments

• const dvec3 & v - Vector.

Vector length.

floatlength ( const vec4 & v ) #

Calculates the length of a given vector.

Arguments

• const vec4 & v - Vector.

Vector length.

doublelength ( const dvec4 & v ) #

Calculates the length of a given vector.

Arguments

• const dvec4 & v - Vector.

Vector length.

floatlength2 ( const vec2 & v ) #

Calculates the squared length of a given vector. This method is much faster than length() - the calculation is basically the same only without the slow Sqrt call. If you are using lengths simply to compare distances, then it is faster to compare squared lengths against the squares of distances as the comparison gives the same result.

Arguments

• const vec2 & v - Vector.

Return value

Squared length of the vector (X 2 + Y 2 + Z 2).

doublelength2 ( const dvec2 & v ) #

Calculates the squared length of a given vector. This method is much faster than length() - the calculation is basically the same only without the slow Sqrt call. If you are using lengths simply to compare distances, then it is faster to compare squared lengths against the squares of distances as the comparison gives the same result.

Arguments

• const dvec2 & v - Vector.

Return value

Squared length of the vector (X 2 + Y 2 + Z 2).

intlength2 ( const ivec2 & v ) #

Calculates the squared length of a given vector. If you are using lengths simply to compare distances, then it is faster to compare squared lengths against the squares of distances as the comparison gives the same result.

Arguments

• const ivec2 & v - Vector.

Return value

Squared length of the vector (X 2 + Y 2 + Z 2).

floatlength2 ( const vec3 & v ) #

Calculates the squared length of a given vector. This method is much faster than length() - the calculation is basically the same only without the slow Sqrt call. If you are using lengths simply to compare distances, then it is faster to compare squared lengths against the squares of distances as the comparison gives the same result.

Arguments

• const vec3 & v - Vector.

Return value

Squared length of the vector (X 2 + Y 2 + Z 2).

doublelength2 ( const dvec3 & v ) #

Calculates the squared length of a given vector. This method is much faster than length() - the calculation is basically the same only without the slow Sqrt call. If you are using lengths simply to compare distances, then it is faster to compare squared lengths against the squares of distances as the comparison gives the same result.

Arguments

• const dvec3 & v - Vector.

Return value

Squared length of the vector (X 2 + Y 2 + Z 2).

intlength2 ( const ivec3 & v ) #

Calculates the squared length of a given vector. If you are using lengths simply to compare distances, then it is faster to compare squared lengths against the squares of distances as the comparison gives the same result.

Arguments

• const ivec3 & v - Vector.

Return value

Squared length of the vector (X 2 + Y 2 + Z 2).

floatlength2 ( const vec4 & v ) #

Calculates the squared length of a given vector. This method is much faster than length() - the calculation is basically the same only without the slow Sqrt call. If you are using lengths simply to compare distances, then it is faster to compare squared lengths against the squares of distances as the comparison gives the same result.

Arguments

• const vec4 & v - Vector.

Return value

Squared length of the vector (X 2 + Y 2 + Z 2).

doublelength2 ( const dvec4 & v ) #

Calculates the squared length of a given vector. This method is much faster than length() - the calculation is basically the same only without the slow Sqrt call. If you are using lengths simply to compare distances, then it is faster to compare squared lengths against the squares of distances as the comparison gives the same result.

Arguments

• const dvec4 & v - Vector.

Return value

Squared length of the vector (X 2 + Y 2 + Z 2).

intlength2 ( const ivec4 & v ) #

Calculates the squared length of a given vector. If you are using lengths simply to compare distances, then it is faster to compare squared lengths against the squares of distances as the comparison gives the same result.

Arguments

• const ivec4 & v - Vector.

Return value

Squared length of the vector (X 2 + Y 2 + Z 2).

floatlerp ( float v0, float v1, float k ) #

Returns the interpolated value according to the following formula: v0 + (v 1 - v 0) * k .

Arguments

• float v0 - First float value.
• float v1 - Second float value.
• float k - Interpolation coefficient.

Return value

Interpolated value.

doublelerp ( double v0, double v1, double k ) #

Returns the interpolated value according to the following formula: v0 + (v 1 - v 0) * k .

Arguments

• double v0 - First double value.
• double v1 - Second double value.
• double k - Interpolation coefficient.

Return value

Interpolated value.

intlerp ( int v0, int v1, int k ) #

Returns the interpolated value according to the following formula: v0 + (v 1 - v 0) * k .

Arguments

• int v0 - First int value.
• int v1 - Second int value.
• int k - Interpolation coefficient.

Return value

Interpolated value.

const vec2 &lerp ( const vec2 & v0, const vec2 & v1, float k ) #

Returns the interpolated vector according to the following formula: v0 + (v 1 - v 0) * k .

Arguments

• const vec2 & v0 - First vector.
• const vec2 & v1 - Second vector.
• float k - Interpolation coefficient.

Return value

Interpolated vector.

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

Returns the interpolated vector according to the following formula: v0 + (v 1 - v 0) * k .

Arguments

• const vec3 & v0 - First vector.
• const vec3 & v1 - Second vector.
• float k - Interpolation coefficient.

Return value

Interpolated vector.

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

Returns the interpolated vector according to the following formula: v0 + (v 1 - v 0) * k .

Arguments

• const vec4 & v0 - First vector.
• const vec4 & v1 - Second vector.
• float k - Interpolation coefficient.

Return value

Interpolated vector.

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

Returns the interpolated vector according to the following formula: v0 + (v 1 - v 0) * k .

Arguments

• const dvec2 & v0 - First vector.
• const dvec2 & v1 - Second vector.
• double k - Interpolation coefficient.

Return value

Interpolated vector.

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

Returns the interpolated vector according to the following formula: v0 + (v 1 - v 0) * k .

Arguments

• const dvec3 & v0 - First vector.
• const dvec3 & v1 - Second vector.
• double k - Interpolation coefficient.

Return value

Interpolated vector.

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

Returns the interpolated vector according to the following formula: v0 + (v 1 - v 0) * k .

Arguments

• const dvec4 & v0 - First vector.
• const dvec4 & v1 - Second vector.
• double k - Interpolation coefficient.

Return value

Interpolated vector.

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

Returns the interpolated vector according to the following formula: v0 + (v 1 - v 0) * k .

Arguments

• const ivec2 & v0 - First vector.
• const ivec2 & v1 - Second vector.
• int k - Interpolation coefficient.

Return value

Interpolated vector.

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

Returns the interpolated vector according to the following formula: v0 + (v 1 - v 0) * k .

Arguments

• const ivec3 & v0 - First vector.
• const ivec3 & v1 - Second vector.
• int k - Interpolation coefficient.

Return value

Interpolated vector.

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

Returns the interpolated vector according to the following formula: v0 + (v 1 - v 0) * k .

Arguments

• const ivec4 & v0 - First vector.
• const ivec4 & v1 - Second vector.
• int k - Interpolation coefficient.

Return value

Interpolated vector.

Typelerp ( Type v0, Type v1, Type k ) #

Returns the interpolated value according to the following formula: v0 + (v 1 - v 0) * k .

Arguments

• Type v0 - First value.
• Type v1 - Second value.
• Type k - Interpolation coefficient.

Return value

Interpolated value.

floatltof ( long long v ) #

Converts a long value to a float value.

Arguments

• long long v - Long value.

Float value.

doubleltod ( long long v ) #

Converts a long value to a double value.

Arguments

• long long v - Long value.

Double value.

floatmax ( float v0, float v1 ) #

Returns the maximum value.

Arguments

• float v0 - First value.
• float v1 - Second value.

Maximum value.

doublemax ( double v0, double v1 ) #

Returns the maximum value.

Arguments

• double v0 - First value.
• double v1 - Second value.

Maximum value.

intmax ( int v0, int v1 ) #

Returns the maximum value.

Arguments

• int v0 - First value.
• int v1 - Second value.

Maximum value.

long longmax ( long long v0, long long v1 ) #

Returns the maximum value.

Arguments

• long long v0 - First value.
• long long v1 - Second value.

Maximum value.

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

Returns the maximum value.

Arguments

• const vec2 & v0 - First value.
• const vec2 & v1 - Second value.

Maximum value.

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

Returns the maximum value.

Arguments

• const vec3 & v0 - First value.
• const vec3 & v1 - Second value.

Maximum value.

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

Returns the maximum value.

Arguments

• const vec4 & v0 - First value.
• const vec4 & v1 - Second value.

Maximum value.

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

Returns the maximum value.

Arguments

• const dvec2 & v0 - First value.
• const dvec2 & v1 - Second value.

Maximum value.

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

Returns the maximum value.

Arguments

• const dvec3 & v0 - First value.
• const dvec3 & v1 - Second value.

Maximum value.

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

Returns the maximum value.

Arguments

• const dvec4 & v0 - First value.
• const dvec4 & v1 - Second value.

Maximum value.

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

Returns the maximum value.

Arguments

• const ivec2 & v0 - First value.
• const ivec2 & v1 - Second value.

Maximum value.

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

Returns the maximum value.

Arguments

• const ivec3 & v0 - First value.
• const ivec3 & v1 - Second value.

Maximum value.

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

Returns the maximum value.

Arguments

• const ivec4 & v0 - First value.
• const ivec4 & v1 - Second value.

Maximum value.

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

Returns the maximum value.

Arguments

• const bvec4 & v0 - First value.
• const bvec4 & v1 - Second value.

Maximum value.

Typemax ( Type v0, Type v1 ) #

Returns the maximum value.

Arguments

• Type v0 - First value.
• Type v1 - Second value.

Maximum value.

floatmin ( float v0, float v1 ) #

Returns the minimum value.

Arguments

• float v0 - First value.
• float v1 - Second value.

Minimum value.

doublemin ( double v0, double v1 ) #

Returns the minimum value.

Arguments

• double v0 - First value.
• double v1 - Second value.

Minimum value.

intmin ( int v0, int v1 ) #

Returns the minimum value.

Arguments

• int v0 - First value.
• int v1 - Second value.

Minimum value.

long longmin ( long long v0, long long v1 ) #

Returns the minimum value.

Arguments

• long long v0 - First value.
• long long v1 - Second value.

Minimum value.

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

Returns the minimum value.

Arguments

• const vec2 & v0 - First value.
• const vec2 & v1 - Second value.

Minimum value.

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

Returns the minimum value.

Arguments

• const vec3 & v0 - First value.
• const vec3 & v1 - Second value.

Minimum value.

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

Returns the minimum value.

Arguments

• const vec4 & v0 - First value.
• const vec4 & v1 - Second value.

Minimum value.

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

Returns the minimum value.

Arguments

• const dvec2 & v0 - First value.
• const dvec2 & v1 - Second value.

Minimum value.

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

Returns the minimum value.

Arguments

• const dvec3 & v0 - First value.
• const dvec3 & v1 - Second value.

Minimum value.

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

Returns the minimum value.

Arguments

• const dvec4 & v0 - First value.
• const dvec4 & v1 - Second value.

Minimum value.

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

Returns the minimum value.

Arguments

• const ivec2 & v0 - First value.
• const ivec2 & v1 - Second value.

Minimum value.

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

Returns the minimum value.

Arguments

• const ivec3 & v0 - First value.
• const ivec3 & v1 - Second value.

Minimum value.

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

Returns the minimum value.

Arguments

• const ivec4 & v0 - First value.
• const ivec4 & v1 - Second value.

Minimum value.

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

Returns the minimum value.

Arguments

• const bvec4 & v0 - First value.
• const bvec4 & v1 - Second value.

Minimum value.

Typemin ( Type v0, Type v1 ) #

Returns the minimum value.

Arguments

• Type v0 - First value.
• Type v1 - Second value.

Minimum value.

quatnormalize ( const quat & v ) #

Normalizes a quaternion, makes its magnitude equal to 1. When normalized, a quaternion keeps the same oreintation but its magnitude is equal to 1.

Return value

Normalized quaternion.

vec2normalize ( const vec2 & v ) #

Normalizes a vector, makes its magnitude equal to 1. When normalized, a vector keeps the same direction but its length is equal to 1.

Arguments

• const vec2 & v - A two-component vec2 vector to be normalized.

Return value

Normalized vector.

vec3normalize ( const vec3 & v ) #

Normalizes a vector, makes its magnitude equal to 1. When normalized, a vector keeps the same direction but its length is equal to 1.

Arguments

• const vec3 & v - A three-component vec3 vector to be normalized.

Return value

Normalized vector.

vec4normalize ( const vec4 & v ) #

Normalizes a vector, makes its magnitude equal to 1. When normalized, a vector keeps the same direction but its length is equal to 1.

Arguments

• const vec4 & v - A four-component vec4 vector to be normalized.

Return value

Normalized vector.

dvec2normalize ( const dvec2 & v ) #

Normalizes a vector, makes its magnitude equal to 1. When normalized, a vector keeps the same direction but its length is equal to 1.

Arguments

• const dvec2 & v - A two-component dvec2 vector to be normalized.

Return value

Normalized vector.

dvec3normalize ( const dvec3 & v ) #

Normalizes a vector, makes its magnitude equal to 1. When normalized, a vector keeps the same direction but its length is equal to 1.

Arguments

• const dvec3 & v - A three-component dvec3 vector to be normalized.

Return value

Normalized vector.

dvec4normalize ( const dvec4 & v ) #

Normalizes a vector, makes its magnitude equal to 1. When normalized, a vector keeps the same direction but its length is equal to 1.

Arguments

• const dvec4 & v - A four-component dvec4 vector to be normalized.

Return value

Normalized vector.

quatnormalizeValid ( const quat & v ) #

Normalizes a quaternion, makes its magnitude equal to 1. When normalized, a quaternion keeps the same oreintation but its magnitude is equal to 1. Check for the zero vector is performed: if the argument is a zero vector, then a zero vector is returned.

Return value

Normalized quaternion.

vec2normalizeValid ( const vec2 & v ) #

Normalizes a vector, makes its magnitude equal to 1. When normalized, a vector keeps the same direction but its length is equal to 1. Check for the zero vector is performed: if the argument is a zero vector, then a zero vector is returned.

Arguments

• const vec2 & v - A two-component vec2 vector to be normalized.

Return value

Normalized vector.

vec3normalizeValid ( const vec3 & v ) #

Normalizes a vector, makes its magnitude equal to 1. When normalized, a vector keeps the same direction but its length is equal to 1. Check for the zero vector is performed: if the argument is a zero vector, then a zero vector is returned.

Arguments

• const vec3 & v - A three-component vec3 vector to be normalized.

Return value

Normalized vector.

vec4normalizeValid ( const vec4 & v ) #

Normalizes a vector, makes its magnitude equal to 1. When normalized, a vector keeps the same direction but its length is equal to 1. Check for the zero vector is performed: if the argument is a zero vector, then a zero vector is returned.

Arguments

• const vec4 & v - A four-component vec4 vector to be normalized.

Return value

Normalized vector.

dvec2normalizeValid ( const dvec2 & v ) #

Normalizes a vector, makes its magnitude equal to 1. When normalized, a vector keeps the same direction but its length is equal to 1. Check for the zero vector is performed: if the argument is a zero vector, then a zero vector is returned.

Arguments

• const dvec2 & v - A two-component dvec2 vector to be normalized.

Return value

Normalized vector.

dvec3normalizeValid ( const dvec3 & v ) #

Normalizes a vector, makes its magnitude equal to 1. When normalized, a vector keeps the same direction but its length is equal to 1. Check for the zero vector is performed: if the argument is a zero vector, then a zero vector is returned.

Arguments

• const dvec3 & v - A three-component dvec3 vector to be normalized.

Return value

Normalized vector.

dvec4normalizeValid ( const dvec4 & v ) #

Normalizes a vector, makes its magnitude equal to 1. When normalized, a vector keeps the same direction but its length is equal to 1. Check for the zero vector is performed: if the argument is a zero vector, then a zero vector is returned.

Arguments

• const dvec4 & v - A four-component dvec4 vector to be normalized.

Return value

Normalized vector.

vec4normalize3 ( const vec4 & v ) #

Normalizes a vector making its magnitude equal to 1. The vector is normalized as if it has only the first three components (the fourth one is ignored).

Arguments

• const vec4 & v - A four-component vec4 vector to be normalized.

Return value

Normalized vector.

dvec4normalize3 ( const dvec4 & v ) #

Normalizes a vector making its magnitude equal to 1. The vector is normalized as if it has only the first three components (the fourth one is ignored).

Arguments

• const dvec4 & v - A four-component dvec4 vector to be normalized.

Return value

Normalized vector.

vec4normalizeValid3 ( const vec4 & v ) #

Normalizes a vector making its magnitude equal to 1. The vector is normalized as if it has only the first three components (the fourth one is ignored). Check for the zero vector is performed: if the argument is a zero vector, then a zero vector is returned.

Arguments

• const vec4 & v - A four-component vec4 vector to be normalized.

Return value

Normalized vector.

dvec4normalizeValid3 ( const dvec4 & v ) #

Normalizes a vector making its magnitude equal to 1. The vector is normalized as if it has only the first three components (the fourth one is ignored). Check for the zero vector is performed: if the argument is a zero vector, then a zero vector is returned.

Arguments

• const dvec4 & v - A four-component dvec4 vector to be normalized.

Return value

Normalized vector.

intnpot ( int arg ) #

Rounds up to the nearest power of two value.

Arguments

• int arg - Argument.

Return value

The nearest upper power of 2 number.

floatrcp ( float v ) #

Returns the reciprocal of the specified argument.

Arguments

• float v - Argument.

Return value

Reciprocal of the argument.

doublercp ( double v ) #

Returns the reciprocal of the specified argument.

Arguments

• double v - Argument.

Return value

Reciprocal of the argument.

doubleround ( double v ) #

Rounds an argument to the nearest integer value.
Notice
In halfway cases, when an argument has a fractional part of exactly 0.5, the function rounds away from zero to the integer with larger magnitude.
• 3.5 -> 4
• - 3.5 -> - 4
Source code
``````double a = round(2.3) 					// a = 2.0
double b = round(5.5) 					// b = 6.0
double c = round(-5.5) 					// c = -6.0``````

Arguments

• double v - Argument.

Return value

Nearest integer value to the argument.

floatround ( float v ) #

Rounds an argument to the nearest integer value.
Notice
In halfway cases, when an argument has a fractional part of exactly 0.5, the function rounds away from zero to the integer with larger magnitude.
• 3.5 -> 4
• - 3.5 -> - 4
Source code
``````float a = round(2.3) 					// a = 2.0
float b = round(5.5) 					// b = 6.0
float c = round(-5.5) 					// c = -6.0``````

Arguments

• float v - Argument.

Return value

Nearest integer value to the argument.

floatsaturate ( float v ) #

Clamps the value within the range of 0.0 to 1.0.

Arguments

• float v - Argument.

Return value

Argument value clamped within the range of 0.0 to 1.0.

doublesaturate ( double v ) #

Clamps the value within the range of 0.0 to 1.0.

Arguments

• double v - Argument.

Return value

Argument value clamped within the range of 0.0 to 1.0.

dvec2saturate ( const dvec2 & v ) #

Clamps the values of vector components within the range of 0.0 to 1.0.

vec2saturate ( const vec2 & v ) #

Clamps the values of vector components within the range of 0.0 to 1.0.

Arguments

• const vec2 & v - Vector.

Return value

Vector with components clamped within the range of 0.0 to 1.0.

dvec3saturate ( const dvec3 & v ) #

Clamps the values of vector components within the range of 0.0 to 1.0.

Arguments

• const dvec3 & v - Vector.

Return value

Vector with components clamped within the range of 0.0 to 1.0.

vec3saturate ( const vec3 & v ) #

Clamps the values of vector components within the range of 0.0 to 1.0.

Arguments

• const vec3 & v - Vector.

Return value

Vector with components clamped within the range of 0.0 to 1.0.

dvec4saturate ( const dvec4 & v ) #

Clamps the values of vector components within the range of 0.0 to 1.0.

Arguments

• const dvec4 & v - Vector.

Return value

Vector with components clamped within the range of 0.0 to 1.0.

vec4saturate ( const vec4 & v ) #

Clamps the values of vector components within the range of 0.0 to 1.0.

Arguments

• const vec4 & v - Vector.

Return value

Vector with components clamped within the range of 0.0 to 1.0.

floatsign ( float v ) #

Returns the sign of the argument.

Arguments

• float v - Argument.

Return value

Sign of the argument. 1.0 if v >= 0.0 ; -1.0 if v < 0.0.

doublesign ( double v ) #

Returns the sign of the argument.

Arguments

• double v - Argument.

Return value

Sign of the argument. 1.0 if v >= 0.0 ; -1.0 if v < 0.0.

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

Spherical interpolation between two given quaternions.

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

Resulting quaternion.

floatsmoothstep ( float x ) #

Returns a smooth Hermite interpolation between 0 and 1, if x is in the range [0, 1].

It is convenient for creating a sequence of transitions using smoothstep to interpolate each segment as an alternative to using more sophisticated or expensive interpolation techniques.

Arguments

• float x - Value to be interpolated.

Return value

One of the following values:
• 0 if x is less than 0;
• 1 if x is greater than 1;
• interpolated value between 0 and 1 if x is in the range [0, 1].

doublesmoothstep ( double x ) #

Returns a smooth Hermite interpolation between 0 and 1, if x is in the range [0, 1].

It is convenient for creating a sequence of transitions using smoothstep to interpolate each segment as an alternative to using more sophisticated or expensive interpolation techniques.

Arguments

• double x - Value to be interpolated.

Return value

One of the following values:
• 0 if x is less than 0;
• 1 if x is greater than 1;
• interpolated value between 0 and 1 if x is in the range [0, 1].

floatsmoothstep ( float edge0, float edge1, float x ) #

Returns a smooth Hermite interpolation between 0 and 1, if x is in the range [edge0, edge1].

It is convenient for creating a sequence of transitions using smoothstep to interpolate each segment as an alternative to using more sophisticated or expensive interpolation techniques.

Arguments

• float edge0 - Left edge value.
• float edge1 - Right edge value.
• float x - Value to be interpolated.

Return value

One of the following values:
• 0 if x is less than edge0;
• 1 if x is greater than edge1;
• interpolated value between 0 and 1 if x is in the range [edge0, edge1].

doublesmoothstep ( double edge0, double edge1, double x ) #

Returns a smooth Hermite interpolation between 0 and 1, if x is in the range [edge0, edge1].

It is convenient for creating a sequence of transitions using smoothstep to interpolate each segment as an alternative to using more sophisticated or expensive interpolation techniques.

Arguments

• double edge0 - Left edge value.
• double edge1 - Right edge value.
• double x - Value to be interpolated.

Return value

One of the following values:
• 0 if x is less than edge0;
• 1 if x is greater than edge1;
• interpolated value between 0 and 1 if x is in the range [edge0, edge1].

floatsmootherstep ( float x ) #

Returns a smooth interpolation between 0 and 1 using a fifth-order polynomial function, if x is in the range [0, 1].

It is convenient for creating a sequence of transitions using smoothstep to interpolate each segment as an alternative to using more sophisticated or expensive interpolation techniques.

Arguments

• float x - Value to be interpolated.

Return value

One of the following values:
• 0 if x is less than 0;
• 1 if x is greater than 1;
• interpolated value between 0 and 1 if x is in the range [0, 1].

doublesmootherstep ( double x ) #

Returns a smooth interpolation between 0 and 1 using a fifth-order polynomial function, if x is in the range [0, 1].

It is convenient for creating a sequence of transitions using smoothstep to interpolate each segment as an alternative to using more sophisticated or expensive interpolation techniques.

Arguments

• double x - Value to be interpolated.

Return value

One of the following values:
• 0 if x is less than 0;
• 1 if x is greater than 1;
• interpolated value between 0 and 1 if x is in the range [0, 1].

floatsmootherstep ( float edge0, float edge1, float x ) #

Returns a smooth interpolation between 0 and 1 using a fifth-order polynomial function, if x is in the range [edge0, edge1].

It is convenient for creating a sequence of transitions using smoothstep to interpolate each segment as an alternative to using more sophisticated or expensive interpolation techniques.

Arguments

• float edge0 - Left edge value.
• float edge1 - Right edge value.
• float x - Value to be interpolated.

Return value

One of the following values:
• 0 if x is less than edge0;
• 1 if x is greater than edge1;
• interpolated value between 0 and 1 if x is in the range [edge0, edge1].

doublesmootherstep ( double edge0, double edge1, double x ) #

Returns a smooth interpolation between 0 and 1 using a fifth-order polynomial function, if x is in the range [edge0, edge1].

It is convenient for creating a sequence of transitions using smoothstep to interpolate each segment as an alternative to using more sophisticated or expensive interpolation techniques.

Arguments

• double edge0 - Left edge value.
• double edge1 - Right edge value.
• double x - Value to be interpolated.

Return value

One of the following values:
• 0 if x is less than edge0;
• 1 if x is greater than edge1;
• interpolated value between 0 and 1 if x is in the range [edge0, edge1].

floatsrgb ( float x ) #

Converts RGB color value to sRGB format.

Arguments

• float x - Value to convert.

Return value

sRGB color value.

vec2srgb ( const vec2 & color ) #

Converts RGB color value to sRGB format.

Arguments

• const vec2 & color - Value to convert.

Return value

sRGB color value.

vec3srgb ( const vec3 & color ) #

Converts RGB color value to sRGB format.

Arguments

• const vec3 & color - Value to convert.

Return value

sRGB color value.

vec4srgb ( const vec4 & color ) #

Converts RGB color value and alpha to sRGB format.

Arguments

• const vec4 & color - Value to convert.

Return value

sRGB color value.

vec4srgbColor ( const vec4 & color ) #

Converts RGB color value to sRGB format without converting alpha.

Arguments

• const vec4 & color - Value to convert.

Return value

sRGB color value.

intstoi ( Scalar v ) #

Converts a scalar value (float or double, depending on the precision) to an integer value.

Arguments

• Scalar v - Scalar value (float or double, depending on the precision).

Integer value.

voidswap ( Type & v0, Type & v1 ) #

Swaps two values.

Arguments

• Type & v0 - First value.
• Type & v1 - 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.

floattoFloat ( double v ) #

Converts a double value to a float value.

Arguments

• double v - Double value.

Float value.

floattoFloat ( long double v ) #

Converts a long double value to a float value.

Arguments

• long double v - Long double value.

Float value.

floattoFloat ( char v ) #

Converts a character value to a float value.

Arguments

• char v - Char value.

Float value.

floattoFloat ( int v ) #

Converts an integer value to a float value.

Arguments

• int v - Integer value.

Float value.

floattoFloat ( long long v ) #

Converts a long value to a float value.

Arguments

• long long v - Long value.

Float value.

floattoFloat ( unsigned int v ) #

Converts an unsigned int value to a float value.

Arguments

• unsigned int v - Unsigned int value.

Float value.

floattoFloat ( unsigned char v ) #

Converts an unsigned char value to a float value.

Arguments

• unsigned char v - Unsigned char value.

Float value.

floattoFloat ( bool v ) #

Converts a boolean value to a float value.

Arguments

• bool v - Boolean value.

Float value.

floattoFloat ( half v ) #

Converts a half value to a float value.

Arguments

• half v - Half value.

Float value.

floattoFloat ( const String & v ) #

Converts a const String value to a float value.

Arguments

• const String & v - const String value.

Float value.

floattoFloat ( const char * v ) #

Converts a const char pointer value to a float value.

Arguments

• const char * v - const char ptr value.

Float value.

halftoHalf ( float v ) #

Converts a float value to a half value.

Arguments

• float v - Float value.

Half value.

halftoHalf ( double v ) #

Converts a double value to a half value.

Arguments

• double v - Double value.

Half value.

halftoHalf ( long double v ) #

Converts a long double value to a half value.

Arguments

• long double v - Long double value.

Half value.

halftoHalf ( char v ) #

Converts a char value to a half value.

Arguments

• char v - Char value.

Half value.

halftoHalf ( int v ) #

Converts an int value to a half value.

Arguments

• int v - Int value.

Half value.

halftoHalf ( long long v ) #

Converts a long long value to a half value.

Arguments

• long long v - Long long value.

Half value.

halftoHalf ( unsigned int v ) #

Converts an unsigned int value to a half value.

Arguments

• unsigned int v - Unsigned int value.

Half value.

halftoHalf ( unsigned char v ) #

Converts an unsigned char value to a half value.

Arguments

• unsigned char v - Unsigned char value.

Half value.

halftoHalf ( bool v ) #

Converts a bool value to a half value.

Arguments

• bool v - Bool value.

Half value.

halftoHalf ( const String & v ) #

Converts a const String value to a half value.

Arguments

• const String & v - Const String value.

Half value.

halftoHalf ( const char * v ) #

Converts a const char pointer value to a half value.

Arguments

• const char * v - Const char ptr value.

Half value.

doubletoDouble ( float value ) #

Converts a float value to a double value.

Arguments

• float value - Float value.

Double value.

doubletoDouble ( char value ) #

Converts a character value to a double value.

Arguments

• char value - Char value.

Double value.

doubletoDouble ( int value ) #

Converts an integer value to a double value.

Arguments

• int value - Integer value.

Double value.

doubletoDouble ( long long value ) #

Converts a long value to a double value.

Arguments

• long long value - Long value.

Double value.

doubletoDouble ( bool value ) #

Converts a boolean value to a double value.

Arguments

• bool value - Boolean value.

Double value.

doubletoDouble ( unsigned int v ) #

Converts an unsigned int value to a double value.

Arguments

• unsigned int v - Unsigned int value.

Double value.

doubletoDouble ( unsigned char v ) #

Converts an unsigned char value to a double value.

Arguments

• unsigned char v - Unsigned char value.

Double value.

doubletoDouble ( half v ) #

Converts a half value to a double value.

Arguments

• half v - Half value.

Double value.

doubletoDouble ( const String & v ) #

Converts a const String value to a double value.

Arguments

• const String & v - const String value.

Double value.

doubletoDouble ( const char * v ) #

Converts a const char pointer value to double value.

Arguments

• const char * v - const char ptr value.

Double value.

ScalartoScalar ( double value ) #

Converts a double value to a Scalar value.

Arguments

• double value - Double value.

Scalar value.

ScalartoScalar ( long double value ) #

Converts a long double value to a Scalar value.

Arguments

• long double value - Long double value.

Scalar value.

ScalartoScalar ( float value ) #

Converts a float value to a Scalar value.

Arguments

• float value - Float value.

Scalar value.

ScalartoScalar ( char value ) #

Converts a char value to a Scalar value.

Arguments

• char value - Char value.

Scalar value.

ScalartoScalar ( int value ) #

Converts an int value to a Scalar value.

Arguments

• int value - Int value.

Scalar value.

ScalartoScalar ( long long value ) #

Converts a long long value to a Scalar value.

Arguments

• long long value - Long long value.

Scalar value.

ScalartoScalar ( unsigned int value ) #

Converts an unsigned int value to a Scalar value.

Arguments

• unsigned int value - Unsigned int value.

Scalar value.

ScalartoScalar ( unsigned char value ) #

Converts an unsigned char value to a Scalar value.

Arguments

• unsigned char value - Unsigned char value.

Scalar value.

ScalartoScalar ( bool value ) #

Converts a bool value to a Scalar value.

Arguments

• bool value - Bool value.

Scalar value.

ScalartoScalar ( half value ) #

Converts a half value to a Scalar value.

Arguments

• half value - Half value.

Scalar value.

ScalartoScalar ( const String & value ) #

Converts a const String value to a Scalar value.