This page has been translated automatically.
Programming
Fundamentals
Setting Up Development Environment
UnigineScript
High-Level Systems
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
Rendering-Related Classes
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Math Common Functions

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

float abs(float v)

Absolute value.

Arguments

  • float v - The float value.

double abs(double v)

Absolute value.

Arguments

  • double v - The doublevalue.

double clamp(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.

float clamp(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.

int clamp(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.

int compare(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.

int compare(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.

int compare(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.

int compare(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.

ivec3 cross(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.

dvec3 cross(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.

vec3 cross(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.

float dot(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.

float dot(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.

float dot(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.

float dot(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.

float dot(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.

int dot(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.

int dot(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.

int dot(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.

int dot(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.

double dot(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.

double dot(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.

double dot(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.

double dot(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.

float length2(const vec2 & v)

Get the squared length of the three component vector.

Arguments

  • const vec2 & v - The value of the vector.

Return value

The squared length of the vector.

float length2(const vec3 & v)

Get the squared length of the three component vector.

Arguments

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

Return value

The squared length of the vector.

float length2(const vec4 & v)

Get the squared length of the four component vector.

Arguments

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

Return value

The squared length of the vector.

double length2(const dvec3 & v)

Get the squared length of the three component vector.

Arguments

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

Return value

The squared length of the vector.

double length2(const dvec4 & v)

Get the squared length of the four component vector.

Arguments

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

Return value

The squared length of the vector.

int length2(const ivec2 & v)

Get the squared length of the three component vector.

Arguments

  • const ivec2 & v - The value of the vector.

Return value

The squared length of the vector.

int length2(const ivec3 & v)

Get the squared length of the three component vector.

Arguments

  • const ivec3 & v - The value of the vector.

Return value

The squared length of the vector.

int length2(const ivec4 & v)

Get the squared length of the three component vector.

Arguments

  • const ivec4 & v - The value of the vector.

Return value

The squared length of the vector.

float length(const vec4 & v)

Get the length of the four component vector.

Arguments

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

Return value

The length of the vector.

double length(const dvec2 & v)

Get the length of the three component vector.

Arguments

  • const dvec2 & v - The value of the vector.

Return value

The length of the vector.

double length(const dvec3 & v)

Get the length of the three component vector.

Arguments

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

Return value

The length of the vector.

double length(const dvec4 & v)

Get the length of the four component vector.

Arguments

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

Return value

The length of the vector.

float length(const vec2 & v)

Get the length of the three component vector.

Arguments

  • const vec2 & v - The value of the vector.

Return value

The length of the vector.

float length(const vec3 & v)

Get the length of the three component vector.

Arguments

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

Return value

The length of the vector.

float lerp(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.

double lerp(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.

int lerp(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.

vec2 lerp(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 - Interolation coefficient.

Return value

The interpolated value.

vec3 lerp(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 - Interolation coefficient.

Return value

The interpolated value.

vec4 lerp(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 - Interolation coefficient.

Return value

The interpolated value.

dvec2 lerp(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 - Interolation coefficient.

Return value

The interpolated value.

dvec3 lerp(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 - Interolation coefficient.

Return value

The interpolated value.

dvec4 lerp(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 - Interolation coefficient.

Return value

The interpolated value.

ivec2 lerp(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 - Interolation coefficient.

Return value

The interpolated value.

ivec3 lerp(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 - Interolation coefficient.

Return value

The interpolated value.

ivec4 lerp(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 - Interolation coefficient.

Return value

The interpolated value.

Type lerp(Type v0, Type v1, Type k)

Returns the interpolated value.

Arguments

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

Return value

The interpolated value.

float max(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.

double max(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.

int max(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.

vec2 max(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.

vec3 max(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.

vec4 max(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.

dvec2 max(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.

dvec3 max(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.

dvec4 max(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.

ivec2 max(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.

ivec3 max(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.

ivec4 max(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.

bvec4 max(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.

Type max(Type v0, Type v1)

Returns the maximum value.

Arguments

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

Return value

The maximum value.

float min(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.

double min(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.

int min(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.

vec2 min(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.

vec3 min(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.

vec4 min(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.

dvec2 min(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.

dvec3 min(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.

dvec4 min(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.

ivec2 min(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.

ivec3 min(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.

ivec4 min(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.

bvec4 min(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.

Type min(Type v0, Type v1)

Returns the minimum value.

Arguments

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

Return value

The minimum value.

vec2 normalize(const vec2 & v)

Normalize the vector.

Arguments

  • const vec2 & v - The value of the vector.

Return value

The normalized vector.

vec3 normalize(const vec3 & v)

Normalize the vector.

Arguments

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

Return value

The normalized vector.

vec4 normalize(const vec4 & v)

Normalize the vector.

Arguments

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

Return value

The normalized vector.

dvec2 normalize(const dvec2 & v)

Normalize the vector.

Arguments

  • const dvec2 & v - The value of the vector.

Return value

The normalized vector.

dvec3 normalize(const dvec3 & v)

Normalize the vector.

Arguments

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

Return value

The normalized vector.

dvec4 normalize(const dvec4 & v)

Normalize the vector.

Arguments

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

Return value

The normalized vector.

quat normalize(const quat & q)

Normalize quaternion.

Arguments

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

Return value

The resulting quaternion.

int operator==(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.

int operator!=(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.

float normalizeAngle(float angle)

Normalizes the angle in [-180,180] range.

Arguments

  • float angle - Input angle.

Return value

Normalized angle.

void orthoBasis(const vec3 & v, vec3 & tangent, vec3 & binormal)

Creates an ortho basis.

Arguments

  • const vec3 & v - Input vector.
  • vec3 & tangent - Output tangent vector.
  • vec3 & binormal - Output binormal vector.

void orthoBasis(const dvec3 & v, dvec3 & tangent, dvec3 & binormal)

Creates an ortho basis.

Arguments

  • const dvec3 & v - Input vector.
  • dvec3 & tangent - Output tangent vector.
  • dvec3 & binormal - Output binormal vector.

void orthoTransform(const vec3 & v, mat4 & transform)

Creates an ortho transformation.

Arguments

  • const vec3 & v - Input vector.
  • mat4 & transform - Ortho transformation.

void orthoTransform(const dvec3 & v, dmat4 & transform)

Creates an ortho transformation.

Arguments

  • const dvec3 & v - Input vector.
  • dmat4 & transform - Ortho transformation.

float triangleArea(const vec3 & v0, const vec3 & v1, const vec3 & v2)

Calculates a triangle area.

Arguments

  • const vec3 & v0 - The first triangle vertex.
  • const vec3 & v1 - The second triangle vertex.
  • const vec3 & v2 - The third triangle vertex.

Return value

The triangle area.

double triangleArea(const dvec3 & v0, const dvec3 & v1, const dvec3 & v2)

Calculates a triangle area.

Arguments

  • const dvec3 & v0 - The first triangle vertex.
  • const dvec3 & v1 - The second triangle vertex.
  • const dvec3 & v2 - The third triangle vertex.

Return value

The triangle area.

vec3 triangleNormal(const vec3 & v0, const vec3 & v1, const vec3 & v2)

Calculates a triangle normal vector.

Arguments

  • const vec3 & v0 - The first triangle vertex.
  • const vec3 & v1 - The second triangle vertex.
  • const vec3 & v2 - The third triangle vertex.

Return value

The triangle normal vector.

dvec3 triangleNormal(const dvec3 & v0, const dvec3 & v1, const dvec3 & v2)

Calculates a triangle normal vector.

Arguments

  • const dvec3 & v0 - The first triangle vertex.
  • const dvec3 & v1 - The second triangle vertex.
  • const dvec3 & v2 - The third triangle vertex.

Return value

The triangle normal vector.

vec4 trianglePlane(const vec3 & v0, const vec3 & v1, const vec3 & v2)

Calculates a triangle plane.

Arguments

  • const vec3 & v0 - The first triangle vertex.
  • const vec3 & v1 - The second triangle vertex.
  • const vec3 & v2 - The third triangle vertex.

Return value

The triangle plane.

dvec4 trianglePlane(const dvec3 & v0, const dvec3 & v1, const dvec3 & v2)

Calculates a triangle plane.

Arguments

  • const dvec3 & v0 - The first triangle vertex.
  • const dvec3 & v1 - The second triangle vertex.
  • const dvec3 & v2 - The third triangle vertex.

Return value

The triangle plane.

vec4 triangleTangent(const vec3 & v0, const vec3 & v1, const vec3 & v2)

Calculates a triangle tangent space.

Arguments

  • const vec3 & v0 - The first triangle vertex.
  • const vec3 & v1 - The second triangle vertex.
  • const vec3 & v2 - The third triangle vertex.

Return value

The triangle tangent space vector.

vec4 triangleTangent(const vec3 & v0, const vec3 & v1, const vec3 & v2, const vec2 & t0, const vec2 & t1, const vec2 & t2)

Calculates a triangle tangent space.

Arguments

  • const vec3 & v0 - The first triangle vertex.
  • const vec3 & v1 - The second triangle vertex.
  • const vec3 & v2 - The third triangle vertex.
  • const vec2 & t0 - The tangent vector of the first triangle vertex.
  • const vec2 & t1 - The tangent vector of the second triangle vertex.
  • const vec2 & t2 - The tangent vector of the third triangle vertex.

Return value

The triangle tangent space vector.

int pointTriangleInside(const vec3 & point, const vec3 & v0, const vec3 & v1, const vec3 & v2)

Checks if the point is inside the triangle.

Arguments

  • const vec3 & point - The point.
  • const vec3 & v0 - The first triangle vertex.
  • const vec3 & v1 - The second triangle vertex.
  • const vec3 & v2 - The third triangle vertex.

Return value

1 if the point is inside the triangle; otherwise, 0.

int pointTriangleInside(const dvec3 & point, const dvec3 & v0, const dvec3 & v1, const dvec3 & v2)

Checks if the point is inside the triangle.

Arguments

  • const dvec3 & point - The point.
  • const dvec3 & v0 - The first triangle vertex.
  • const dvec3 & v1 - The second triangle vertex.
  • const dvec3 & v2 - The third triangle vertex.

Return value

1 if the point is inside the triangle; otherwise, 0.

float pointTriangleDistance(const vec3 & point, const vec3 & v0, const vec3 & v1, const vec3 & v2, const vec4 & plane)

Calculates the closest distance to the triangle.

Arguments

  • const vec3 & point - The point.
  • const vec3 & v0 - The first triangle vertex.
  • const vec3 & v1 - The second triangle vertex.
  • const vec3 & v2 - The third triangle vertex.
  • const vec4 & plane - Triangle plane.

Return value

Return the closest distance to the triangle.

double pointTriangleDistance(const dvec3 & point, const dvec3 & v0, const dvec3 & v1, const dvec3 & v2, const dvec4 & plane)

Calculates the closest distance to the triangle.

Arguments

  • const dvec3 & point - The point.
  • const dvec3 & v0 - The first triangle vertex.
  • const dvec3 & v1 - The second triangle vertex.
  • const dvec3 & v2 - The third triangle vertex.
  • const dvec4 & plane - Triangle plane.

Return value

Return the closest distance to the triangle.

void pointTriangleCoordinates(const vec3 & point, const vec3 & v0, const vec3 & v1, const vec3 & v2, float & a, float & b)

Calculates barycentric triangle coordinates.

Arguments

  • const vec3 & point - The point.
  • const vec3 & v0 - The first triangle vertex.
  • const vec3 & v1 - The second triangle vertex.
  • const vec3 & v2 - The third triangle vertex.
  • float & a - The first barycentric coordinate.
  • float & b - The second barycentric coordinate.

void pointTriangleCoordinates(const dvec3 & point, const dvec3 & v0, const dvec3 & v1, const dvec3 & v2, double & a, double & b)

Calculates barycentric triangle coordinates.

Arguments

  • const dvec3 & point - The point.
  • const dvec3 & v0 - The first triangle vertex.
  • const dvec3 & v1 - The second triangle vertex.
  • const dvec3 & v2 - The third triangle vertex.
  • double & a - The first barycentric coordinate.
  • double & b - The second barycentric coordinate.

void getClosestPointOnLine(const vec3 & point, const vec3 & p0, const vec3 & p1, vec3 & ret)

Calculates the closest point on the line.

Arguments

  • const vec3 & point - The point.
  • const vec3 & p0 - The first line point.
  • const vec3 & p1 - The second line point.
  • vec3 & ret - Closest point on the line.

void getClosestPointOnLine(const dvec3 & point, const dvec3 & p0, const dvec3 & p1, dvec3 & ret)

Calculates the closest point on the line.

Arguments

  • const dvec3 & point - The point.
  • const dvec3 & p0 - The first line point.
  • const dvec3 & p1 - The second line point.
  • dvec3 & ret - Closest point on the line.

int getClosestPointOnTriangle(const vec3 & point, const vec3 & v0, const vec3 & v1, const vec3 & v2, vec3 & ret)

Calculates the closest point on the triangle.

Arguments

  • const vec3 & point - The point.
  • const vec3 & v0 - The first triangle vertex.
  • const vec3 & v1 - The second triangle vertex.
  • const vec3 & v2 - The third triangle vertex.
  • vec3 & ret - Closest point on the triangle.

Return value

1 if the point is inside the triangle; otherwise, 0.

int getClosestPointOnTriangle(const dvec3 & point, const dvec3 & v0, const dvec3 & v1, const dvec3 & v2, dvec3 & ret)

Calculates the closest point on the triangle.

Arguments

  • const dvec3 & point - The point.
  • const dvec3 & v0 - The first triangle vertex.
  • const dvec3 & v1 - The second triangle vertex.
  • const dvec3 & v2 - The third triangle vertex.
  • dvec3 & ret - Closest point on the triangle.

Return value

1 if the point is inside the triangle; otherwise, 0.

int getClosestPointsOnLines(const vec3 & p00, const vec3 & p01, const vec3 & p10, const vec3 & p11, vec3 & ret_0, vec3 & ret_1)

Calculate the closest points on the lines.

Arguments

  • const vec3 & p00 - The first line point.
  • const vec3 & p01 - The first line point.
  • const vec3 & p10 - The second line point.
  • const vec3 & p11 - The second line point.
  • vec3 & ret_0 - Closest point on the first line.
  • vec3 & ret_1 - Closest point on the second line.

Return value

1 if the lines are crossed; otherwise, 0.

int getClosestPointsOnLines(const dvec3 & p00, const dvec3 & p01, const dvec3 & p10, const dvec3 & p11, dvec3 & ret_0, dvec3 & ret_1)

Calculates the closest points on the lines.

Arguments

  • const dvec3 & p00 - The first line point.
  • const dvec3 & p01 - The first line point.
  • const dvec3 & p10 - The second line point.
  • const dvec3 & p11 - The second line point.
  • dvec3 & ret_0 - Closest point on the first line.
  • dvec3 & ret_1 - Closest point on the second line.

Return value

1 if the lines are crossed; otherwise, 0.

int operator==(const vec2 & v0, const vec2 & v1)

Vector equal comparison.

Arguments

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

int operator!=(const vec2 & v0, const vec2 & v1)

Vector not equal comparison.

Arguments

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

vec2 operator*(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.

vec2 operator*(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.

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

Vector addition.

Arguments

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

Return value

The resulting vector.

vec2 operator-(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.

vec2 clamp(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.

int operator==(const vec3 & v0, const vec3 & v1)

Vector equal comparison.

Arguments

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

int operator!=(const vec3 & v0, const vec3 & v1)

Vector not equal comparison.

Arguments

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

vec3 operator*(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.

vec3 operator*(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.

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

Vector addition.

Arguments

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

Return value

The resulting vector.

vec3 operator-(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.

vec3 clamp(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.

int operator==(const vec4 & v0, const vec4 & v1)

Vector equal comparison.

Arguments

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

int operator!=(const vec4 & v0, const vec4 & v1)

Vector not equal comparison.

Arguments

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

vec4 operator*(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.

vec4 operator*(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.

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

Vector addition.

Arguments

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

Return value

The resulting vector.

vec4 operator-(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.

vec4 clamp(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.

int operator==(const dvec2 & v0, const dvec2 & v1)

Vector equal comparison.

Arguments

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

int operator!=(const dvec2 & v0, const dvec2 & v1)

Vector not equal comparison.

Arguments

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

dvec2 operator*(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.

dvec2 operator*(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.

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

Vector addition.

Arguments

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

Return value

The resulting vector.

dvec2 operator-(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.

double dot(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.

dvec2 clamp(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.

int operator==(const dvec3 & v0, const dvec3 & v1)

Vector equal comparison.

Arguments

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

int operator!=(const dvec3 & v0, const dvec3 & v1)

Vector not equal comparison.

Arguments

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

dvec3 operator*(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.

dvec3 operator*(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.

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

Vector addition.

Arguments

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

Return value

The resulting vector.

dvec3 operator-(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.

dvec3 clamp(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.

int operator==(const dvec4 & v0, const dvec4 & v1)

Vector equal comparison.

Arguments

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

int operator!=(const dvec4 & v0, const dvec4 & v1)

Vector not equal comparison.

Arguments

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

dvec4 operator*(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.

dvec4 operator*(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.

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

Vector addition.

Arguments

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

Return value

The resulting vector.

dvec4 operator-(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.

dvec4 clamp(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.

int operator==(const ivec2 & v0, const ivec2 & v1)

Vector equal comparison.

Arguments

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

int operator!=(const ivec2 & v0, const ivec2 & v1)

Vector not equal comparison.

Arguments

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

ivec2 operator*(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.

ivec2 operator*(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.

ivec2 operator/(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.

ivec2 operator/(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.

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

Vector addition.

Arguments

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

Return value

The resulting vector.

ivec2 operator-(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.

ivec2 operator<<(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.

ivec2 operator>>(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.

ivec2 clamp(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.

int operator==(const ivec3 & v0, const ivec3 & v1)

Vector equal comparison.

Arguments

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

int operator!=(const ivec3 & v0, const ivec3 & v1)

Vector not equal comparison.

Arguments

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

ivec3 operator*(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.

ivec3 operator*(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.

ivec3 operator/(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.

ivec3 operator/(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.

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

Vector addition.

Arguments

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

Return value

The resulting vector.

ivec3 operator-(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.

ivec3 operator<<(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.

ivec3 operator>>(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.

ivec3 clamp(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.

int operator==(const ivec4 & v0, const ivec4 & v1)

Vector equal comparison.

Arguments

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

int operator!=(const ivec4 & v0, const ivec4 & v1)

Vector not equal comparison.

Arguments

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

ivec4 operator*(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.

ivec4 operator*(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.

ivec4 operator/(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.

ivec4 operator/(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.

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

Vector addition.

Arguments

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

Return value

The resulting vector.

ivec4 operator-(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.

ivec4 operator<<(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.

ivec4 operator>>(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.

ivec4 clamp(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.

int operator==(const bvec4 & v0, const bvec4 & v1)

Vector equal comparison.

Arguments

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

int operator!=(const bvec4 & v0, const bvec4 & v1)

Vector not equal comparison.

Arguments

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

bvec4 clamp(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.

int operator==(const mat4 & m0, const mat4 & m1)

Matrix equal comparison.

Arguments

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

int operator!=(const mat4 & m0, const mat4 & m1)

Matrix not equal comparison.

Arguments

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

mat4 operator*(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.

vec3 operator*(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.

vec3 operator*(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.

vec4 operator*(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.

vec4 operator*(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.

dvec3 operator*(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.

dvec3 operator*(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.

dvec4 operator*(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.

dvec4 operator*(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.

mat4 operator*(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.

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

Matrix addition.

Arguments

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

Return value

The resulting matrix.

mat4 operator-(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.

mat4 hardwareProjection(const mat4 & projection)

Return hardware projection matrix.

Arguments

  • const mat4 & projection - Projection matrix.

Return value

The hardware projection matrix.

void decomposeTransform(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.

mat4 composeTransform(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.

void decomposeTransform(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.

mat4 composeTransform(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.

void decomposeProjection(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.

int operator==(const dmat4 & m0, const dmat4 & m1)

Matrix equal comparison.

Arguments

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

int operator!=(const dmat4 & m0, const dmat4 & m1)

Matrix not equal comparison.

Arguments

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

dmat4 operator*(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.

vec3 operator*(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.

vec3 operator*(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.

vec4 operator*(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.

vec4 operator*(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.

dvec3 operator*(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.

dvec3 operator*(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.

dvec4 operator*(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.

dvec4 operator*(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.

dmat4 operator*(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.

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

Matrix addition.

Arguments

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

Return value

The resulting matrix.

dmat4 operator-(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.

dmat4 rotation(const dmat4 & m)

Return rotation matrix.

Arguments

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

Return value

The resulting matrix.

void decomposeTransform(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.

dmat4 composeTransform(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.

int operator==(const quat & q0, const quat & q1)

Quaternion equal comparison.

Arguments

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

int operator!=(const quat & q0, const quat & q1)

Quaternion not equal comparison.

Arguments

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

quat operator*(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.

vec3 operator*(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.

vec3 operator*(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.

dvec3 operator*(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.

dvec3 operator*(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.

quat operator*(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.

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

Quaternion addition.

Arguments

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

Return value

The resulting quaternion.

quat operator-(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.

quat slerp(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.

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

String addition.

Arguments

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

String operator+()

String operator+()

int operator==(const String & s0, const String & s1)

String equal comparison.

Arguments

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

int operator==()

int operator==()

int operator!=(const String & s0, const String & s1)

String not equal comparison.

Arguments

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

int operator!=()

int operator!=()

int operator<(const String & s0, const String & s1)

String less than comparison.

Arguments

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

int operator<()

int operator<()

int operator>(const String & s0, const String & s1)

String greater than comparison.

Arguments

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

int operator>()

int operator>()

int operator<=(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.

int operator<=()

int operator<=()

int operator>=(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.

int operator>=()

int operator>=()

int operator==(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.

int operator!=(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.

Type clamp(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.

void swap(Type & v0, Type & v1)

Swaps two values.

Arguments

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

void swap(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
Build: ()