Summary

Math | |

vec3 | Three dimensional vector. |

Constructors | |

vec3. | Initializes this vector to the value of another. |

vec3. | Initializes all elements of this vector to a value. |

vec3. | Initializes the elements of this vector to the provided values. |

Elements | |

x | Returns the x element of this vector. |

y | Returns the y element of this vector. |

z | Returns the z element of this vector. |

Operators | |

operator== | Returns true if the vectors are equal. |

operator+ | Add two vectors. |

operator- | Subtract two vectors. |

operator* | Multiply two vectors. |

operator/ | Divide two vectors. |

Operations | |

dot | Dot product of two vectors. |

length | Returns the length of the vector. |

div | Divides two vectors element-wise. |

div_scalar | Divides a vector by a scalar. |

mul_scalar | Multiplies a vector by a scalar. |

round | Rounds each component of the vector to the nearest integer. |

cross | Computes the cross product of two vectors. |

normalize | Normalizes the vector. |

mul_quat | Multiplies a vector by a quaternion. |

mod | Rounds and then performs a modulo operation on each component. |

NKToString | Returns the vector formatted as a string |

NKGetXYZ | Returns the X, Y and Z components of this Vec3. |

NKSetXYZ | Sets the X, Y and Z components of this Vec3. |

NKLength | Returns the magnitude of this vector. |

NKNormalize | Returns a normalized vector. |

NKRotateByQuaternion | Rotates a vector by a given quaternion. |

quat | Quaternion. |

Constructors | |

quat. | Initializes this quaternion from an angle and axis. |

quat. | Initializes this quaternion using an XYZ Euler angle representation. |

quat. | Initializes this quaternion to the value of another. |

quat. | Initializes the elements of this quaternion to the provided values. |

Elements | |

w | Returns the w element of this quaternion. |

x | Returns the x element of this quaternion. |

y | Returns the y element of this quaternion. |

z | Returns the z element of this quaternion. |

Operations | |

normalize | Returns this quaternion, normalized. |

rotate | Returns the quaternion resulting from the rotation of this quaternion around a specific axis. |

Operators | |

operator== | Returns true if the quaternions are equal. |

operator* | Multiply two quaternion. |

Functions | |

Forward | Returns the vector facing in the direction of this rotation. |

Right | Returns the right vector of this quaternion. |

Up | Returns the up vector of this quaternion. |

NKToString | Returns the quaternion formatted as a string |

NKGetXYZW | Returns the X, Y, Z and W components of this Quat. |

NKSetXYZW | Sets the X, Y, Z and W components of this Quat. |

NKGetInverse | Returns the inverse of this quaternion. |

GLM | Static math functions. |

Static Utility | |

Lerp | Lerp between two vectors by weight. |

Rotate | Static helper to rotate a quat by an explicit axis and angle. |

Ceil | Returns a value equal to the nearest integer that is greater than or equal to x. |

Floor | Returns a value equal to the nearest integer that is less than or equal to x. |

Cross3 | Computes the cross product of two vec3s, represented by 6 floats. |

CrossVec3 | Computes the cross product of two vectors. |

Angle | Helper to find the rotation between two vectors. |

LookAt | Helper to find the orientation between a source point and a target point. |

Slerp | Slerp between two vectors by weight. |

Three dimensional vector.

Summary

Constructors | |

vec3. | Initializes this vector to the value of another. |

vec3. | Initializes all elements of this vector to a value. |

vec3. | Initializes the elements of this vector to the provided values. |

Elements | |

x | Returns the x element of this vector. |

y | Returns the y element of this vector. |

z | Returns the z element of this vector. |

Operators | |

operator== | Returns true if the vectors are equal. |

operator+ | Add two vectors. |

operator- | Subtract two vectors. |

operator* | Multiply two vectors. |

operator/ | Divide two vectors. |

Operations | |

dot | Dot product of two vectors. |

length | Returns the length of the vector. |

div | Divides two vectors element-wise. |

div_scalar | Divides a vector by a scalar. |

mul_scalar | Multiplies a vector by a scalar. |

round | Rounds each component of the vector to the nearest integer. |

cross | Computes the cross product of two vectors. |

normalize | Normalizes the vector. |

mul_quat | Multiplies a vector by a quaternion. |

mod | Rounds and then performs a modulo operation on each component. |

NKToString | Returns the vector formatted as a string |

NKGetXYZ | Returns the X, Y and Z components of this Vec3. |

NKSetXYZ | Sets the X, Y and Z components of this Vec3. |

NKLength | Returns the magnitude of this vector. |

NKNormalize | Returns a normalized vector. |

NKRotateByQuaternion | Rotates a vector by a given quaternion. |

Quaternion.

Summary

Constructors | |

quat. | Initializes this quaternion from an angle and axis. |

quat. | Initializes this quaternion using an XYZ Euler angle representation. |

quat. | Initializes this quaternion to the value of another. |

quat. | Initializes the elements of this quaternion to the provided values. |

Elements | |

w | Returns the w element of this quaternion. |

x | Returns the x element of this quaternion. |

y | Returns the y element of this quaternion. |

z | Returns the z element of this quaternion. |

Operations | |

normalize | Returns this quaternion, normalized. |

rotate | Returns the quaternion resulting from the rotation of this quaternion around a specific axis. |

Operators | |

operator== | Returns true if the quaternions are equal. |

operator* | Multiply two quaternion. |

Functions | |

Forward | Returns the vector facing in the direction of this rotation. |

Right | Returns the right vector of this quaternion. |

Up | Returns the up vector of this quaternion. |

NKToString | Returns the quaternion formatted as a string |

NKGetXYZW | Returns the X, Y, Z and W components of this Quat. |

NKSetXYZW | Sets the X, Y, Z and W components of this Quat. |

NKGetInverse | Returns the inverse of this quaternion. |

Static math functions.

Summary

Static Utility | |

Lerp | Lerp between two vectors by weight. |

Rotate | Static helper to rotate a quat by an explicit axis and angle. |

Ceil | Returns a value equal to the nearest integer that is greater than or equal to x. |

Floor | Returns a value equal to the nearest integer that is less than or equal to x. |

Cross3 | Computes the cross product of two vec3s, represented by 6 floats. |

CrossVec3 | Computes the cross product of two vectors. |

Angle | Helper to find the rotation between two vectors. |

LookAt | Helper to find the orientation between a source point and a target point. |

Slerp | Slerp between two vectors by weight. |

static vec3 Cross3( float x1, float y1, float z1, float x2, float y2, float z2 )

Computes the cross product of two vec3s, represented by 6 floats.

float | X value of the first vector. |

float | Y value of the first vector. |

float | Z value of the first vector. |

float | X value of the second vector. |

float | Y value of the second vector. |

float | Z value of the second vector. |

vec3 | The cross product of the two vectors. |

static quat LookAt( const vec3 & source, const vec3 & target )

Helper to find the orientation between a source point and a target point.

-- Set orientation to align with a velocity vector. self:NKSetOrientation(GLM.LookAt(NKMath.ZeroVec3, self.m_velocity))

vec3 | source |

vec3 | target |

quat | The normalized orientation from source to target. |

Rotates a vector by a given quaternion.

int staticNKRotateByQuaternion( lua_State * vm )

Lerp between two vectors by weight.

static vec3 Lerp( vec3 start, vec3 end, float weight )

Static helper to rotate a quat by an explicit axis and angle.

static void Rotate( quat & out, float angle, const vec3 & axis )

Returns a value equal to the nearest integer that is greater than or equal to x.

static vec3 Ceil( const vec3 & v )

Returns a value equal to the nearest integer that is less than or equal to x.

static vec3 Floor( const vec3 & v )

Computes the cross product of two vec3s, represented by 6 floats.

static vec3 Cross3( float x1, float y1, float z1, float x2, float y2, float z2 )

Computes the cross product of two vectors.

static vec3 CrossVec3( vec3 v1, vec3 v2 )

Helper to find the rotation between two vectors.

static quat Angle( const vec3 & v1, const vec3 & v2 )

Helper to find the orientation between a source point and a target point.

static quat LookAt( const vec3 & source, const vec3 & target )

Slerp between two vectors by weight.

static quat Slerp( const quat & v1, const quat & v2, float interp )