Home Reference Source

Function

Static Public Summary
public

LDU(L: ReadonlyMat2, D: ReadonlyMat2, U: ReadonlyMat2, a: ReadonlyMat2): undefined[]

Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix

public

add(out: mat2, a: ReadonlyMat2, b: ReadonlyMat2): mat2

Adds two mat2's

public

add(out: mat2d, a: ReadonlyMat2d, b: ReadonlyMat2d): mat2d

Adds two mat2d's

public

add(out: mat3, a: ReadonlyMat3, b: ReadonlyMat3): mat3

Adds two mat3's

public

add(out: mat4, a: ReadonlyMat4, b: ReadonlyMat4): mat4

Adds two mat4's

public

add(out: quat2, a: ReadonlyQuat2, b: ReadonlyQuat2): quat2

Adds two dual quat's

public

add(out: vec2, a: ReadonlyVec2, b: ReadonlyVec2): vec2

Adds two vec2's

public

add(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3): vec3

Adds two vec3's

public

add(out: vec4, a: ReadonlyVec4, b: ReadonlyVec4): vec4

Adds two vec4's

public

adjoint(out: mat2, a: ReadonlyMat2): mat2

Calculates the adjugate of a mat2

public

adjoint(out: mat3, a: ReadonlyMat3): mat3

Calculates the adjugate of a mat3

public

adjoint(out: mat4, a: ReadonlyMat4): mat4

Calculates the adjugate of a mat4

public

angle(a: ReadonlyVec2, b: ReadonlyVec2): Number

Get the angle between two 2D vectors

public

angle(a: ReadonlyVec3, b: ReadonlyVec3): Number

Get the angle between two 3D vectors

public

bezier(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3, c: ReadonlyVec3, d: ReadonlyVec3, t: Number): vec3

Performs a bezier interpolation with two control points

public

calculateW(out: quat, a: ReadonlyQuat): quat

Calculates the W component of a quat from the X, Y, and Z components.

public

ceil(out: vec2, a: ReadonlyVec2): vec2

Math.ceil the components of a vec2

public

ceil(out: vec3, a: ReadonlyVec3): vec3

Math.ceil the components of a vec3

public

ceil(out: vec4, a: ReadonlyVec4): vec4

Math.ceil the components of a vec4

public

clone(a: ReadonlyMat2): mat2

Creates a new mat2 initialized with values from an existing matrix

public

clone(a: ReadonlyMat2d): mat2d

Creates a new mat2d initialized with values from an existing matrix

public

clone(a: ReadonlyMat3): mat3

Creates a new mat3 initialized with values from an existing matrix

public

clone(a: ReadonlyMat4): mat4

Creates a new mat4 initialized with values from an existing matrix

public

clone(a: ReadonlyQuat2): quat2

Creates a new quat initialized with values from an existing quaternion

public

clone(a: ReadonlyVec2): vec2

Creates a new vec2 initialized with values from an existing vector

public

clone(a: ReadonlyVec3): vec3

Creates a new vec3 initialized with values from an existing vector

public

clone(a: ReadonlyVec4): vec4

Creates a new vec4 initialized with values from an existing vector

public

conjugate(out: quat, a: ReadonlyQuat): quat

Calculates the conjugate of a quat If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.

public

conjugate(out: quat2, a: ReadonlyQuat2): quat2

Calculates the conjugate of a dual quat If the dual quaternion is normalized, this function is faster than quat2.inverse and produces the same result.

public

copy(out: mat2, a: ReadonlyMat2): mat2

Copy the values from one mat2 to another

public

copy(out: mat2d, a: ReadonlyMat2d): mat2d

Copy the values from one mat2d to another

public

copy(out: mat3, a: ReadonlyMat3): mat3

Copy the values from one mat3 to another

public

copy(out: mat4, a: ReadonlyMat4): mat4

Copy the values from one mat4 to another

public

copy(out: quat2, a: ReadonlyQuat2): quat2

Copy the values from one dual quat to another

public

copy(out: vec2, a: ReadonlyVec2): vec2

Copy the values from one vec2 to another

public

copy(out: vec3, a: ReadonlyVec3): vec3

Copy the values from one vec3 to another

public

copy(out: vec4, a: ReadonlyVec4): vec4

Copy the values from one vec4 to another

public

create(): mat2

Creates a new identity mat2

public

create(): mat2d

Creates a new identity mat2d

public

create(): mat3

Creates a new identity mat3

public

create(): mat4

Creates a new identity mat4

public

create(): quat

Creates a new identity quat

public

create(): quat2

Creates a new identity dual quat

public

create(): vec2

Creates a new, empty vec2

public

create(): vec3

Creates a new, empty vec3

public

create(): vec4

Creates a new, empty vec4

public

cross(out: vec3, a: ReadonlyVec2, b: ReadonlyVec2): vec3

Computes the cross product of two vec2's Note that the cross product must by definition produce a 3D vector

public

cross(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3): vec3

Computes the cross product of two vec3's

public

cross(result: ReadonlyVec4, U: ReadonlyVec4, V: ReadonlyVec4, W: ReadonlyVec4): vec4

Returns the cross-product of three vectors in a 4-dimensional space

public

determinant(a: ReadonlyMat2): Number

Calculates the determinant of a mat2

public

determinant(a: ReadonlyMat2d): Number

Calculates the determinant of a mat2d

public

determinant(a: ReadonlyMat3): Number

Calculates the determinant of a mat3

public

determinant(a: ReadonlyMat4): Number

Calculates the determinant of a mat4

public

distance(a: ReadonlyVec2, b: ReadonlyVec2): Number

Calculates the euclidian distance between two vec2's

public

distance(a: ReadonlyVec3, b: ReadonlyVec3): Number

Calculates the euclidian distance between two vec3's

public

distance(a: ReadonlyVec4, b: ReadonlyVec4): Number

Calculates the euclidian distance between two vec4's

public

divide(out: vec2, a: ReadonlyVec2, b: ReadonlyVec2): vec2

Divides two vec2's

public

divide(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3): vec3

Divides two vec3's

public

divide(out: vec4, a: ReadonlyVec4, b: ReadonlyVec4): vec4

Divides two vec4's

public

dot(a: ReadonlyVec2, b: ReadonlyVec2): Number

Calculates the dot product of two vec2's

public

dot(a: ReadonlyVec3, b: ReadonlyVec3): Number

Calculates the dot product of two vec3's

public

dot(a: ReadonlyVec4, b: ReadonlyVec4): Number

Calculates the dot product of two vec4's

public

Tests whether or not the arguments have approximately the same value, within an absolute or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less than or equal to 1.0, and a relative tolerance is used for larger values)

public

equals(a: ReadonlyMat2, b: ReadonlyMat2): Boolean

Returns whether or not the matrices have approximately the same elements in the same position.

public

equals(a: ReadonlyMat2d, b: ReadonlyMat2d): Boolean

Returns whether or not the matrices have approximately the same elements in the same position.

public

equals(a: ReadonlyMat3, b: ReadonlyMat3): Boolean

Returns whether or not the matrices have approximately the same elements in the same position.

public

equals(a: ReadonlyMat4, b: ReadonlyMat4): Boolean

Returns whether or not the matrices have approximately the same elements in the same position.

public

equals(a: ReadonlyQuat2, b: ReadonlyQuat2): Boolean

Returns whether or not the dual quaternions have approximately the same elements in the same position.

public

equals(a: ReadonlyVec2, b: ReadonlyVec2): Boolean

Returns whether or not the vectors have approximately the same elements in the same position.

public

equals(a: ReadonlyVec3, b: ReadonlyVec3): Boolean

Returns whether or not the vectors have approximately the same elements in the same position.

public

equals(a: ReadonlyVec4, b: ReadonlyVec4): Boolean

Returns whether or not the vectors have approximately the same elements in the same position.

public

exactEquals(a: ReadonlyMat2, b: ReadonlyMat2): Boolean

Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)

public

exactEquals(a: ReadonlyMat2d, b: ReadonlyMat2d): Boolean

Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)

public

exactEquals(a: ReadonlyMat3, b: ReadonlyMat3): Boolean

Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)

public

exactEquals(a: ReadonlyMat4, b: ReadonlyMat4): Boolean

Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)

public

exactEquals(a: ReadonlyQuat2, b: ReadonlyQuat2): Boolean

Returns whether or not the dual quaternions have exactly the same elements in the same position (when compared with ===)

public

exactEquals(a: ReadonlyVec2, b: ReadonlyVec2): Boolean

Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)

public

exactEquals(a: ReadonlyVec3, b: ReadonlyVec3): Boolean

Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)

public

exactEquals(a: ReadonlyVec4, b: ReadonlyVec4): Boolean

Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)

public

exp(out: quat, a: ReadonlyQuat): quat

Calculate the exponential of a unit quaternion.

public

floor(out: vec2, a: ReadonlyVec2): vec2

Math.floor the components of a vec2

public

floor(out: vec3, a: ReadonlyVec3): vec3

Math.floor the components of a vec3

public

floor(out: vec4, a: ReadonlyVec4): vec4

Math.floor the components of a vec4

public

frob(a: ReadonlyMat2): Number

Returns Frobenius norm of a mat2

public

frob(a: ReadonlyMat2d): Number

Returns Frobenius norm of a mat2d

public

frob(a: ReadonlyMat3): Number

Returns Frobenius norm of a mat3

public

frob(a: ReadonlyMat4): Number

Returns Frobenius norm of a mat4

public

fromEuler(out: quat, Angle: x, Angle: y, Angle: z): quat

Creates a quaternion from the given euler angle x, y, z.

public

fromMat2d(out: mat3, a: ReadonlyMat2d): mat3

Copies the values from a mat2d into a mat3

public

fromMat3(out: quat, m: ReadonlyMat3): quat

Creates a quaternion from the given 3x3 rotation matrix.

public

fromMat4(out: mat3, a: ReadonlyMat4): mat3

Copies the upper-left 3x3 values into the given mat3.

public

fromMat4(out: quat2, a: ReadonlyMat4): quat2

Creates a new dual quat from a matrix (4x4)

public

fromQuat(out: mat3, q: ReadonlyQuat): mat3

Calculates a 3x3 matrix from the given quaternion

public

fromQuat(out: mat4, q: ReadonlyQuat): mat4

Calculates a 4x4 matrix from the given quaternion

public

fromQuat2(out: mat4, a: ReadonlyQuat2): mat4

Creates a new mat4 from a dual quat.

public

fromRotation(out: mat2, rad: Number): mat2

Creates a matrix from a given angle This is equivalent to (but much faster than):

public

fromRotation(out: mat2d, rad: Number): mat2d

Creates a matrix from a given angle This is equivalent to (but much faster than):

public

fromRotation(out: mat3, rad: Number): mat3

Creates a matrix from a given angle This is equivalent to (but much faster than):

public

fromRotation(out: mat4, rad: Number, axis: ReadonlyVec3): mat4

Creates a matrix from a given angle around a given axis This is equivalent to (but much faster than):

public

fromRotation(dual: ReadonlyQuat2, q: ReadonlyQuat): quat2

Creates a dual quat from a quaternion

public

fromRotationTranslation(out: mat4, q: quat4, v: ReadonlyVec3): mat4

Creates a matrix from a quaternion rotation and vector translation This is equivalent to (but much faster than):

public

fromRotationTranslation(dual: ReadonlyQuat2, q: ReadonlyQuat, t: ReadonlyVec3): quat2

Creates a dual quat from a quaternion and a translation

public

fromRotationTranslationScale(out: mat4, q: quat4, v: ReadonlyVec3, s: ReadonlyVec3): mat4

Creates a matrix from a quaternion rotation, vector translation and vector scale This is equivalent to (but much faster than):

public

fromRotationTranslationScaleOrigin(out: mat4, q: quat4, v: ReadonlyVec3, s: ReadonlyVec3, o: ReadonlyVec3): mat4

Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin This is equivalent to (but much faster than):

public

fromRotationTranslationValues(x1: Number, y1: Number, z1: Number, w1: Number, x2: Number, y2: Number, z2: Number): quat2

Creates a new dual quat from the given values (quat and translation)

public

fromScaling(out: mat2, v: ReadonlyVec2): mat2

Creates a matrix from a vector scaling This is equivalent to (but much faster than):

public

fromScaling(out: mat2d, v: ReadonlyVec2): mat2d

Creates a matrix from a vector scaling This is equivalent to (but much faster than):

public

fromScaling(out: mat3, v: ReadonlyVec2): mat3

Creates a matrix from a vector scaling This is equivalent to (but much faster than):

public

fromScaling(out: mat4, v: ReadonlyVec3): mat4

Creates a matrix from a vector scaling This is equivalent to (but much faster than):

public

fromTranslation(out: mat2d, v: ReadonlyVec2): mat2d

Creates a matrix from a vector translation This is equivalent to (but much faster than):

public

fromTranslation(out: mat3, v: ReadonlyVec2): mat3

Creates a matrix from a vector translation This is equivalent to (but much faster than):

public

fromTranslation(out: mat4, v: ReadonlyVec3): mat4

Creates a matrix from a vector translation This is equivalent to (but much faster than):

public

fromTranslation(dual: ReadonlyQuat2, t: ReadonlyVec3): quat2

Creates a dual quat from a translation

public

fromValues(m00: Number, m01: Number, m10: Number, m11: Number): mat2

Create a new mat2 with the given values

public

fromValues(a: Number, b: Number, c: Number, d: Number, tx: Number, ty: Number): mat2d

Create a new mat2d with the given values

public

fromValues(m00: Number, m01: Number, m02: Number, m10: Number, m11: Number, m12: Number, m20: Number, m21: Number, m22: Number): mat3

Create a new mat3 with the given values

public

fromValues(m00: Number, m01: Number, m02: Number, m03: Number, m10: Number, m11: Number, m12: Number, m13: Number, m20: Number, m21: Number, m22: Number, m23: Number, m30: Number, m31: Number, m32: Number, m33: Number): mat4

Create a new mat4 with the given values

public

fromValues(x1: Number, y1: Number, z1: Number, w1: Number, x2: Number, y2: Number, z2: Number, w2: Number): quat2

Creates a new dual quat initialized with the given values

public

fromValues(x: Number, y: Number): vec2

Creates a new vec2 initialized with the given values

public

fromValues(x: Number, y: Number, z: Number): vec3

Creates a new vec3 initialized with the given values

public

fromValues(x: Number, y: Number, z: Number, w: Number): vec4

Creates a new vec4 initialized with the given values

public

fromXRotation(out: mat4, rad: Number): mat4

Creates a matrix from the given angle around the X axis This is equivalent to (but much faster than):

public

fromYRotation(out: mat4, rad: Number): mat4

Creates a matrix from the given angle around the Y axis This is equivalent to (but much faster than):

public

fromZRotation(out: mat4, rad: Number): mat4

Creates a matrix from the given angle around the Z axis This is equivalent to (but much faster than):

public

frustum(out: mat4, left: Number, right: Number, bottom: Number, top: Number, near: Number, far: Number): mat4

Generates a frustum matrix with the given bounds

public

getAngle(a: ReadonlyQuat, b: ReadonlyQuat): Number

Gets the angular distance between two unit quaternions

public

getAxisAngle(out_axis: vec3, q: ReadonlyQuat): Number

Gets the rotation axis and angle for a given quaternion.

public

getDual(out: quat, a: ReadonlyQuat2): quat

Gets the dual part of a dual quat

public

getRotation(out: quat, mat: ReadonlyMat4): quat

Returns a quaternion representing the rotational component of a transformation matrix.

public

getScaling(out: vec3, mat: ReadonlyMat4): vec3

Returns the scaling factor component of a transformation matrix.

public

getTranslation(out: vec3, mat: ReadonlyMat4): vec3

Returns the translation vector component of a transformation matrix.

public

getTranslation(out: vec3, a: ReadonlyQuat2): vec3

Gets the translation of a normalized dual quat

public

hermite(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3, c: ReadonlyVec3, d: ReadonlyVec3, t: Number): vec3

Performs a hermite interpolation with two control points

public

identity(out: mat2): mat2

Set a mat2 to the identity matrix

public

identity(out: mat2d): mat2d

Set a mat2d to the identity matrix

public

identity(out: mat3): mat3

Set a mat3 to the identity matrix

public

identity(out: mat4): mat4

Set a mat4 to the identity matrix

public

identity(out: quat): quat

Set a quat to the identity quaternion

public

identity(out: quat2): quat2

Set a dual quat to the identity dual quaternion

public

inverse(out: vec2, a: ReadonlyVec2): vec2

Returns the inverse of the components of a vec2

public

inverse(out: vec3, a: ReadonlyVec3): vec3

Returns the inverse of the components of a vec3

public

inverse(out: vec4, a: ReadonlyVec4): vec4

Returns the inverse of the components of a vec4

public

invert(out: mat2, a: ReadonlyMat2): mat2

Inverts a mat2

public

invert(out: mat2d, a: ReadonlyMat2d): mat2d

Inverts a mat2d

public

invert(out: mat3, a: ReadonlyMat3): mat3

Inverts a mat3

public

invert(out: mat4, a: ReadonlyMat4): mat4

Inverts a mat4

public

invert(out: quat, a: ReadonlyQuat): quat

Calculates the inverse of a quat

public

invert(out: quat2, a: ReadonlyQuat2): quat2

Calculates the inverse of a dual quat.

public

length(a: ReadonlyVec2): Number

Calculates the length of a vec2

public

length(a: ReadonlyVec3): Number

Calculates the length of a vec3

public

length(a: ReadonlyVec4): Number

Calculates the length of a vec4

public

lerp(out: quat2, a: ReadonlyQuat2, b: ReadonlyQuat2, t: Number): quat2

Performs a linear interpolation between two dual quats's NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when t = 0.5)

public

lerp(out: vec2, a: ReadonlyVec2, b: ReadonlyVec2, t: Number): vec2

Performs a linear interpolation between two vec2's

public

lerp(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3, t: Number): vec3

Performs a linear interpolation between two vec3's

public

lerp(out: vec4, a: ReadonlyVec4, b: ReadonlyVec4, t: Number): vec4

Performs a linear interpolation between two vec4's

public

ln(out: quat, a: ReadonlyQuat): quat

Calculate the natural logarithm of a unit quaternion.

public

lookAt(out: mat4, eye: ReadonlyVec3, center: ReadonlyVec3, up: ReadonlyVec3): mat4

Generates a look-at matrix with the given eye position, focal point, and up axis.

public

max(out: vec2, a: ReadonlyVec2, b: ReadonlyVec2): vec2

Returns the maximum of two vec2's

public

max(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3): vec3

Returns the maximum of two vec3's

public

max(out: vec4, a: ReadonlyVec4, b: ReadonlyVec4): vec4

Returns the maximum of two vec4's

public

min(out: vec2, a: ReadonlyVec2, b: ReadonlyVec2): vec2

Returns the minimum of two vec2's

public

min(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3): vec3

Returns the minimum of two vec3's

public

min(out: vec4, a: ReadonlyVec4, b: ReadonlyVec4): vec4

Returns the minimum of two vec4's

public

multiply(out: mat2, a: ReadonlyMat2, b: ReadonlyMat2): mat2

Multiplies two mat2's

public

multiply(out: mat2d, a: ReadonlyMat2d, b: ReadonlyMat2d): mat2d

Multiplies two mat2d's

public

multiply(out: mat3, a: ReadonlyMat3, b: ReadonlyMat3): mat3

Multiplies two mat3's

public

multiply(out: mat4, a: ReadonlyMat4, b: ReadonlyMat4): mat4

Multiplies two mat4s

public

multiply(out: quat, a: ReadonlyQuat, b: ReadonlyQuat): quat

Multiplies two quat's

public

multiply(out: quat2, a: ReadonlyQuat2, b: ReadonlyQuat2): quat2

Multiplies two dual quat's

public

multiply(out: vec2, a: ReadonlyVec2, b: ReadonlyVec2): vec2

Multiplies two vec2's

public

multiply(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3): vec3

Multiplies two vec3's

public

multiply(out: vec4, a: ReadonlyVec4, b: ReadonlyVec4): vec4

Multiplies two vec4's

public

multiplyScalar(out: mat2, a: ReadonlyMat2, b: Number): mat2

Multiply each element of the matrix by a scalar.

public

multiplyScalar(out: mat2d, a: ReadonlyMat2d, b: Number): mat2d

Multiply each element of the matrix by a scalar.

public

multiplyScalar(out: mat3, a: ReadonlyMat3, b: Number): mat3

Multiply each element of the matrix by a scalar.

public

multiplyScalar(out: mat4, a: ReadonlyMat4, b: Number): mat4

Multiply each element of the matrix by a scalar.

public

multiplyScalarAndAdd(out: mat2, a: ReadonlyMat2, b: ReadonlyMat2, scale: Number): mat2

Adds two mat2's after multiplying each element of the second operand by a scalar value.

public

multiplyScalarAndAdd(out: mat2d, a: ReadonlyMat2d, b: ReadonlyMat2d, scale: Number): mat2d

Adds two mat2d's after multiplying each element of the second operand by a scalar value.

public

multiplyScalarAndAdd(out: mat3, a: ReadonlyMat3, b: ReadonlyMat3, scale: Number): mat3

Adds two mat3's after multiplying each element of the second operand by a scalar value.

public

multiplyScalarAndAdd(out: mat4, a: ReadonlyMat4, b: ReadonlyMat4, scale: Number): mat4

Adds two mat4's after multiplying each element of the second operand by a scalar value.

public

negate(out: vec2, a: ReadonlyVec2): vec2

Negates the components of a vec2

public

negate(out: vec3, a: ReadonlyVec3): vec3

Negates the components of a vec3

public

negate(out: vec4, a: ReadonlyVec4): vec4

Negates the components of a vec4

public

normalFromMat4(out: mat3, a: ReadonlyMat4): mat3

Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix

public

normalize(out: quat2, a: ReadonlyQuat2): quat2

Normalize a dual quat

public

normalize(out: vec2, a: ReadonlyVec2): vec2

Normalize a vec2

public

normalize(out: vec3, a: ReadonlyVec3): vec3

Normalize a vec3

public

normalize(out: vec4, a: ReadonlyVec4): vec4

Normalize a vec4

public

ortho(out: mat4, left: number, right: number, bottom: number, top: number, near: number, far: number): mat4

Generates a orthogonal projection matrix with the given bounds

public

perspective(out: mat4, fovy: number, aspect: number, near: number, far: number): mat4

Generates a perspective projection matrix with the given bounds.

public

perspectiveFromFieldOfView(out: mat4, fov: Object, near: number, far: number): mat4

Generates a perspective projection matrix with the given field of view.

public

pow(out: quat, a: ReadonlyQuat, b: Number): quat

Calculate the scalar power of a unit quaternion.

public

projection(out: mat3, width: number, height: number): mat3

Generates a 2D projection matrix with the given bounds

public

random(out: quat): quat

Generates a random unit quaternion

public

random(out: vec2, scale: Number): vec2

Generates a random vector with the given scale

public

random(out: vec3, scale: Number): vec3

Generates a random vector with the given scale

public

random(out: vec4, scale: Number): vec4

Generates a random vector with the given scale

public

rotate(out: mat2, a: ReadonlyMat2, rad: Number): mat2

Rotates a mat2 by the given angle

public

rotate(out: mat2d, a: ReadonlyMat2d, rad: Number): mat2d

Rotates a mat2d by the given angle

public

rotate(out: mat3, a: ReadonlyMat3, rad: Number): mat3

Rotates a mat3 by the given angle

public

rotate(out: mat4, a: ReadonlyMat4, rad: Number, axis: ReadonlyVec3): mat4

Rotates a mat4 by the given angle around the given axis

public

rotate(out: vec2, a: ReadonlyVec2, b: ReadonlyVec2, rad: Number): vec2

Rotate a 2D vector

public

rotateAroundAxis(out: quat2, a: ReadonlyQuat2, axis: ReadonlyVec3, rad: Number): quat2

Rotates a dual quat around a given axis.

public

rotateByQuatAppend(out: quat2, a: ReadonlyQuat2, q: ReadonlyQuat): quat2

Rotates a dual quat by a given quaternion (a * q)

public

rotateByQuatPrepend(out: quat2, q: ReadonlyQuat, a: ReadonlyQuat2): quat2

Rotates a dual quat by a given quaternion (q * a)

public

rotateX(out: mat4, a: ReadonlyMat4, rad: Number): mat4

Rotates a matrix by the given angle around the X axis

public

rotateX(out: quat, a: ReadonlyQuat, rad: number): quat

Rotates a quaternion by the given angle about the X axis

public

rotateX(out: quat2, a: ReadonlyQuat2, rad: number): quat2

Rotates a dual quat around the X axis

public

rotateX(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3, rad: Number): vec3

Rotate a 3D vector around the x-axis

public

rotateY(out: mat4, a: ReadonlyMat4, rad: Number): mat4

Rotates a matrix by the given angle around the Y axis

public

rotateY(out: quat, a: ReadonlyQuat, rad: number): quat

Rotates a quaternion by the given angle about the Y axis

public

rotateY(out: quat2, a: ReadonlyQuat2, rad: number): quat2

Rotates a dual quat around the Y axis

public

rotateY(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3, rad: Number): vec3

Rotate a 3D vector around the y-axis

public

rotateZ(out: mat4, a: ReadonlyMat4, rad: Number): mat4

Rotates a matrix by the given angle around the Z axis

public

rotateZ(out: quat, a: ReadonlyQuat, rad: number): quat

Rotates a quaternion by the given angle about the Z axis

public

rotateZ(out: quat2, a: ReadonlyQuat2, rad: number): quat2

Rotates a dual quat around the Z axis

public

rotateZ(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3, rad: Number): vec3

Rotate a 3D vector around the z-axis

public

round(out: vec2, a: ReadonlyVec2): vec2

Math.round the components of a vec2

public

round(out: vec3, a: ReadonlyVec3): vec3

Math.round the components of a vec3

public

round(out: vec4, a: ReadonlyVec4): vec4

Math.round the components of a vec4

public

scale(out: mat2, a: ReadonlyMat2, v: ReadonlyVec2): mat2

Scales the mat2 by the dimensions in the given vec2

public

scale(out: mat2d, a: ReadonlyMat2d, v: ReadonlyVec2): mat2d

Scales the mat2d by the dimensions in the given vec2

public

scale(out: mat3, a: ReadonlyMat3, v: ReadonlyVec2): mat3

Scales the mat3 by the dimensions in the given vec2

public

scale(out: mat4, a: ReadonlyMat4, v: ReadonlyVec3): mat4

Scales the mat4 by the dimensions in the given vec3 not using vectorization

public

scale(out: quat2, a: ReadonlyQuat2, b: Number): quat2

Scales a dual quat by a scalar number

public

scale(out: vec2, a: ReadonlyVec2, b: Number): vec2

Scales a vec2 by a scalar number

public

scale(out: vec3, a: ReadonlyVec3, b: Number): vec3

Scales a vec3 by a scalar number

public

scale(out: vec4, a: ReadonlyVec4, b: Number): vec4

Scales a vec4 by a scalar number

public

scaleAndAdd(out: vec2, a: ReadonlyVec2, b: ReadonlyVec2, scale: Number): vec2

Adds two vec2's after scaling the second operand by a scalar value

public

scaleAndAdd(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3, scale: Number): vec3

Adds two vec3's after scaling the second operand by a scalar value

public

scaleAndAdd(out: vec4, a: ReadonlyVec4, b: ReadonlyVec4, scale: Number): vec4

Adds two vec4's after scaling the second operand by a scalar value

public

set(out: mat2, m00: Number, m01: Number, m10: Number, m11: Number): mat2

Set the components of a mat2 to the given values

public

set(out: mat2d, a: Number, b: Number, c: Number, d: Number, tx: Number, ty: Number): mat2d

Set the components of a mat2d to the given values

public

set(out: mat3, m00: Number, m01: Number, m02: Number, m10: Number, m11: Number, m12: Number, m20: Number, m21: Number, m22: Number): mat3

Set the components of a mat3 to the given values

public

set(out: mat4, m00: Number, m01: Number, m02: Number, m03: Number, m10: Number, m11: Number, m12: Number, m13: Number, m20: Number, m21: Number, m22: Number, m23: Number, m30: Number, m31: Number, m32: Number, m33: Number): mat4

Set the components of a mat4 to the given values

public

set(out: quat2, x1: Number, y1: Number, z1: Number, w1: Number, x2: Number, y2: Number, z2: Number, w2: Number): quat2

Set the components of a dual quat to the given values

public

set(out: vec2, x: Number, y: Number): vec2

Set the components of a vec2 to the given values

public

set(out: vec3, x: Number, y: Number, z: Number): vec3

Set the components of a vec3 to the given values

public

set(out: vec4, x: Number, y: Number, z: Number, w: Number): vec4

Set the components of a vec4 to the given values

public

setAxisAngle(out: quat, axis: ReadonlyVec3, rad: Number): quat

Sets a quat from the given angle and rotation axis, then returns it.

public

setDual(out: quat2, q: ReadonlyQuat): quat2

Set the dual component of a dual quat to the given quaternion

public

setMatrixArrayType(type: Float32ArrayConstructor | ArrayConstructor)

Sets the type of array used when creating new vectors and matrices

public

slerp(out: quat, a: ReadonlyQuat, b: ReadonlyQuat, t: Number): quat

Performs a spherical linear interpolation between two quat

public

squaredDistance(a: ReadonlyVec2, b: ReadonlyVec2): Number

Calculates the squared euclidian distance between two vec2's

public

squaredDistance(a: ReadonlyVec3, b: ReadonlyVec3): Number

Calculates the squared euclidian distance between two vec3's

public

squaredDistance(a: ReadonlyVec4, b: ReadonlyVec4): Number

Calculates the squared euclidian distance between two vec4's

public

squaredLength(a: ReadonlyVec2): Number

Calculates the squared length of a vec2

public

squaredLength(a: ReadonlyVec3): Number

Calculates the squared length of a vec3

public

squaredLength(a: ReadonlyVec4): Number

Calculates the squared length of a vec4

public

str(a: ReadonlyMat2): String

Returns a string representation of a mat2

public

str(a: ReadonlyMat2d): String

Returns a string representation of a mat2d

public

str(a: ReadonlyMat3): String

Returns a string representation of a mat3

public

str(a: ReadonlyMat4): String

Returns a string representation of a mat4

public

str(a: ReadonlyQuat): String

Returns a string representation of a quatenion

public

str(a: ReadonlyQuat2): String

Returns a string representation of a dual quatenion

public

str(a: ReadonlyVec2): String

Returns a string representation of a vector

public

str(a: ReadonlyVec3): String

Returns a string representation of a vector

public

str(a: ReadonlyVec4): String

Returns a string representation of a vector

public

subtract(out: mat2, a: ReadonlyMat2, b: ReadonlyMat2): mat2

Subtracts matrix b from matrix a

public

subtract(out: mat2d, a: ReadonlyMat2d, b: ReadonlyMat2d): mat2d

Subtracts matrix b from matrix a

public

subtract(out: mat3, a: ReadonlyMat3, b: ReadonlyMat3): mat3

Subtracts matrix b from matrix a

public

subtract(out: mat4, a: ReadonlyMat4, b: ReadonlyMat4): mat4

Subtracts matrix b from matrix a

public

subtract(out: vec2, a: ReadonlyVec2, b: ReadonlyVec2): vec2

Subtracts vector b from vector a

public

subtract(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3): vec3

Subtracts vector b from vector a

public

subtract(out: vec4, a: ReadonlyVec4, b: ReadonlyVec4): vec4

Subtracts vector b from vector a

public

targetTo(out: mat4, eye: ReadonlyVec3, center: ReadonlyVec3, up: ReadonlyVec3): mat4

Generates a matrix that makes something look at something else.

public

toRadian(a: Number): *

Convert Degree To Radian

public

transformMat2(out: vec2, a: ReadonlyVec2, m: ReadonlyMat2): vec2

Transforms the vec2 with a mat2

public

transformMat2d(out: vec2, a: ReadonlyVec2, m: ReadonlyMat2d): vec2

Transforms the vec2 with a mat2d

public

transformMat3(out: vec2, a: ReadonlyVec2, m: ReadonlyMat3): vec2

Transforms the vec2 with a mat3 3rd vector component is implicitly '1'

public

transformMat3(out: vec3, a: ReadonlyVec3, m: ReadonlyMat3): vec3

Transforms the vec3 with a mat3.

public

transformMat4(out: vec2, a: ReadonlyVec2, m: ReadonlyMat4): vec2

Transforms the vec2 with a mat4 3rd vector component is implicitly '0' 4th vector component is implicitly '1'

public

transformMat4(out: vec3, a: ReadonlyVec3, m: ReadonlyMat4): vec3

Transforms the vec3 with a mat4.

public

transformMat4(out: vec4, a: ReadonlyVec4, m: ReadonlyMat4): vec4

Transforms the vec4 with a mat4.

public

transformQuat(out: vec3, a: ReadonlyVec3, q: ReadonlyQuat): vec3

Transforms the vec3 with a quat Can also be used for dual quaternions.

public

transformQuat(out: vec4, a: ReadonlyVec4, q: ReadonlyQuat): vec4

Transforms the vec4 with a quat

public

translate(out: mat2d, a: ReadonlyMat2d, v: ReadonlyVec2): mat2d

Translates the mat2d by the dimensions in the given vec2

public

translate(out: mat3, a: ReadonlyMat3, v: ReadonlyVec2): mat3

Translate a mat3 by the given vector

public

translate(out: mat4, a: ReadonlyMat4, v: ReadonlyVec3): mat4

Translate a mat4 by the given vector

public

translate(out: quat2, a: ReadonlyQuat2, v: ReadonlyVec3): quat2

Translates a dual quat by the given vector

public

transpose(out: mat2, a: ReadonlyMat2): mat2

Transpose the values of a mat2

public

transpose(out: mat3, a: ReadonlyMat3): mat3

Transpose the values of a mat3

public

transpose(out: mat4, a: ReadonlyMat4): mat4

Transpose the values of a mat4

public

zero(out: vec2): vec2

Set the components of a vec2 to zero

public

zero(out: vec3): vec3

Set the components of a vec3 to zero

public

zero(out: vec4): vec4

Set the components of a vec4 to zero

Static Public

public LDU(L: ReadonlyMat2, D: ReadonlyMat2, U: ReadonlyMat2, a: ReadonlyMat2): undefined[] source

Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix

Params:

NameTypeAttributeDescription
L ReadonlyMat2

the lower triangular matrix

D ReadonlyMat2

the diagonal matrix

U ReadonlyMat2

the upper triangular matrix

a ReadonlyMat2

the input matrix to factorize

Return:

undefined[]

public add(out: mat2, a: ReadonlyMat2, b: ReadonlyMat2): mat2 source

Adds two mat2's

Params:

NameTypeAttributeDescription
out mat2

the receiving matrix

a ReadonlyMat2

the first operand

b ReadonlyMat2

the second operand

Return:

mat2

out

public add(out: mat2d, a: ReadonlyMat2d, b: ReadonlyMat2d): mat2d source

Adds two mat2d's

Params:

NameTypeAttributeDescription
out mat2d

the receiving matrix

a ReadonlyMat2d

the first operand

b ReadonlyMat2d

the second operand

Return:

mat2d

out

public add(out: mat3, a: ReadonlyMat3, b: ReadonlyMat3): mat3 source

Adds two mat3's

Params:

NameTypeAttributeDescription
out mat3

the receiving matrix

a ReadonlyMat3

the first operand

b ReadonlyMat3

the second operand

Return:

mat3

out

public add(out: mat4, a: ReadonlyMat4, b: ReadonlyMat4): mat4 source

Adds two mat4's

Params:

NameTypeAttributeDescription
out mat4

the receiving matrix

a ReadonlyMat4

the first operand

b ReadonlyMat4

the second operand

Return:

mat4

out

public add(out: quat2, a: ReadonlyQuat2, b: ReadonlyQuat2): quat2 source

Adds two dual quat's

Params:

NameTypeAttributeDescription
out quat2

the receiving dual quaternion

a ReadonlyQuat2

the first operand

b ReadonlyQuat2

the second operand

Return:

quat2

out

public add(out: vec2, a: ReadonlyVec2, b: ReadonlyVec2): vec2 source

Adds two vec2's

Params:

NameTypeAttributeDescription
out vec2

the receiving vector

a ReadonlyVec2

the first operand

b ReadonlyVec2

the second operand

Return:

vec2

out

public add(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3): vec3 source

Adds two vec3's

Params:

NameTypeAttributeDescription
out vec3

the receiving vector

a ReadonlyVec3

the first operand

b ReadonlyVec3

the second operand

Return:

vec3

out

public add(out: vec4, a: ReadonlyVec4, b: ReadonlyVec4): vec4 source

Adds two vec4's

Params:

NameTypeAttributeDescription
out vec4

the receiving vector

a ReadonlyVec4

the first operand

b ReadonlyVec4

the second operand

Return:

vec4

out

public adjoint(out: mat2, a: ReadonlyMat2): mat2 source

import {adjoint} from 'bimsurfer3/viewer/glmatrix/mat2.js'

Calculates the adjugate of a mat2

Params:

NameTypeAttributeDescription
out mat2

the receiving matrix

a ReadonlyMat2

the source matrix

Return:

mat2

out

public adjoint(out: mat3, a: ReadonlyMat3): mat3 source

import {adjoint} from 'bimsurfer3/viewer/glmatrix/mat3.js'

Calculates the adjugate of a mat3

Params:

NameTypeAttributeDescription
out mat3

the receiving matrix

a ReadonlyMat3

the source matrix

Return:

mat3

out

public adjoint(out: mat4, a: ReadonlyMat4): mat4 source

import {adjoint} from 'bimsurfer3/viewer/glmatrix/mat4.js'

Calculates the adjugate of a mat4

Params:

NameTypeAttributeDescription
out mat4

the receiving matrix

a ReadonlyMat4

the source matrix

Return:

mat4

out

public angle(a: ReadonlyVec2, b: ReadonlyVec2): Number source

Get the angle between two 2D vectors

Params:

NameTypeAttributeDescription
a ReadonlyVec2

The first operand

b ReadonlyVec2

The second operand

Return:

Number

The angle in radians

public angle(a: ReadonlyVec3, b: ReadonlyVec3): Number source

Get the angle between two 3D vectors

Params:

NameTypeAttributeDescription
a ReadonlyVec3

The first operand

b ReadonlyVec3

The second operand

Return:

Number

The angle in radians

public bezier(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3, c: ReadonlyVec3, d: ReadonlyVec3, t: Number): vec3 source

import {bezier} from 'bimsurfer3/viewer/glmatrix/vec3.js'

Performs a bezier interpolation with two control points

Params:

NameTypeAttributeDescription
out vec3

the receiving vector

a ReadonlyVec3

the first operand

b ReadonlyVec3

the second operand

c ReadonlyVec3

the third operand

d ReadonlyVec3

the fourth operand

t Number

interpolation amount, in the range [0-1], between the two inputs

Return:

vec3

out

public calculateW(out: quat, a: ReadonlyQuat): quat source

import {calculateW} from 'bimsurfer3/viewer/glmatrix/quat.js'

Calculates the W component of a quat from the X, Y, and Z components. Assumes that quaternion is 1 unit in length. Any existing W component will be ignored.

Params:

NameTypeAttributeDescription
out quat

the receiving quaternion

a ReadonlyQuat

quat to calculate W component of

Return:

quat

out

public ceil(out: vec2, a: ReadonlyVec2): vec2 source

Math.ceil the components of a vec2

Params:

NameTypeAttributeDescription
out vec2

the receiving vector

a ReadonlyVec2

vector to ceil

Return:

vec2

out

public ceil(out: vec3, a: ReadonlyVec3): vec3 source

Math.ceil the components of a vec3

Params:

NameTypeAttributeDescription
out vec3

the receiving vector

a ReadonlyVec3

vector to ceil

Return:

vec3

out

public ceil(out: vec4, a: ReadonlyVec4): vec4 source

Math.ceil the components of a vec4

Params:

NameTypeAttributeDescription
out vec4

the receiving vector

a ReadonlyVec4

vector to ceil

Return:

vec4

out

public clone(a: ReadonlyMat2): mat2 source

Creates a new mat2 initialized with values from an existing matrix

Params:

NameTypeAttributeDescription
a ReadonlyMat2

matrix to clone

Return:

mat2

a new 2x2 matrix

public clone(a: ReadonlyMat2d): mat2d source

Creates a new mat2d initialized with values from an existing matrix

Params:

NameTypeAttributeDescription
a ReadonlyMat2d

matrix to clone

Return:

mat2d

a new 2x3 matrix

public clone(a: ReadonlyMat3): mat3 source

Creates a new mat3 initialized with values from an existing matrix

Params:

NameTypeAttributeDescription
a ReadonlyMat3

matrix to clone

Return:

mat3

a new 3x3 matrix

public clone(a: ReadonlyMat4): mat4 source

Creates a new mat4 initialized with values from an existing matrix

Params:

NameTypeAttributeDescription
a ReadonlyMat4

matrix to clone

Return:

mat4

a new 4x4 matrix

public clone(a: ReadonlyQuat2): quat2 source

Creates a new quat initialized with values from an existing quaternion

Params:

NameTypeAttributeDescription
a ReadonlyQuat2

dual quaternion to clone

Return:

quat2

new dual quaternion

public clone(a: ReadonlyVec2): vec2 source

Creates a new vec2 initialized with values from an existing vector

Params:

NameTypeAttributeDescription
a ReadonlyVec2

vector to clone

Return:

vec2

a new 2D vector

public clone(a: ReadonlyVec3): vec3 source

Creates a new vec3 initialized with values from an existing vector

Params:

NameTypeAttributeDescription
a ReadonlyVec3

vector to clone

Return:

vec3

a new 3D vector

public clone(a: ReadonlyVec4): vec4 source

Creates a new vec4 initialized with values from an existing vector

Params:

NameTypeAttributeDescription
a ReadonlyVec4

vector to clone

Return:

vec4

a new 4D vector

public conjugate(out: quat, a: ReadonlyQuat): quat source

import {conjugate} from 'bimsurfer3/viewer/glmatrix/quat.js'

Calculates the conjugate of a quat If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.

Params:

NameTypeAttributeDescription
out quat

the receiving quaternion

a ReadonlyQuat

quat to calculate conjugate of

Return:

quat

out

public conjugate(out: quat2, a: ReadonlyQuat2): quat2 source

import {conjugate} from 'bimsurfer3/viewer/glmatrix/quat2.js'

Calculates the conjugate of a dual quat If the dual quaternion is normalized, this function is faster than quat2.inverse and produces the same result.

Params:

NameTypeAttributeDescription
out quat2

the receiving quaternion

a ReadonlyQuat2

quat to calculate conjugate of

Return:

quat2

out

public copy(out: mat2, a: ReadonlyMat2): mat2 source

Copy the values from one mat2 to another

Params:

NameTypeAttributeDescription
out mat2

the receiving matrix

a ReadonlyMat2

the source matrix

Return:

mat2

out

public copy(out: mat2d, a: ReadonlyMat2d): mat2d source

Copy the values from one mat2d to another

Params:

NameTypeAttributeDescription
out mat2d

the receiving matrix

a ReadonlyMat2d

the source matrix

Return:

mat2d

out

public copy(out: mat3, a: ReadonlyMat3): mat3 source

Copy the values from one mat3 to another

Params:

NameTypeAttributeDescription
out mat3

the receiving matrix

a ReadonlyMat3

the source matrix

Return:

mat3

out

public copy(out: mat4, a: ReadonlyMat4): mat4 source

Copy the values from one mat4 to another

Params:

NameTypeAttributeDescription
out mat4

the receiving matrix

a ReadonlyMat4

the source matrix

Return:

mat4

out

public copy(out: quat2, a: ReadonlyQuat2): quat2 source

Copy the values from one dual quat to another

Params:

NameTypeAttributeDescription
out quat2

the receiving dual quaternion

a ReadonlyQuat2

the source dual quaternion

Return:

quat2

out

public copy(out: vec2, a: ReadonlyVec2): vec2 source

Copy the values from one vec2 to another

Params:

NameTypeAttributeDescription
out vec2

the receiving vector

a ReadonlyVec2

the source vector

Return:

vec2

out

public copy(out: vec3, a: ReadonlyVec3): vec3 source

Copy the values from one vec3 to another

Params:

NameTypeAttributeDescription
out vec3

the receiving vector

a ReadonlyVec3

the source vector

Return:

vec3

out

public copy(out: vec4, a: ReadonlyVec4): vec4 source

Copy the values from one vec4 to another

Params:

NameTypeAttributeDescription
out vec4

the receiving vector

a ReadonlyVec4

the source vector

Return:

vec4

out

public create(): mat2 source

import {create} from 'bimsurfer3/viewer/glmatrix/mat2.js'

Creates a new identity mat2

Return:

mat2

a new 2x2 matrix

public create(): mat2d source

Creates a new identity mat2d

Return:

mat2d

a new 2x3 matrix

public create(): mat3 source

import {create} from 'bimsurfer3/viewer/glmatrix/mat3.js'

Creates a new identity mat3

Return:

mat3

a new 3x3 matrix

public create(): mat4 source

import {create} from 'bimsurfer3/viewer/glmatrix/mat4.js'

Creates a new identity mat4

Return:

mat4

a new 4x4 matrix

public create(): quat source

import {create} from 'bimsurfer3/viewer/glmatrix/quat.js'

Creates a new identity quat

Return:

quat

a new quaternion

public create(): quat2 source

Creates a new identity dual quat

Return:

quat2

a new dual quaternion [real -> rotation, dual -> translation]

public create(): vec2 source

import {create} from 'bimsurfer3/viewer/glmatrix/vec2.js'

Creates a new, empty vec2

Return:

vec2

a new 2D vector

public create(): vec3 source

import {create} from 'bimsurfer3/viewer/glmatrix/vec3.js'

Creates a new, empty vec3

Return:

vec3

a new 3D vector

public create(): vec4 source

import {create} from 'bimsurfer3/viewer/glmatrix/vec4.js'

Creates a new, empty vec4

Return:

vec4

a new 4D vector

public cross(out: vec3, a: ReadonlyVec2, b: ReadonlyVec2): vec3 source

Computes the cross product of two vec2's Note that the cross product must by definition produce a 3D vector

Params:

NameTypeAttributeDescription
out vec3

the receiving vector

a ReadonlyVec2

the first operand

b ReadonlyVec2

the second operand

Return:

vec3

out

public cross(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3): vec3 source

Computes the cross product of two vec3's

Params:

NameTypeAttributeDescription
out vec3

the receiving vector

a ReadonlyVec3

the first operand

b ReadonlyVec3

the second operand

Return:

vec3

out

public cross(result: ReadonlyVec4, U: ReadonlyVec4, V: ReadonlyVec4, W: ReadonlyVec4): vec4 source

Returns the cross-product of three vectors in a 4-dimensional space

Params:

NameTypeAttributeDescription
result ReadonlyVec4

the receiving vector

U ReadonlyVec4

the first vector

V ReadonlyVec4

the second vector

W ReadonlyVec4

the third vector

Return:

vec4

result

public determinant(a: ReadonlyMat2): Number source

import {determinant} from 'bimsurfer3/viewer/glmatrix/mat2.js'

Calculates the determinant of a mat2

Params:

NameTypeAttributeDescription
a ReadonlyMat2

the source matrix

Return:

Number

determinant of a

public determinant(a: ReadonlyMat2d): Number source

import {determinant} from 'bimsurfer3/viewer/glmatrix/mat2d.js'

Calculates the determinant of a mat2d

Params:

NameTypeAttributeDescription
a ReadonlyMat2d

the source matrix

Return:

Number

determinant of a

public determinant(a: ReadonlyMat3): Number source

import {determinant} from 'bimsurfer3/viewer/glmatrix/mat3.js'

Calculates the determinant of a mat3

Params:

NameTypeAttributeDescription
a ReadonlyMat3

the source matrix

Return:

Number

determinant of a

public determinant(a: ReadonlyMat4): Number source

import {determinant} from 'bimsurfer3/viewer/glmatrix/mat4.js'

Calculates the determinant of a mat4

Params:

NameTypeAttributeDescription
a ReadonlyMat4

the source matrix

Return:

Number

determinant of a

public distance(a: ReadonlyVec2, b: ReadonlyVec2): Number source

import {distance} from 'bimsurfer3/viewer/glmatrix/vec2.js'

Calculates the euclidian distance between two vec2's

Params:

NameTypeAttributeDescription
a ReadonlyVec2

the first operand

b ReadonlyVec2

the second operand

Return:

Number

distance between a and b

public distance(a: ReadonlyVec3, b: ReadonlyVec3): Number source

import {distance} from 'bimsurfer3/viewer/glmatrix/vec3.js'

Calculates the euclidian distance between two vec3's

Params:

NameTypeAttributeDescription
a ReadonlyVec3

the first operand

b ReadonlyVec3

the second operand

Return:

Number

distance between a and b

public distance(a: ReadonlyVec4, b: ReadonlyVec4): Number source

import {distance} from 'bimsurfer3/viewer/glmatrix/vec4.js'

Calculates the euclidian distance between two vec4's

Params:

NameTypeAttributeDescription
a ReadonlyVec4

the first operand

b ReadonlyVec4

the second operand

Return:

Number

distance between a and b

public divide(out: vec2, a: ReadonlyVec2, b: ReadonlyVec2): vec2 source

import {divide} from 'bimsurfer3/viewer/glmatrix/vec2.js'

Divides two vec2's

Params:

NameTypeAttributeDescription
out vec2

the receiving vector

a ReadonlyVec2

the first operand

b ReadonlyVec2

the second operand

Return:

vec2

out

public divide(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3): vec3 source

import {divide} from 'bimsurfer3/viewer/glmatrix/vec3.js'

Divides two vec3's

Params:

NameTypeAttributeDescription
out vec3

the receiving vector

a ReadonlyVec3

the first operand

b ReadonlyVec3

the second operand

Return:

vec3

out

public divide(out: vec4, a: ReadonlyVec4, b: ReadonlyVec4): vec4 source

import {divide} from 'bimsurfer3/viewer/glmatrix/vec4.js'

Divides two vec4's

Params:

NameTypeAttributeDescription
out vec4

the receiving vector

a ReadonlyVec4

the first operand

b ReadonlyVec4

the second operand

Return:

vec4

out

public dot(a: ReadonlyVec2, b: ReadonlyVec2): Number source

Calculates the dot product of two vec2's

Params:

NameTypeAttributeDescription
a ReadonlyVec2

the first operand

b ReadonlyVec2

the second operand

Return:

Number

dot product of a and b

public dot(a: ReadonlyVec3, b: ReadonlyVec3): Number source

Calculates the dot product of two vec3's

Params:

NameTypeAttributeDescription
a ReadonlyVec3

the first operand

b ReadonlyVec3

the second operand

Return:

Number

dot product of a and b

public dot(a: ReadonlyVec4, b: ReadonlyVec4): Number source

Calculates the dot product of two vec4's

Params:

NameTypeAttributeDescription
a ReadonlyVec4

the first operand

b ReadonlyVec4

the second operand

Return:

Number

dot product of a and b

public equals(a: Number, b: Number): Boolean source

Tests whether or not the arguments have approximately the same value, within an absolute or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less than or equal to 1.0, and a relative tolerance is used for larger values)

Params:

NameTypeAttributeDescription
a Number

The first number to test.

b Number

The second number to test.

Return:

Boolean

True if the numbers are approximately equal, false otherwise.

public equals(a: ReadonlyMat2, b: ReadonlyMat2): Boolean source

import {equals} from 'bimsurfer3/viewer/glmatrix/mat2.js'

Returns whether or not the matrices have approximately the same elements in the same position.

Params:

NameTypeAttributeDescription
a ReadonlyMat2

The first matrix.

b ReadonlyMat2

The second matrix.

Return:

Boolean

True if the matrices are equal, false otherwise.

public equals(a: ReadonlyMat2d, b: ReadonlyMat2d): Boolean source

Returns whether or not the matrices have approximately the same elements in the same position.

Params:

NameTypeAttributeDescription
a ReadonlyMat2d

The first matrix.

b ReadonlyMat2d

The second matrix.

Return:

Boolean

True if the matrices are equal, false otherwise.

public equals(a: ReadonlyMat3, b: ReadonlyMat3): Boolean source

import {equals} from 'bimsurfer3/viewer/glmatrix/mat3.js'

Returns whether or not the matrices have approximately the same elements in the same position.

Params:

NameTypeAttributeDescription
a ReadonlyMat3

The first matrix.

b ReadonlyMat3

The second matrix.

Return:

Boolean

True if the matrices are equal, false otherwise.

public equals(a: ReadonlyMat4, b: ReadonlyMat4): Boolean source

import {equals} from 'bimsurfer3/viewer/glmatrix/mat4.js'

Returns whether or not the matrices have approximately the same elements in the same position.

Params:

NameTypeAttributeDescription
a ReadonlyMat4

The first matrix.

b ReadonlyMat4

The second matrix.

Return:

Boolean

True if the matrices are equal, false otherwise.

public equals(a: ReadonlyQuat2, b: ReadonlyQuat2): Boolean source

Returns whether or not the dual quaternions have approximately the same elements in the same position.

Params:

NameTypeAttributeDescription
a ReadonlyQuat2

the first dual quat.

b ReadonlyQuat2

the second dual quat.

Return:

Boolean

true if the dual quats are equal, false otherwise.

public equals(a: ReadonlyVec2, b: ReadonlyVec2): Boolean source

import {equals} from 'bimsurfer3/viewer/glmatrix/vec2.js'

Returns whether or not the vectors have approximately the same elements in the same position.

Params:

NameTypeAttributeDescription
a ReadonlyVec2

The first vector.

b ReadonlyVec2

The second vector.

Return:

Boolean

True if the vectors are equal, false otherwise.

public equals(a: ReadonlyVec3, b: ReadonlyVec3): Boolean source

import {equals} from 'bimsurfer3/viewer/glmatrix/vec3.js'

Returns whether or not the vectors have approximately the same elements in the same position.

Params:

NameTypeAttributeDescription
a ReadonlyVec3

The first vector.

b ReadonlyVec3

The second vector.

Return:

Boolean

True if the vectors are equal, false otherwise.

public equals(a: ReadonlyVec4, b: ReadonlyVec4): Boolean source

import {equals} from 'bimsurfer3/viewer/glmatrix/vec4.js'

Returns whether or not the vectors have approximately the same elements in the same position.

Params:

NameTypeAttributeDescription
a ReadonlyVec4

The first vector.

b ReadonlyVec4

The second vector.

Return:

Boolean

True if the vectors are equal, false otherwise.

public exactEquals(a: ReadonlyMat2, b: ReadonlyMat2): Boolean source

import {exactEquals} from 'bimsurfer3/viewer/glmatrix/mat2.js'

Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)

Params:

NameTypeAttributeDescription
a ReadonlyMat2

The first matrix.

b ReadonlyMat2

The second matrix.

Return:

Boolean

True if the matrices are equal, false otherwise.

public exactEquals(a: ReadonlyMat2d, b: ReadonlyMat2d): Boolean source

import {exactEquals} from 'bimsurfer3/viewer/glmatrix/mat2d.js'

Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)

Params:

NameTypeAttributeDescription
a ReadonlyMat2d

The first matrix.

b ReadonlyMat2d

The second matrix.

Return:

Boolean

True if the matrices are equal, false otherwise.

public exactEquals(a: ReadonlyMat3, b: ReadonlyMat3): Boolean source

import {exactEquals} from 'bimsurfer3/viewer/glmatrix/mat3.js'

Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)

Params:

NameTypeAttributeDescription
a ReadonlyMat3

The first matrix.

b ReadonlyMat3

The second matrix.

Return:

Boolean

True if the matrices are equal, false otherwise.

public exactEquals(a: ReadonlyMat4, b: ReadonlyMat4): Boolean source

import {exactEquals} from 'bimsurfer3/viewer/glmatrix/mat4.js'

Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)

Params:

NameTypeAttributeDescription
a ReadonlyMat4

The first matrix.

b ReadonlyMat4

The second matrix.

Return:

Boolean

True if the matrices are equal, false otherwise.

public exactEquals(a: ReadonlyQuat2, b: ReadonlyQuat2): Boolean source

import {exactEquals} from 'bimsurfer3/viewer/glmatrix/quat2.js'

Returns whether or not the dual quaternions have exactly the same elements in the same position (when compared with ===)

Params:

NameTypeAttributeDescription
a ReadonlyQuat2

the first dual quaternion.

b ReadonlyQuat2

the second dual quaternion.

Return:

Boolean

true if the dual quaternions are equal, false otherwise.

public exactEquals(a: ReadonlyVec2, b: ReadonlyVec2): Boolean source

import {exactEquals} from 'bimsurfer3/viewer/glmatrix/vec2.js'

Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)

Params:

NameTypeAttributeDescription
a ReadonlyVec2

The first vector.

b ReadonlyVec2

The second vector.

Return:

Boolean

True if the vectors are equal, false otherwise.

public exactEquals(a: ReadonlyVec3, b: ReadonlyVec3): Boolean source

import {exactEquals} from 'bimsurfer3/viewer/glmatrix/vec3.js'

Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)

Params:

NameTypeAttributeDescription
a ReadonlyVec3

The first vector.

b ReadonlyVec3

The second vector.

Return:

Boolean

True if the vectors are equal, false otherwise.

public exactEquals(a: ReadonlyVec4, b: ReadonlyVec4): Boolean source

import {exactEquals} from 'bimsurfer3/viewer/glmatrix/vec4.js'

Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)

Params:

NameTypeAttributeDescription
a ReadonlyVec4

The first vector.

b ReadonlyVec4

The second vector.

Return:

Boolean

True if the vectors are equal, false otherwise.

public exp(out: quat, a: ReadonlyQuat): quat source

Calculate the exponential of a unit quaternion.

Params:

NameTypeAttributeDescription
out quat

the receiving quaternion

a ReadonlyQuat

quat to calculate the exponential of

Return:

quat

out

public floor(out: vec2, a: ReadonlyVec2): vec2 source

Math.floor the components of a vec2

Params:

NameTypeAttributeDescription
out vec2

the receiving vector

a ReadonlyVec2

vector to floor

Return:

vec2

out

public floor(out: vec3, a: ReadonlyVec3): vec3 source

Math.floor the components of a vec3

Params:

NameTypeAttributeDescription
out vec3

the receiving vector

a ReadonlyVec3

vector to floor

Return:

vec3

out

public floor(out: vec4, a: ReadonlyVec4): vec4 source

Math.floor the components of a vec4

Params:

NameTypeAttributeDescription
out vec4

the receiving vector

a ReadonlyVec4

vector to floor

Return:

vec4

out

public frob(a: ReadonlyMat2): Number source

Returns Frobenius norm of a mat2

Params:

NameTypeAttributeDescription
a ReadonlyMat2

the matrix to calculate Frobenius norm of

Return:

Number

Frobenius norm

public frob(a: ReadonlyMat2d): Number source

Returns Frobenius norm of a mat2d

Params:

NameTypeAttributeDescription
a ReadonlyMat2d

the matrix to calculate Frobenius norm of

Return:

Number

Frobenius norm

public frob(a: ReadonlyMat3): Number source

Returns Frobenius norm of a mat3

Params:

NameTypeAttributeDescription
a ReadonlyMat3

the matrix to calculate Frobenius norm of

Return:

Number

Frobenius norm

public frob(a: ReadonlyMat4): Number source

Returns Frobenius norm of a mat4

Params:

NameTypeAttributeDescription
a ReadonlyMat4

the matrix to calculate Frobenius norm of

Return:

Number

Frobenius norm

public fromEuler(out: quat, Angle: x, Angle: y, Angle: z): quat source

import {fromEuler} from 'bimsurfer3/viewer/glmatrix/quat.js'

Creates a quaternion from the given euler angle x, y, z.

Params:

NameTypeAttributeDescription
out quat

the receiving quaternion

Angle x

to rotate around X axis in degrees.

Angle y

to rotate around Y axis in degrees.

Angle z

to rotate around Z axis in degrees.

Return:

quat

out

public fromMat2d(out: mat3, a: ReadonlyMat2d): mat3 source

import {fromMat2d} from 'bimsurfer3/viewer/glmatrix/mat3.js'

Copies the values from a mat2d into a mat3

Params:

NameTypeAttributeDescription
out mat3

the receiving matrix

a ReadonlyMat2d

the matrix to copy

Return:

mat3

out

public fromMat3(out: quat, m: ReadonlyMat3): quat source

import {fromMat3} from 'bimsurfer3/viewer/glmatrix/quat.js'

Creates a quaternion from the given 3x3 rotation matrix.

NOTE: The resultant quaternion is not normalized, so you should be sure to renormalize the quaternion yourself where necessary.

Params:

NameTypeAttributeDescription
out quat

the receiving quaternion

m ReadonlyMat3

rotation matrix

Return:

quat

out

public fromMat4(out: mat3, a: ReadonlyMat4): mat3 source

import {fromMat4} from 'bimsurfer3/viewer/glmatrix/mat3.js'

Copies the upper-left 3x3 values into the given mat3.

Params:

NameTypeAttributeDescription
out mat3

the receiving 3x3 matrix

a ReadonlyMat4

the source 4x4 matrix

Return:

mat3

out

public fromMat4(out: quat2, a: ReadonlyMat4): quat2 source

import {fromMat4} from 'bimsurfer3/viewer/glmatrix/quat2.js'

Creates a new dual quat from a matrix (4x4)

Params:

NameTypeAttributeDescription
out quat2

the dual quaternion

a ReadonlyMat4

the matrix

Return:

quat2

dual quat receiving operation result

public fromQuat(out: mat3, q: ReadonlyQuat): mat3 source

import {fromQuat} from 'bimsurfer3/viewer/glmatrix/mat3.js'

Calculates a 3x3 matrix from the given quaternion

Params:

NameTypeAttributeDescription
out mat3

mat3 receiving operation result

q ReadonlyQuat

Quaternion to create matrix from

Return:

mat3

out

public fromQuat(out: mat4, q: ReadonlyQuat): mat4 source

import {fromQuat} from 'bimsurfer3/viewer/glmatrix/mat4.js'

Calculates a 4x4 matrix from the given quaternion

Params:

NameTypeAttributeDescription
out mat4

mat4 receiving operation result

q ReadonlyQuat

Quaternion to create matrix from

Return:

mat4

out

public fromQuat2(out: mat4, a: ReadonlyQuat2): mat4 source

import {fromQuat2} from 'bimsurfer3/viewer/glmatrix/mat4.js'

Creates a new mat4 from a dual quat.

Params:

NameTypeAttributeDescription
out mat4

Matrix

a ReadonlyQuat2

Dual Quaternion

Return:

mat4

mat4 receiving operation result

public fromRotation(out: mat2, rad: Number): mat2 source

import {fromRotation} from 'bimsurfer3/viewer/glmatrix/mat2.js'

Creates a matrix from a given angle This is equivalent to (but much faster than):

mat2.identity(dest);
mat2.rotate(dest, dest, rad);

Params:

NameTypeAttributeDescription
out mat2

mat2 receiving operation result

rad Number

the angle to rotate the matrix by

Return:

mat2

out

public fromRotation(out: mat2d, rad: Number): mat2d source

import {fromRotation} from 'bimsurfer3/viewer/glmatrix/mat2d.js'

Creates a matrix from a given angle This is equivalent to (but much faster than):

mat2d.identity(dest);
mat2d.rotate(dest, dest, rad);

Params:

NameTypeAttributeDescription
out mat2d

mat2d receiving operation result

rad Number

the angle to rotate the matrix by

Return:

mat2d

out

public fromRotation(out: mat3, rad: Number): mat3 source

import {fromRotation} from 'bimsurfer3/viewer/glmatrix/mat3.js'

Creates a matrix from a given angle This is equivalent to (but much faster than):

mat3.identity(dest);
mat3.rotate(dest, dest, rad);

Params:

NameTypeAttributeDescription
out mat3

mat3 receiving operation result

rad Number

the angle to rotate the matrix by

Return:

mat3

out

public fromRotation(out: mat4, rad: Number, axis: ReadonlyVec3): mat4 source

import {fromRotation} from 'bimsurfer3/viewer/glmatrix/mat4.js'

Creates a matrix from a given angle around a given axis This is equivalent to (but much faster than):

mat4.identity(dest);
mat4.rotate(dest, dest, rad, axis);

Params:

NameTypeAttributeDescription
out mat4

mat4 receiving operation result

rad Number

the angle to rotate the matrix by

axis ReadonlyVec3

the axis to rotate around

Return:

mat4

out

public fromRotation(dual: ReadonlyQuat2, q: ReadonlyQuat): quat2 source

import {fromRotation} from 'bimsurfer3/viewer/glmatrix/quat2.js'

Creates a dual quat from a quaternion

Params:

NameTypeAttributeDescription
dual ReadonlyQuat2

quaternion receiving operation result

q ReadonlyQuat

the quaternion

Return:

quat2

dual quaternion receiving operation result

public fromRotationTranslation(out: mat4, q: quat4, v: ReadonlyVec3): mat4 source

import {fromRotationTranslation} from 'bimsurfer3/viewer/glmatrix/mat4.js'

Creates a matrix from a quaternion rotation and vector translation This is equivalent to (but much faster than):

mat4.identity(dest);
mat4.translate(dest, vec);
let quatMat = mat4.create();
quat4.toMat4(quat, quatMat);
mat4.multiply(dest, quatMat);

Params:

NameTypeAttributeDescription
out mat4

mat4 receiving operation result

q quat4

Rotation quaternion

v ReadonlyVec3

Translation vector

Return:

mat4

out

public fromRotationTranslation(dual: ReadonlyQuat2, q: ReadonlyQuat, t: ReadonlyVec3): quat2 source

import {fromRotationTranslation} from 'bimsurfer3/viewer/glmatrix/quat2.js'

Creates a dual quat from a quaternion and a translation

Params:

NameTypeAttributeDescription
dual ReadonlyQuat2

quaternion receiving operation result

q ReadonlyQuat

a normalized quaternion

t ReadonlyVec3

tranlation vector

Return:

quat2

dual quaternion receiving operation result

public fromRotationTranslationScale(out: mat4, q: quat4, v: ReadonlyVec3, s: ReadonlyVec3): mat4 source

import {fromRotationTranslationScale} from 'bimsurfer3/viewer/glmatrix/mat4.js'

Creates a matrix from a quaternion rotation, vector translation and vector scale This is equivalent to (but much faster than):

mat4.identity(dest);
mat4.translate(dest, vec);
let quatMat = mat4.create();
quat4.toMat4(quat, quatMat);
mat4.multiply(dest, quatMat);
mat4.scale(dest, scale)

Params:

NameTypeAttributeDescription
out mat4

mat4 receiving operation result

q quat4

Rotation quaternion

v ReadonlyVec3

Translation vector

s ReadonlyVec3

Scaling vector

Return:

mat4

out

public fromRotationTranslationScaleOrigin(out: mat4, q: quat4, v: ReadonlyVec3, s: ReadonlyVec3, o: ReadonlyVec3): mat4 source

import {fromRotationTranslationScaleOrigin} from 'bimsurfer3/viewer/glmatrix/mat4.js'

Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin This is equivalent to (but much faster than):

mat4.identity(dest);
mat4.translate(dest, vec);
mat4.translate(dest, origin);
let quatMat = mat4.create();
quat4.toMat4(quat, quatMat);
mat4.multiply(dest, quatMat);
mat4.scale(dest, scale)
mat4.translate(dest, negativeOrigin);

Params:

NameTypeAttributeDescription
out mat4

mat4 receiving operation result

q quat4

Rotation quaternion

v ReadonlyVec3

Translation vector

s ReadonlyVec3

Scaling vector

o ReadonlyVec3

The origin vector around which to scale and rotate

Return:

mat4

out

public fromRotationTranslationValues(x1: Number, y1: Number, z1: Number, w1: Number, x2: Number, y2: Number, z2: Number): quat2 source

import {fromRotationTranslationValues} from 'bimsurfer3/viewer/glmatrix/quat2.js'

Creates a new dual quat from the given values (quat and translation)

Params:

NameTypeAttributeDescription
x1 Number

X component

y1 Number

Y component

z1 Number

Z component

w1 Number

W component

x2 Number

X component (translation)

y2 Number

Y component (translation)

z2 Number

Z component (translation)

Return:

quat2

new dual quaternion

public fromScaling(out: mat2, v: ReadonlyVec2): mat2 source

import {fromScaling} from 'bimsurfer3/viewer/glmatrix/mat2.js'

Creates a matrix from a vector scaling This is equivalent to (but much faster than):

mat2.identity(dest);
mat2.scale(dest, dest, vec);

Params:

NameTypeAttributeDescription
out mat2

mat2 receiving operation result

v ReadonlyVec2

Scaling vector

Return:

mat2

out

public fromScaling(out: mat2d, v: ReadonlyVec2): mat2d source

import {fromScaling} from 'bimsurfer3/viewer/glmatrix/mat2d.js'

Creates a matrix from a vector scaling This is equivalent to (but much faster than):

mat2d.identity(dest);
mat2d.scale(dest, dest, vec);

Params:

NameTypeAttributeDescription
out mat2d

mat2d receiving operation result

v ReadonlyVec2

Scaling vector

Return:

mat2d

out

public fromScaling(out: mat3, v: ReadonlyVec2): mat3 source

import {fromScaling} from 'bimsurfer3/viewer/glmatrix/mat3.js'

Creates a matrix from a vector scaling This is equivalent to (but much faster than):

mat3.identity(dest);
mat3.scale(dest, dest, vec);

Params:

NameTypeAttributeDescription
out mat3

mat3 receiving operation result

v ReadonlyVec2

Scaling vector

Return:

mat3

out

public fromScaling(out: mat4, v: ReadonlyVec3): mat4 source

import {fromScaling} from 'bimsurfer3/viewer/glmatrix/mat4.js'

Creates a matrix from a vector scaling This is equivalent to (but much faster than):

mat4.identity(dest);
mat4.scale(dest, dest, vec);

Params:

NameTypeAttributeDescription
out mat4

mat4 receiving operation result

v ReadonlyVec3

Scaling vector

Return:

mat4

out

public fromTranslation(out: mat2d, v: ReadonlyVec2): mat2d source

import {fromTranslation} from 'bimsurfer3/viewer/glmatrix/mat2d.js'

Creates a matrix from a vector translation This is equivalent to (but much faster than):

mat2d.identity(dest);
mat2d.translate(dest, dest, vec);

Params:

NameTypeAttributeDescription
out mat2d

mat2d receiving operation result

v ReadonlyVec2

Translation vector

Return:

mat2d

out

public fromTranslation(out: mat3, v: ReadonlyVec2): mat3 source

import {fromTranslation} from 'bimsurfer3/viewer/glmatrix/mat3.js'

Creates a matrix from a vector translation This is equivalent to (but much faster than):

mat3.identity(dest);
mat3.translate(dest, dest, vec);

Params:

NameTypeAttributeDescription
out mat3

mat3 receiving operation result

v ReadonlyVec2

Translation vector

Return:

mat3

out

public fromTranslation(out: mat4, v: ReadonlyVec3): mat4 source

import {fromTranslation} from 'bimsurfer3/viewer/glmatrix/mat4.js'

Creates a matrix from a vector translation This is equivalent to (but much faster than):

mat4.identity(dest);
mat4.translate(dest, dest, vec);

Params:

NameTypeAttributeDescription
out mat4

mat4 receiving operation result

v ReadonlyVec3

Translation vector

Return:

mat4

out

public fromTranslation(dual: ReadonlyQuat2, t: ReadonlyVec3): quat2 source

import {fromTranslation} from 'bimsurfer3/viewer/glmatrix/quat2.js'

Creates a dual quat from a translation

Params:

NameTypeAttributeDescription
dual ReadonlyQuat2

quaternion receiving operation result

t ReadonlyVec3

translation vector

Return:

quat2

dual quaternion receiving operation result

public fromValues(m00: Number, m01: Number, m10: Number, m11: Number): mat2 source

import {fromValues} from 'bimsurfer3/viewer/glmatrix/mat2.js'

Create a new mat2 with the given values

Params:

NameTypeAttributeDescription
m00 Number

Component in column 0, row 0 position (index 0)

m01 Number

Component in column 0, row 1 position (index 1)

m10 Number

Component in column 1, row 0 position (index 2)

m11 Number

Component in column 1, row 1 position (index 3)

Return:

mat2

out A new 2x2 matrix

public fromValues(a: Number, b: Number, c: Number, d: Number, tx: Number, ty: Number): mat2d source

import {fromValues} from 'bimsurfer3/viewer/glmatrix/mat2d.js'

Create a new mat2d with the given values

Params:

NameTypeAttributeDescription
a Number

Component A (index 0)

b Number

Component B (index 1)

c Number

Component C (index 2)

d Number

Component D (index 3)

tx Number

Component TX (index 4)

ty Number

Component TY (index 5)

Return:

mat2d

A new mat2d

public fromValues(m00: Number, m01: Number, m02: Number, m10: Number, m11: Number, m12: Number, m20: Number, m21: Number, m22: Number): mat3 source

import {fromValues} from 'bimsurfer3/viewer/glmatrix/mat3.js'

Create a new mat3 with the given values

Params:

NameTypeAttributeDescription
m00 Number

Component in column 0, row 0 position (index 0)

m01 Number

Component in column 0, row 1 position (index 1)

m02 Number

Component in column 0, row 2 position (index 2)

m10 Number

Component in column 1, row 0 position (index 3)

m11 Number

Component in column 1, row 1 position (index 4)

m12 Number

Component in column 1, row 2 position (index 5)

m20 Number

Component in column 2, row 0 position (index 6)

m21 Number

Component in column 2, row 1 position (index 7)

m22 Number

Component in column 2, row 2 position (index 8)

Return:

mat3

A new mat3

public fromValues(m00: Number, m01: Number, m02: Number, m03: Number, m10: Number, m11: Number, m12: Number, m13: Number, m20: Number, m21: Number, m22: Number, m23: Number, m30: Number, m31: Number, m32: Number, m33: Number): mat4 source

import {fromValues} from 'bimsurfer3/viewer/glmatrix/mat4.js'

Create a new mat4 with the given values

Params:

NameTypeAttributeDescription
m00 Number

Component in column 0, row 0 position (index 0)

m01 Number

Component in column 0, row 1 position (index 1)

m02 Number

Component in column 0, row 2 position (index 2)

m03 Number

Component in column 0, row 3 position (index 3)

m10 Number

Component in column 1, row 0 position (index 4)

m11 Number

Component in column 1, row 1 position (index 5)

m12 Number

Component in column 1, row 2 position (index 6)

m13 Number

Component in column 1, row 3 position (index 7)

m20 Number

Component in column 2, row 0 position (index 8)

m21 Number

Component in column 2, row 1 position (index 9)

m22 Number

Component in column 2, row 2 position (index 10)

m23 Number

Component in column 2, row 3 position (index 11)

m30 Number

Component in column 3, row 0 position (index 12)

m31 Number

Component in column 3, row 1 position (index 13)

m32 Number

Component in column 3, row 2 position (index 14)

m33 Number

Component in column 3, row 3 position (index 15)

Return:

mat4

A new mat4

public fromValues(x1: Number, y1: Number, z1: Number, w1: Number, x2: Number, y2: Number, z2: Number, w2: Number): quat2 source

import {fromValues} from 'bimsurfer3/viewer/glmatrix/quat2.js'

Creates a new dual quat initialized with the given values

Params:

NameTypeAttributeDescription
x1 Number

X component

y1 Number

Y component

z1 Number

Z component

w1 Number

W component

x2 Number

X component

y2 Number

Y component

z2 Number

Z component

w2 Number

W component

Return:

quat2

new dual quaternion

public fromValues(x: Number, y: Number): vec2 source

import {fromValues} from 'bimsurfer3/viewer/glmatrix/vec2.js'

Creates a new vec2 initialized with the given values

Params:

NameTypeAttributeDescription
x Number

X component

y Number

Y component

Return:

vec2

a new 2D vector

public fromValues(x: Number, y: Number, z: Number): vec3 source

import {fromValues} from 'bimsurfer3/viewer/glmatrix/vec3.js'

Creates a new vec3 initialized with the given values

Params:

NameTypeAttributeDescription
x Number

X component

y Number

Y component

z Number

Z component

Return:

vec3

a new 3D vector

public fromValues(x: Number, y: Number, z: Number, w: Number): vec4 source

import {fromValues} from 'bimsurfer3/viewer/glmatrix/vec4.js'

Creates a new vec4 initialized with the given values

Params:

NameTypeAttributeDescription
x Number

X component

y Number

Y component

z Number

Z component

w Number

W component

Return:

vec4

a new 4D vector

public fromXRotation(out: mat4, rad: Number): mat4 source

import {fromXRotation} from 'bimsurfer3/viewer/glmatrix/mat4.js'

Creates a matrix from the given angle around the X axis This is equivalent to (but much faster than):

mat4.identity(dest);
mat4.rotateX(dest, dest, rad);

Params:

NameTypeAttributeDescription
out mat4

mat4 receiving operation result

rad Number

the angle to rotate the matrix by

Return:

mat4

out

public fromYRotation(out: mat4, rad: Number): mat4 source

import {fromYRotation} from 'bimsurfer3/viewer/glmatrix/mat4.js'

Creates a matrix from the given angle around the Y axis This is equivalent to (but much faster than):

mat4.identity(dest);
mat4.rotateY(dest, dest, rad);

Params:

NameTypeAttributeDescription
out mat4

mat4 receiving operation result

rad Number

the angle to rotate the matrix by

Return:

mat4

out

public fromZRotation(out: mat4, rad: Number): mat4 source

import {fromZRotation} from 'bimsurfer3/viewer/glmatrix/mat4.js'

Creates a matrix from the given angle around the Z axis This is equivalent to (but much faster than):

mat4.identity(dest);
mat4.rotateZ(dest, dest, rad);

Params:

NameTypeAttributeDescription
out mat4

mat4 receiving operation result

rad Number

the angle to rotate the matrix by

Return:

mat4

out

public frustum(out: mat4, left: Number, right: Number, bottom: Number, top: Number, near: Number, far: Number): mat4 source

import {frustum} from 'bimsurfer3/viewer/glmatrix/mat4.js'

Generates a frustum matrix with the given bounds

Params:

NameTypeAttributeDescription
out mat4

mat4 frustum matrix will be written into

left Number

Left bound of the frustum

right Number

Right bound of the frustum

bottom Number

Bottom bound of the frustum

top Number

Top bound of the frustum

near Number

Near bound of the frustum

far Number

Far bound of the frustum

Return:

mat4

out

public getAngle(a: ReadonlyQuat, b: ReadonlyQuat): Number source

import {getAngle} from 'bimsurfer3/viewer/glmatrix/quat.js'

Gets the angular distance between two unit quaternions

Params:

NameTypeAttributeDescription
a ReadonlyQuat

Origin unit quaternion

b ReadonlyQuat

Destination unit quaternion

Return:

Number

Angle, in radians, between the two quaternions

public getAxisAngle(out_axis: vec3, q: ReadonlyQuat): Number source

import {getAxisAngle} from 'bimsurfer3/viewer/glmatrix/quat.js'

Gets the rotation axis and angle for a given quaternion. If a quaternion is created with setAxisAngle, this method will return the same values as providied in the original parameter list OR functionally equivalent values. Example: The quaternion formed by axis [0, 0, 1] and angle -90 is the same as the quaternion formed by [0, 0, 1] and 270. This method favors the latter.

Params:

NameTypeAttributeDescription
out_axis vec3

Vector receiving the axis of rotation

q ReadonlyQuat

Quaternion to be decomposed

Return:

Number

Angle, in radians, of the rotation

public getDual(out: quat, a: ReadonlyQuat2): quat source

import {getDual} from 'bimsurfer3/viewer/glmatrix/quat2.js'

Gets the dual part of a dual quat

Params:

NameTypeAttributeDescription
out quat

dual part

a ReadonlyQuat2

Dual Quaternion

Return:

quat

dual part

public getRotation(out: quat, mat: ReadonlyMat4): quat source

import {getRotation} from 'bimsurfer3/viewer/glmatrix/mat4.js'

Returns a quaternion representing the rotational component of a transformation matrix. If a matrix is built with fromRotationTranslation, the returned quaternion will be the same as the quaternion originally supplied.

Params:

NameTypeAttributeDescription
out quat

Quaternion to receive the rotation component

mat ReadonlyMat4

Matrix to be decomposed (input)

Return:

quat

out

public getScaling(out: vec3, mat: ReadonlyMat4): vec3 source

import {getScaling} from 'bimsurfer3/viewer/glmatrix/mat4.js'

Returns the scaling factor component of a transformation matrix. If a matrix is built with fromRotationTranslationScale with a normalized Quaternion paramter, the returned vector will be the same as the scaling vector originally supplied.

Params:

NameTypeAttributeDescription
out vec3

Vector to receive scaling factor component

mat ReadonlyMat4

Matrix to be decomposed (input)

Return:

vec3

out

public getTranslation(out: vec3, mat: ReadonlyMat4): vec3 source

import {getTranslation} from 'bimsurfer3/viewer/glmatrix/mat4.js'

Returns the translation vector component of a transformation matrix. If a matrix is built with fromRotationTranslation, the returned vector will be the same as the translation vector originally supplied.

Params:

NameTypeAttributeDescription
out vec3

Vector to receive translation component

mat ReadonlyMat4

Matrix to be decomposed (input)

Return:

vec3

out

public getTranslation(out: vec3, a: ReadonlyQuat2): vec3 source

import {getTranslation} from 'bimsurfer3/viewer/glmatrix/quat2.js'

Gets the translation of a normalized dual quat

Params:

NameTypeAttributeDescription
out vec3

translation

a ReadonlyQuat2

Dual Quaternion to be decomposed

Return:

vec3

translation

public hermite(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3, c: ReadonlyVec3, d: ReadonlyVec3, t: Number): vec3 source

import {hermite} from 'bimsurfer3/viewer/glmatrix/vec3.js'

Performs a hermite interpolation with two control points

Params:

NameTypeAttributeDescription
out vec3

the receiving vector

a ReadonlyVec3

the first operand

b ReadonlyVec3

the second operand

c ReadonlyVec3

the third operand

d ReadonlyVec3

the fourth operand

t Number

interpolation amount, in the range [0-1], between the two inputs

Return:

vec3

out

public identity(out: mat2): mat2 source

import {identity} from 'bimsurfer3/viewer/glmatrix/mat2.js'

Set a mat2 to the identity matrix

Params:

NameTypeAttributeDescription
out mat2

the receiving matrix

Return:

mat2

out

public identity(out: mat2d): mat2d source

import {identity} from 'bimsurfer3/viewer/glmatrix/mat2d.js'

Set a mat2d to the identity matrix

Params:

NameTypeAttributeDescription
out mat2d

the receiving matrix

Return:

mat2d

out

public identity(out: mat3): mat3 source

import {identity} from 'bimsurfer3/viewer/glmatrix/mat3.js'

Set a mat3 to the identity matrix

Params:

NameTypeAttributeDescription
out mat3

the receiving matrix

Return:

mat3

out

public identity(out: mat4): mat4 source

import {identity} from 'bimsurfer3/viewer/glmatrix/mat4.js'

Set a mat4 to the identity matrix

Params:

NameTypeAttributeDescription
out mat4

the receiving matrix

Return:

mat4

out

public identity(out: quat): quat source

import {identity} from 'bimsurfer3/viewer/glmatrix/quat.js'

Set a quat to the identity quaternion

Params:

NameTypeAttributeDescription
out quat

the receiving quaternion

Return:

quat

out

public identity(out: quat2): quat2 source

import {identity} from 'bimsurfer3/viewer/glmatrix/quat2.js'

Set a dual quat to the identity dual quaternion

Params:

NameTypeAttributeDescription
out quat2

the receiving quaternion

Return:

quat2

out

public inverse(out: vec2, a: ReadonlyVec2): vec2 source

import {inverse} from 'bimsurfer3/viewer/glmatrix/vec2.js'

Returns the inverse of the components of a vec2

Params:

NameTypeAttributeDescription
out vec2

the receiving vector

a ReadonlyVec2

vector to invert

Return:

vec2

out

public inverse(out: vec3, a: ReadonlyVec3): vec3 source

import {inverse} from 'bimsurfer3/viewer/glmatrix/vec3.js'

Returns the inverse of the components of a vec3

Params:

NameTypeAttributeDescription
out vec3

the receiving vector

a ReadonlyVec3

vector to invert

Return:

vec3

out

public inverse(out: vec4, a: ReadonlyVec4): vec4 source

import {inverse} from 'bimsurfer3/viewer/glmatrix/vec4.js'

Returns the inverse of the components of a vec4

Params:

NameTypeAttributeDescription
out vec4

the receiving vector

a ReadonlyVec4

vector to invert

Return:

vec4

out

public invert(out: mat2, a: ReadonlyMat2): mat2 source

import {invert} from 'bimsurfer3/viewer/glmatrix/mat2.js'

Inverts a mat2

Params:

NameTypeAttributeDescription
out mat2

the receiving matrix

a ReadonlyMat2

the source matrix

Return:

mat2

out

public invert(out: mat2d, a: ReadonlyMat2d): mat2d source

Inverts a mat2d

Params:

NameTypeAttributeDescription
out mat2d

the receiving matrix

a ReadonlyMat2d

the source matrix

Return:

mat2d

out

public invert(out: mat3, a: ReadonlyMat3): mat3 source

import {invert} from 'bimsurfer3/viewer/glmatrix/mat3.js'

Inverts a mat3

Params:

NameTypeAttributeDescription
out mat3

the receiving matrix

a ReadonlyMat3

the source matrix

Return:

mat3

out

public invert(out: mat4, a: ReadonlyMat4): mat4 source

import {invert} from 'bimsurfer3/viewer/glmatrix/mat4.js'

Inverts a mat4

Params:

NameTypeAttributeDescription
out mat4

the receiving matrix

a ReadonlyMat4

the source matrix

Return:

mat4

out

public invert(out: quat, a: ReadonlyQuat): quat source

import {invert} from 'bimsurfer3/viewer/glmatrix/quat.js'

Calculates the inverse of a quat

Params:

NameTypeAttributeDescription
out quat

the receiving quaternion

a ReadonlyQuat

quat to calculate inverse of

Return:

quat

out

public invert(out: quat2, a: ReadonlyQuat2): quat2 source

Calculates the inverse of a dual quat. If they are normalized, conjugate is cheaper

Params:

NameTypeAttributeDescription
out quat2

the receiving dual quaternion

a ReadonlyQuat2

dual quat to calculate inverse of

Return:

quat2

out

public length(a: ReadonlyVec2): Number source

import {length} from 'bimsurfer3/viewer/glmatrix/vec2.js'

Calculates the length of a vec2

Params:

NameTypeAttributeDescription
a ReadonlyVec2

vector to calculate length of

Return:

Number

length of a

public length(a: ReadonlyVec3): Number source

import {length} from 'bimsurfer3/viewer/glmatrix/vec3.js'

Calculates the length of a vec3

Params:

NameTypeAttributeDescription
a ReadonlyVec3

vector to calculate length of

Return:

Number

length of a

public length(a: ReadonlyVec4): Number source

import {length} from 'bimsurfer3/viewer/glmatrix/vec4.js'

Calculates the length of a vec4

Params:

NameTypeAttributeDescription
a ReadonlyVec4

vector to calculate length of

Return:

Number

length of a

public lerp(out: quat2, a: ReadonlyQuat2, b: ReadonlyQuat2, t: Number): quat2 source

Performs a linear interpolation between two dual quats's NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when t = 0.5)

Params:

NameTypeAttributeDescription
out quat2

the receiving dual quat

a ReadonlyQuat2

the first operand

b ReadonlyQuat2

the second operand

t Number

interpolation amount, in the range [0-1], between the two inputs

Return:

quat2

out

public lerp(out: vec2, a: ReadonlyVec2, b: ReadonlyVec2, t: Number): vec2 source

Performs a linear interpolation between two vec2's

Params:

NameTypeAttributeDescription
out vec2

the receiving vector

a ReadonlyVec2

the first operand

b ReadonlyVec2

the second operand

t Number

interpolation amount, in the range [0-1], between the two inputs

Return:

vec2

out

public lerp(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3, t: Number): vec3 source

Performs a linear interpolation between two vec3's

Params:

NameTypeAttributeDescription
out vec3

the receiving vector

a ReadonlyVec3

the first operand

b ReadonlyVec3

the second operand

t Number

interpolation amount, in the range [0-1], between the two inputs

Return:

vec3

out

public lerp(out: vec4, a: ReadonlyVec4, b: ReadonlyVec4, t: Number): vec4 source

Performs a linear interpolation between two vec4's

Params:

NameTypeAttributeDescription
out vec4

the receiving vector

a ReadonlyVec4

the first operand

b ReadonlyVec4

the second operand

t Number

interpolation amount, in the range [0-1], between the two inputs

Return:

vec4

out

public ln(out: quat, a: ReadonlyQuat): quat source

Calculate the natural logarithm of a unit quaternion.

Params:

NameTypeAttributeDescription
out quat

the receiving quaternion

a ReadonlyQuat

quat to calculate the exponential of

Return:

quat

out

public lookAt(out: mat4, eye: ReadonlyVec3, center: ReadonlyVec3, up: ReadonlyVec3): mat4 source

import {lookAt} from 'bimsurfer3/viewer/glmatrix/mat4.js'

Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that actually makes an object look at another object, you should use targetTo instead.

Params:

NameTypeAttributeDescription
out mat4

mat4 frustum matrix will be written into

eye ReadonlyVec3

Position of the viewer

center ReadonlyVec3

Point the viewer is looking at

up ReadonlyVec3

vec3 pointing up

Return:

mat4

out

public max(out: vec2, a: ReadonlyVec2, b: ReadonlyVec2): vec2 source

Returns the maximum of two vec2's

Params:

NameTypeAttributeDescription
out vec2

the receiving vector

a ReadonlyVec2

the first operand

b ReadonlyVec2

the second operand

Return:

vec2

out

public max(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3): vec3 source

Returns the maximum of two vec3's

Params:

NameTypeAttributeDescription
out vec3

the receiving vector

a ReadonlyVec3

the first operand

b ReadonlyVec3

the second operand

Return:

vec3

out

public max(out: vec4, a: ReadonlyVec4, b: ReadonlyVec4): vec4 source

Returns the maximum of two vec4's

Params:

NameTypeAttributeDescription
out vec4

the receiving vector

a ReadonlyVec4

the first operand

b ReadonlyVec4

the second operand

Return:

vec4

out

public min(out: vec2, a: ReadonlyVec2, b: ReadonlyVec2): vec2 source

Returns the minimum of two vec2's

Params:

NameTypeAttributeDescription
out vec2

the receiving vector

a ReadonlyVec2

the first operand

b ReadonlyVec2

the second operand

Return:

vec2

out

public min(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3): vec3 source

Returns the minimum of two vec3's

Params:

NameTypeAttributeDescription
out vec3

the receiving vector

a ReadonlyVec3

the first operand

b ReadonlyVec3

the second operand

Return:

vec3

out

public min(out: vec4, a: ReadonlyVec4, b: ReadonlyVec4): vec4 source

Returns the minimum of two vec4's

Params:

NameTypeAttributeDescription
out vec4

the receiving vector

a ReadonlyVec4

the first operand

b ReadonlyVec4

the second operand

Return:

vec4

out

public multiply(out: mat2, a: ReadonlyMat2, b: ReadonlyMat2): mat2 source

import {multiply} from 'bimsurfer3/viewer/glmatrix/mat2.js'

Multiplies two mat2's

Params:

NameTypeAttributeDescription
out mat2

the receiving matrix

a ReadonlyMat2

the first operand

b ReadonlyMat2

the second operand

Return:

mat2

out

public multiply(out: mat2d, a: ReadonlyMat2d, b: ReadonlyMat2d): mat2d source

import {multiply} from 'bimsurfer3/viewer/glmatrix/mat2d.js'

Multiplies two mat2d's

Params:

NameTypeAttributeDescription
out mat2d

the receiving matrix

a ReadonlyMat2d

the first operand

b ReadonlyMat2d

the second operand

Return:

mat2d

out

public multiply(out: mat3, a: ReadonlyMat3, b: ReadonlyMat3): mat3 source

import {multiply} from 'bimsurfer3/viewer/glmatrix/mat3.js'

Multiplies two mat3's

Params:

NameTypeAttributeDescription
out mat3

the receiving matrix

a ReadonlyMat3

the first operand

b ReadonlyMat3

the second operand

Return:

mat3

out

public multiply(out: mat4, a: ReadonlyMat4, b: ReadonlyMat4): mat4 source

import {multiply} from 'bimsurfer3/viewer/glmatrix/mat4.js'

Multiplies two mat4s

Params:

NameTypeAttributeDescription
out mat4

the receiving matrix

a ReadonlyMat4

the first operand

b ReadonlyMat4

the second operand

Return:

mat4

out

public multiply(out: quat, a: ReadonlyQuat, b: ReadonlyQuat): quat source

import {multiply} from 'bimsurfer3/viewer/glmatrix/quat.js'

Multiplies two quat's

Params:

NameTypeAttributeDescription
out quat

the receiving quaternion

a ReadonlyQuat

the first operand

b ReadonlyQuat

the second operand

Return:

quat

out

public multiply(out: quat2, a: ReadonlyQuat2, b: ReadonlyQuat2): quat2 source

import {multiply} from 'bimsurfer3/viewer/glmatrix/quat2.js'

Multiplies two dual quat's

Params:

NameTypeAttributeDescription
out quat2

the receiving dual quaternion

a ReadonlyQuat2

the first operand

b ReadonlyQuat2

the second operand

Return:

quat2

out

public multiply(out: vec2, a: ReadonlyVec2, b: ReadonlyVec2): vec2 source

import {multiply} from 'bimsurfer3/viewer/glmatrix/vec2.js'

Multiplies two vec2's

Params:

NameTypeAttributeDescription
out vec2

the receiving vector

a ReadonlyVec2

the first operand

b ReadonlyVec2

the second operand

Return:

vec2

out

public multiply(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3): vec3 source

import {multiply} from 'bimsurfer3/viewer/glmatrix/vec3.js'

Multiplies two vec3's

Params:

NameTypeAttributeDescription
out vec3

the receiving vector

a ReadonlyVec3

the first operand

b ReadonlyVec3

the second operand

Return:

vec3

out

public multiply(out: vec4, a: ReadonlyVec4, b: ReadonlyVec4): vec4 source

import {multiply} from 'bimsurfer3/viewer/glmatrix/vec4.js'

Multiplies two vec4's

Params:

NameTypeAttributeDescription
out vec4

the receiving vector

a ReadonlyVec4

the first operand

b ReadonlyVec4

the second operand

Return:

vec4

out

public multiplyScalar(out: mat2, a: ReadonlyMat2, b: Number): mat2 source

import {multiplyScalar} from 'bimsurfer3/viewer/glmatrix/mat2.js'

Multiply each element of the matrix by a scalar.

Params:

NameTypeAttributeDescription
out mat2

the receiving matrix

a ReadonlyMat2

the matrix to scale

b Number

amount to scale the matrix's elements by

Return:

mat2

out

public multiplyScalar(out: mat2d, a: ReadonlyMat2d, b: Number): mat2d source

import {multiplyScalar} from 'bimsurfer3/viewer/glmatrix/mat2d.js'

Multiply each element of the matrix by a scalar.

Params:

NameTypeAttributeDescription
out mat2d

the receiving matrix

a ReadonlyMat2d

the matrix to scale

b Number

amount to scale the matrix's elements by

Return:

mat2d

out

public multiplyScalar(out: mat3, a: ReadonlyMat3, b: Number): mat3 source

import {multiplyScalar} from 'bimsurfer3/viewer/glmatrix/mat3.js'

Multiply each element of the matrix by a scalar.

Params:

NameTypeAttributeDescription
out mat3

the receiving matrix

a ReadonlyMat3

the matrix to scale

b Number

amount to scale the matrix's elements by

Return:

mat3

out

public multiplyScalar(out: mat4, a: ReadonlyMat4, b: Number): mat4 source

import {multiplyScalar} from 'bimsurfer3/viewer/glmatrix/mat4.js'

Multiply each element of the matrix by a scalar.

Params:

NameTypeAttributeDescription
out mat4

the receiving matrix

a ReadonlyMat4

the matrix to scale

b Number

amount to scale the matrix's elements by

Return:

mat4

out

public multiplyScalarAndAdd(out: mat2, a: ReadonlyMat2, b: ReadonlyMat2, scale: Number): mat2 source

import {multiplyScalarAndAdd} from 'bimsurfer3/viewer/glmatrix/mat2.js'

Adds two mat2's after multiplying each element of the second operand by a scalar value.

Params:

NameTypeAttributeDescription
out mat2

the receiving vector

a ReadonlyMat2

the first operand

b ReadonlyMat2

the second operand

scale Number

the amount to scale b's elements by before adding

Return:

mat2

out

public multiplyScalarAndAdd(out: mat2d, a: ReadonlyMat2d, b: ReadonlyMat2d, scale: Number): mat2d source

import {multiplyScalarAndAdd} from 'bimsurfer3/viewer/glmatrix/mat2d.js'

Adds two mat2d's after multiplying each element of the second operand by a scalar value.

Params:

NameTypeAttributeDescription
out mat2d

the receiving vector

a ReadonlyMat2d

the first operand

b ReadonlyMat2d

the second operand

scale Number

the amount to scale b's elements by before adding

Return:

mat2d

out

public multiplyScalarAndAdd(out: mat3, a: ReadonlyMat3, b: ReadonlyMat3, scale: Number): mat3 source

import {multiplyScalarAndAdd} from 'bimsurfer3/viewer/glmatrix/mat3.js'

Adds two mat3's after multiplying each element of the second operand by a scalar value.

Params:

NameTypeAttributeDescription
out mat3

the receiving vector

a ReadonlyMat3

the first operand

b ReadonlyMat3

the second operand

scale Number

the amount to scale b's elements by before adding

Return:

mat3

out

public multiplyScalarAndAdd(out: mat4, a: ReadonlyMat4, b: ReadonlyMat4, scale: Number): mat4 source

import {multiplyScalarAndAdd} from 'bimsurfer3/viewer/glmatrix/mat4.js'

Adds two mat4's after multiplying each element of the second operand by a scalar value.

Params:

NameTypeAttributeDescription
out mat4

the receiving vector

a ReadonlyMat4

the first operand

b ReadonlyMat4

the second operand

scale Number

the amount to scale b's elements by before adding

Return:

mat4

out

public negate(out: vec2, a: ReadonlyVec2): vec2 source

import {negate} from 'bimsurfer3/viewer/glmatrix/vec2.js'

Negates the components of a vec2

Params:

NameTypeAttributeDescription
out vec2

the receiving vector

a ReadonlyVec2

vector to negate

Return:

vec2

out

public negate(out: vec3, a: ReadonlyVec3): vec3 source

import {negate} from 'bimsurfer3/viewer/glmatrix/vec3.js'

Negates the components of a vec3

Params:

NameTypeAttributeDescription
out vec3

the receiving vector

a ReadonlyVec3

vector to negate

Return:

vec3

out

public negate(out: vec4, a: ReadonlyVec4): vec4 source

import {negate} from 'bimsurfer3/viewer/glmatrix/vec4.js'

Negates the components of a vec4

Params:

NameTypeAttributeDescription
out vec4

the receiving vector

a ReadonlyVec4

vector to negate

Return:

vec4

out

public normalFromMat4(out: mat3, a: ReadonlyMat4): mat3 source

import {normalFromMat4} from 'bimsurfer3/viewer/glmatrix/mat3.js'

Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix

Params:

NameTypeAttributeDescription
out mat3

mat3 receiving operation result

a ReadonlyMat4

Mat4 to derive the normal matrix from

Return:

mat3

out

public normalize(out: quat2, a: ReadonlyQuat2): quat2 source

import {normalize} from 'bimsurfer3/viewer/glmatrix/quat2.js'

Normalize a dual quat

Params:

NameTypeAttributeDescription
out quat2

the receiving dual quaternion

a ReadonlyQuat2

dual quaternion to normalize

Return:

quat2

out

public normalize(out: vec2, a: ReadonlyVec2): vec2 source

import {normalize} from 'bimsurfer3/viewer/glmatrix/vec2.js'

Normalize a vec2

Params:

NameTypeAttributeDescription
out vec2

the receiving vector

a ReadonlyVec2

vector to normalize

Return:

vec2

out

public normalize(out: vec3, a: ReadonlyVec3): vec3 source

import {normalize} from 'bimsurfer3/viewer/glmatrix/vec3.js'

Normalize a vec3

Params:

NameTypeAttributeDescription
out vec3

the receiving vector

a ReadonlyVec3

vector to normalize

Return:

vec3

out

public normalize(out: vec4, a: ReadonlyVec4): vec4 source

import {normalize} from 'bimsurfer3/viewer/glmatrix/vec4.js'

Normalize a vec4

Params:

NameTypeAttributeDescription
out vec4

the receiving vector

a ReadonlyVec4

vector to normalize

Return:

vec4

out

public ortho(out: mat4, left: number, right: number, bottom: number, top: number, near: number, far: number): mat4 source

Generates a orthogonal projection matrix with the given bounds

Params:

NameTypeAttributeDescription
out mat4

mat4 frustum matrix will be written into

left number

Left bound of the frustum

right number

Right bound of the frustum

bottom number

Bottom bound of the frustum

top number

Top bound of the frustum

near number

Near bound of the frustum

far number

Far bound of the frustum

Return:

mat4

out

public perspective(out: mat4, fovy: number, aspect: number, near: number, far: number): mat4 source

import {perspective} from 'bimsurfer3/viewer/glmatrix/mat4.js'

Generates a perspective projection matrix with the given bounds. Passing null/undefined/no value for far will generate infinite projection matrix.

Params:

NameTypeAttributeDescription
out mat4

mat4 frustum matrix will be written into

fovy number

Vertical field of view in radians

aspect number

Aspect ratio. typically viewport width/height

near number

Near bound of the frustum

far number

Far bound of the frustum, can be null or Infinity

Return:

mat4

out

public perspectiveFromFieldOfView(out: mat4, fov: Object, near: number, far: number): mat4 source

import {perspectiveFromFieldOfView} from 'bimsurfer3/viewer/glmatrix/mat4.js'

Generates a perspective projection matrix with the given field of view. This is primarily useful for generating projection matrices to be used with the still experiemental WebVR API.

Params:

NameTypeAttributeDescription
out mat4

mat4 frustum matrix will be written into

fov Object

Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees

near number

Near bound of the frustum

far number

Far bound of the frustum

Return:

mat4

out

public pow(out: quat, a: ReadonlyQuat, b: Number): quat source

Calculate the scalar power of a unit quaternion.

Params:

NameTypeAttributeDescription
out quat

the receiving quaternion

a ReadonlyQuat

quat to calculate the exponential of

b Number

amount to scale the quaternion by

Return:

quat

out

public projection(out: mat3, width: number, height: number): mat3 source

import {projection} from 'bimsurfer3/viewer/glmatrix/mat3.js'

Generates a 2D projection matrix with the given bounds

Params:

NameTypeAttributeDescription
out mat3

mat3 frustum matrix will be written into

width number

Width of your gl context

height number

Height of gl context

Return:

mat3

out

public random(out: quat): quat source

import {random} from 'bimsurfer3/viewer/glmatrix/quat.js'

Generates a random unit quaternion

Params:

NameTypeAttributeDescription
out quat

the receiving quaternion

Return:

quat

out

public random(out: vec2, scale: Number): vec2 source

import {random} from 'bimsurfer3/viewer/glmatrix/vec2.js'

Generates a random vector with the given scale

Params:

NameTypeAttributeDescription
out vec2

the receiving vector

scale Number
  • optional

Length of the resulting vector. If ommitted, a unit vector will be returned

Return:

vec2

out

public random(out: vec3, scale: Number): vec3 source

import {random} from 'bimsurfer3/viewer/glmatrix/vec3.js'

Generates a random vector with the given scale

Params:

NameTypeAttributeDescription
out vec3

the receiving vector

scale Number
  • optional

Length of the resulting vector. If ommitted, a unit vector will be returned

Return:

vec3

out

public random(out: vec4, scale: Number): vec4 source

import {random} from 'bimsurfer3/viewer/glmatrix/vec4.js'

Generates a random vector with the given scale

Params:

NameTypeAttributeDescription
out vec4

the receiving vector

scale Number
  • optional

Length of the resulting vector. If ommitted, a unit vector will be returned

Return:

vec4

out

public rotate(out: mat2, a: ReadonlyMat2, rad: Number): mat2 source

import {rotate} from 'bimsurfer3/viewer/glmatrix/mat2.js'

Rotates a mat2 by the given angle

Params:

NameTypeAttributeDescription
out mat2

the receiving matrix

a ReadonlyMat2

the matrix to rotate

rad Number

the angle to rotate the matrix by

Return:

mat2

out

public rotate(out: mat2d, a: ReadonlyMat2d, rad: Number): mat2d source

Rotates a mat2d by the given angle

Params:

NameTypeAttributeDescription
out mat2d

the receiving matrix

a ReadonlyMat2d

the matrix to rotate

rad Number

the angle to rotate the matrix by

Return:

mat2d

out

public rotate(out: mat3, a: ReadonlyMat3, rad: Number): mat3 source

import {rotate} from 'bimsurfer3/viewer/glmatrix/mat3.js'

Rotates a mat3 by the given angle

Params:

NameTypeAttributeDescription
out mat3

the receiving matrix

a ReadonlyMat3

the matrix to rotate

rad Number

the angle to rotate the matrix by

Return:

mat3

out

public rotate(out: mat4, a: ReadonlyMat4, rad: Number, axis: ReadonlyVec3): mat4 source

import {rotate} from 'bimsurfer3/viewer/glmatrix/mat4.js'

Rotates a mat4 by the given angle around the given axis

Params:

NameTypeAttributeDescription
out mat4

the receiving matrix

a ReadonlyMat4

the matrix to rotate

rad Number

the angle to rotate the matrix by

axis ReadonlyVec3

the axis to rotate around

Return:

mat4

out

public rotate(out: vec2, a: ReadonlyVec2, b: ReadonlyVec2, rad: Number): vec2 source

import {rotate} from 'bimsurfer3/viewer/glmatrix/vec2.js'

Rotate a 2D vector

Params:

NameTypeAttributeDescription
out vec2

The receiving vec2

a ReadonlyVec2

The vec2 point to rotate

b ReadonlyVec2

The origin of the rotation

rad Number

The angle of rotation in radians

Return:

vec2

out

public rotateAroundAxis(out: quat2, a: ReadonlyQuat2, axis: ReadonlyVec3, rad: Number): quat2 source

import {rotateAroundAxis} from 'bimsurfer3/viewer/glmatrix/quat2.js'

Rotates a dual quat around a given axis. Does the normalisation automatically

Params:

NameTypeAttributeDescription
out quat2

the receiving dual quaternion

a ReadonlyQuat2

the dual quaternion to rotate

axis ReadonlyVec3

the axis to rotate around

rad Number

how far the rotation should be

Return:

quat2

out

public rotateByQuatAppend(out: quat2, a: ReadonlyQuat2, q: ReadonlyQuat): quat2 source

import {rotateByQuatAppend} from 'bimsurfer3/viewer/glmatrix/quat2.js'

Rotates a dual quat by a given quaternion (a * q)

Params:

NameTypeAttributeDescription
out quat2

the receiving dual quaternion

a ReadonlyQuat2

the dual quaternion to rotate

q ReadonlyQuat

quaternion to rotate by

Return:

quat2

out

public rotateByQuatPrepend(out: quat2, q: ReadonlyQuat, a: ReadonlyQuat2): quat2 source

import {rotateByQuatPrepend} from 'bimsurfer3/viewer/glmatrix/quat2.js'

Rotates a dual quat by a given quaternion (q * a)

Params:

NameTypeAttributeDescription
out quat2

the receiving dual quaternion

q ReadonlyQuat

quaternion to rotate by

a ReadonlyQuat2

the dual quaternion to rotate

Return:

quat2

out

public rotateX(out: mat4, a: ReadonlyMat4, rad: Number): mat4 source

import {rotateX} from 'bimsurfer3/viewer/glmatrix/mat4.js'

Rotates a matrix by the given angle around the X axis

Params:

NameTypeAttributeDescription
out mat4

the receiving matrix

a ReadonlyMat4

the matrix to rotate

rad Number

the angle to rotate the matrix by

Return:

mat4

out

public rotateX(out: quat, a: ReadonlyQuat, rad: number): quat source

import {rotateX} from 'bimsurfer3/viewer/glmatrix/quat.js'

Rotates a quaternion by the given angle about the X axis

Params:

NameTypeAttributeDescription
out quat

quat receiving operation result

a ReadonlyQuat

quat to rotate

rad number

angle (in radians) to rotate

Return:

quat

out

public rotateX(out: quat2, a: ReadonlyQuat2, rad: number): quat2 source

import {rotateX} from 'bimsurfer3/viewer/glmatrix/quat2.js'

Rotates a dual quat around the X axis

Params:

NameTypeAttributeDescription
out quat2

the receiving dual quaternion

a ReadonlyQuat2

the dual quaternion to rotate

rad number

how far should the rotation be

Return:

quat2

out

public rotateX(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3, rad: Number): vec3 source

import {rotateX} from 'bimsurfer3/viewer/glmatrix/vec3.js'

Rotate a 3D vector around the x-axis

Params:

NameTypeAttributeDescription
out vec3

The receiving vec3

a ReadonlyVec3

The vec3 point to rotate

b ReadonlyVec3

The origin of the rotation

rad Number

The angle of rotation in radians

Return:

vec3

out

public rotateY(out: mat4, a: ReadonlyMat4, rad: Number): mat4 source

import {rotateY} from 'bimsurfer3/viewer/glmatrix/mat4.js'

Rotates a matrix by the given angle around the Y axis

Params:

NameTypeAttributeDescription
out mat4

the receiving matrix

a ReadonlyMat4

the matrix to rotate

rad Number

the angle to rotate the matrix by

Return:

mat4

out

public rotateY(out: quat, a: ReadonlyQuat, rad: number): quat source

import {rotateY} from 'bimsurfer3/viewer/glmatrix/quat.js'

Rotates a quaternion by the given angle about the Y axis

Params:

NameTypeAttributeDescription
out quat

quat receiving operation result

a ReadonlyQuat

quat to rotate

rad number

angle (in radians) to rotate

Return:

quat

out

public rotateY(out: quat2, a: ReadonlyQuat2, rad: number): quat2 source

import {rotateY} from 'bimsurfer3/viewer/glmatrix/quat2.js'

Rotates a dual quat around the Y axis

Params:

NameTypeAttributeDescription
out quat2

the receiving dual quaternion

a ReadonlyQuat2

the dual quaternion to rotate

rad number

how far should the rotation be

Return:

quat2

out

public rotateY(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3, rad: Number): vec3 source

import {rotateY} from 'bimsurfer3/viewer/glmatrix/vec3.js'

Rotate a 3D vector around the y-axis

Params:

NameTypeAttributeDescription
out vec3

The receiving vec3

a ReadonlyVec3

The vec3 point to rotate

b ReadonlyVec3

The origin of the rotation

rad Number

The angle of rotation in radians

Return:

vec3

out

public rotateZ(out: mat4, a: ReadonlyMat4, rad: Number): mat4 source

import {rotateZ} from 'bimsurfer3/viewer/glmatrix/mat4.js'

Rotates a matrix by the given angle around the Z axis

Params:

NameTypeAttributeDescription
out mat4

the receiving matrix

a ReadonlyMat4

the matrix to rotate

rad Number

the angle to rotate the matrix by

Return:

mat4

out

public rotateZ(out: quat, a: ReadonlyQuat, rad: number): quat source

import {rotateZ} from 'bimsurfer3/viewer/glmatrix/quat.js'

Rotates a quaternion by the given angle about the Z axis

Params:

NameTypeAttributeDescription
out quat

quat receiving operation result

a ReadonlyQuat

quat to rotate

rad number

angle (in radians) to rotate

Return:

quat

out

public rotateZ(out: quat2, a: ReadonlyQuat2, rad: number): quat2 source

import {rotateZ} from 'bimsurfer3/viewer/glmatrix/quat2.js'

Rotates a dual quat around the Z axis

Params:

NameTypeAttributeDescription
out quat2

the receiving dual quaternion

a ReadonlyQuat2

the dual quaternion to rotate

rad number

how far should the rotation be

Return:

quat2

out

public rotateZ(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3, rad: Number): vec3 source

import {rotateZ} from 'bimsurfer3/viewer/glmatrix/vec3.js'

Rotate a 3D vector around the z-axis

Params:

NameTypeAttributeDescription
out vec3

The receiving vec3

a ReadonlyVec3

The vec3 point to rotate

b ReadonlyVec3

The origin of the rotation

rad Number

The angle of rotation in radians

Return:

vec3

out

public round(out: vec2, a: ReadonlyVec2): vec2 source

Math.round the components of a vec2

Params:

NameTypeAttributeDescription
out vec2

the receiving vector

a ReadonlyVec2

vector to round

Return:

vec2

out

public round(out: vec3, a: ReadonlyVec3): vec3 source

Math.round the components of a vec3

Params:

NameTypeAttributeDescription
out vec3

the receiving vector

a ReadonlyVec3

vector to round

Return:

vec3

out

public round(out: vec4, a: ReadonlyVec4): vec4 source

Math.round the components of a vec4

Params:

NameTypeAttributeDescription
out vec4

the receiving vector

a ReadonlyVec4

vector to round

Return:

vec4

out

public scale(out: mat2, a: ReadonlyMat2, v: ReadonlyVec2): mat2 source

Scales the mat2 by the dimensions in the given vec2

Params:

NameTypeAttributeDescription
out mat2

the receiving matrix

a ReadonlyMat2

the matrix to rotate

v ReadonlyVec2

the vec2 to scale the matrix by

Return:

mat2

out

public scale(out: mat2d, a: ReadonlyMat2d, v: ReadonlyVec2): mat2d source

Scales the mat2d by the dimensions in the given vec2

Params:

NameTypeAttributeDescription
out mat2d

the receiving matrix

a ReadonlyMat2d

the matrix to translate

v ReadonlyVec2

the vec2 to scale the matrix by

Return:

mat2d

out

public scale(out: mat3, a: ReadonlyMat3, v: ReadonlyVec2): mat3 source

Scales the mat3 by the dimensions in the given vec2

Params:

NameTypeAttributeDescription
out mat3

the receiving matrix

a ReadonlyMat3

the matrix to rotate

v ReadonlyVec2

the vec2 to scale the matrix by

Return:

mat3

out

public scale(out: mat4, a: ReadonlyMat4, v: ReadonlyVec3): mat4 source

Scales the mat4 by the dimensions in the given vec3 not using vectorization

Params:

NameTypeAttributeDescription
out mat4

the receiving matrix

a ReadonlyMat4

the matrix to scale

v ReadonlyVec3

the vec3 to scale the matrix by

Return:

mat4

out

public scale(out: quat2, a: ReadonlyQuat2, b: Number): quat2 source

Scales a dual quat by a scalar number

Params:

NameTypeAttributeDescription
out quat2

the receiving dual quat

a ReadonlyQuat2

the dual quat to scale

b Number

amount to scale the dual quat by

Return:

quat2

out

public scale(out: vec2, a: ReadonlyVec2, b: Number): vec2 source

Scales a vec2 by a scalar number

Params:

NameTypeAttributeDescription
out vec2

the receiving vector

a ReadonlyVec2

the vector to scale

b Number

amount to scale the vector by

Return:

vec2

out

public scale(out: vec3, a: ReadonlyVec3, b: Number): vec3 source

Scales a vec3 by a scalar number

Params:

NameTypeAttributeDescription
out vec3

the receiving vector

a ReadonlyVec3

the vector to scale

b Number

amount to scale the vector by

Return:

vec3

out

public scale(out: vec4, a: ReadonlyVec4, b: Number): vec4 source

Scales a vec4 by a scalar number

Params:

NameTypeAttributeDescription
out vec4

the receiving vector

a ReadonlyVec4

the vector to scale

b Number

amount to scale the vector by

Return:

vec4

out

public scaleAndAdd(out: vec2, a: ReadonlyVec2, b: ReadonlyVec2, scale: Number): vec2 source

import {scaleAndAdd} from 'bimsurfer3/viewer/glmatrix/vec2.js'

Adds two vec2's after scaling the second operand by a scalar value

Params:

NameTypeAttributeDescription
out vec2

the receiving vector

a ReadonlyVec2

the first operand

b ReadonlyVec2

the second operand

scale Number

the amount to scale b by before adding

Return:

vec2

out

public scaleAndAdd(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3, scale: Number): vec3 source

import {scaleAndAdd} from 'bimsurfer3/viewer/glmatrix/vec3.js'

Adds two vec3's after scaling the second operand by a scalar value

Params:

NameTypeAttributeDescription
out vec3

the receiving vector

a ReadonlyVec3

the first operand

b ReadonlyVec3

the second operand

scale Number

the amount to scale b by before adding

Return:

vec3

out

public scaleAndAdd(out: vec4, a: ReadonlyVec4, b: ReadonlyVec4, scale: Number): vec4 source

import {scaleAndAdd} from 'bimsurfer3/viewer/glmatrix/vec4.js'

Adds two vec4's after scaling the second operand by a scalar value

Params:

NameTypeAttributeDescription
out vec4

the receiving vector

a ReadonlyVec4

the first operand

b ReadonlyVec4

the second operand

scale Number

the amount to scale b by before adding

Return:

vec4

out

public set(out: mat2, m00: Number, m01: Number, m10: Number, m11: Number): mat2 source

Set the components of a mat2 to the given values

Params:

NameTypeAttributeDescription
out mat2

the receiving matrix

m00 Number

Component in column 0, row 0 position (index 0)

m01 Number

Component in column 0, row 1 position (index 1)

m10 Number

Component in column 1, row 0 position (index 2)

m11 Number

Component in column 1, row 1 position (index 3)

Return:

mat2

out

public set(out: mat2d, a: Number, b: Number, c: Number, d: Number, tx: Number, ty: Number): mat2d source

Set the components of a mat2d to the given values

Params:

NameTypeAttributeDescription
out mat2d

the receiving matrix

a Number

Component A (index 0)

b Number

Component B (index 1)

c Number

Component C (index 2)

d Number

Component D (index 3)

tx Number

Component TX (index 4)

ty Number

Component TY (index 5)

Return:

mat2d

out

public set(out: mat3, m00: Number, m01: Number, m02: Number, m10: Number, m11: Number, m12: Number, m20: Number, m21: Number, m22: Number): mat3 source

Set the components of a mat3 to the given values

Params:

NameTypeAttributeDescription
out mat3

the receiving matrix

m00 Number

Component in column 0, row 0 position (index 0)

m01 Number

Component in column 0, row 1 position (index 1)

m02 Number

Component in column 0, row 2 position (index 2)

m10 Number

Component in column 1, row 0 position (index 3)

m11 Number

Component in column 1, row 1 position (index 4)

m12 Number

Component in column 1, row 2 position (index 5)

m20 Number

Component in column 2, row 0 position (index 6)

m21 Number

Component in column 2, row 1 position (index 7)

m22 Number

Component in column 2, row 2 position (index 8)

Return:

mat3

out

public set(out: mat4, m00: Number, m01: Number, m02: Number, m03: Number, m10: Number, m11: Number, m12: Number, m13: Number, m20: Number, m21: Number, m22: Number, m23: Number, m30: Number, m31: Number, m32: Number, m33: Number): mat4 source

Set the components of a mat4 to the given values

Params:

NameTypeAttributeDescription
out mat4

the receiving matrix

m00 Number

Component in column 0, row 0 position (index 0)

m01 Number

Component in column 0, row 1 position (index 1)

m02 Number

Component in column 0, row 2 position (index 2)

m03 Number

Component in column 0, row 3 position (index 3)

m10 Number

Component in column 1, row 0 position (index 4)

m11 Number

Component in column 1, row 1 position (index 5)

m12 Number

Component in column 1, row 2 position (index 6)

m13 Number

Component in column 1, row 3 position (index 7)

m20 Number

Component in column 2, row 0 position (index 8)

m21 Number

Component in column 2, row 1 position (index 9)

m22 Number

Component in column 2, row 2 position (index 10)

m23 Number

Component in column 2, row 3 position (index 11)

m30 Number

Component in column 3, row 0 position (index 12)

m31 Number

Component in column 3, row 1 position (index 13)

m32 Number

Component in column 3, row 2 position (index 14)

m33 Number

Component in column 3, row 3 position (index 15)

Return:

mat4

out

public set(out: quat2, x1: Number, y1: Number, z1: Number, w1: Number, x2: Number, y2: Number, z2: Number, w2: Number): quat2 source

Set the components of a dual quat to the given values

Params:

NameTypeAttributeDescription
out quat2

the receiving quaternion

x1 Number

X component

y1 Number

Y component

z1 Number

Z component

w1 Number

W component

x2 Number

X component

y2 Number

Y component

z2 Number

Z component

w2 Number

W component

Return:

quat2

out

public set(out: vec2, x: Number, y: Number): vec2 source

Set the components of a vec2 to the given values

Params:

NameTypeAttributeDescription
out vec2

the receiving vector

x Number

X component

y Number

Y component

Return:

vec2

out

public set(out: vec3, x: Number, y: Number, z: Number): vec3 source

Set the components of a vec3 to the given values

Params:

NameTypeAttributeDescription
out vec3

the receiving vector

x Number

X component

y Number

Y component

z Number

Z component

Return:

vec3

out

public set(out: vec4, x: Number, y: Number, z: Number, w: Number): vec4 source

Set the components of a vec4 to the given values

Params:

NameTypeAttributeDescription
out vec4

the receiving vector

x Number

X component

y Number

Y component

z Number

Z component

w Number

W component

Return:

vec4

out

public setAxisAngle(out: quat, axis: ReadonlyVec3, rad: Number): quat source

import {setAxisAngle} from 'bimsurfer3/viewer/glmatrix/quat.js'

Sets a quat from the given angle and rotation axis, then returns it.

Params:

NameTypeAttributeDescription
out quat

the receiving quaternion

axis ReadonlyVec3

the axis around which to rotate

rad Number

the angle in radians

Return:

quat

out

public setDual(out: quat2, q: ReadonlyQuat): quat2 source

import {setDual} from 'bimsurfer3/viewer/glmatrix/quat2.js'

Set the dual component of a dual quat to the given quaternion

Params:

NameTypeAttributeDescription
out quat2

the receiving quaternion

q ReadonlyQuat

a quaternion representing the dual part

Return:

quat2

out

public setMatrixArrayType(type: Float32ArrayConstructor | ArrayConstructor) source

import {setMatrixArrayType} from 'bimsurfer3/viewer/glmatrix/common.js'

Sets the type of array used when creating new vectors and matrices

Params:

NameTypeAttributeDescription
type Float32ArrayConstructor | ArrayConstructor

Array type, such as Float32Array or Array

public slerp(out: quat, a: ReadonlyQuat, b: ReadonlyQuat, t: Number): quat source

Performs a spherical linear interpolation between two quat

Params:

NameTypeAttributeDescription
out quat

the receiving quaternion

a ReadonlyQuat

the first operand

b ReadonlyQuat

the second operand

t Number

interpolation amount, in the range [0-1], between the two inputs

Return:

quat

out

public squaredDistance(a: ReadonlyVec2, b: ReadonlyVec2): Number source

import {squaredDistance} from 'bimsurfer3/viewer/glmatrix/vec2.js'

Calculates the squared euclidian distance between two vec2's

Params:

NameTypeAttributeDescription
a ReadonlyVec2

the first operand

b ReadonlyVec2

the second operand

Return:

Number

squared distance between a and b

public squaredDistance(a: ReadonlyVec3, b: ReadonlyVec3): Number source

import {squaredDistance} from 'bimsurfer3/viewer/glmatrix/vec3.js'

Calculates the squared euclidian distance between two vec3's

Params:

NameTypeAttributeDescription
a ReadonlyVec3

the first operand

b ReadonlyVec3

the second operand

Return:

Number

squared distance between a and b

public squaredDistance(a: ReadonlyVec4, b: ReadonlyVec4): Number source

import {squaredDistance} from 'bimsurfer3/viewer/glmatrix/vec4.js'

Calculates the squared euclidian distance between two vec4's

Params:

NameTypeAttributeDescription
a ReadonlyVec4

the first operand

b ReadonlyVec4

the second operand

Return:

Number

squared distance between a and b

public squaredLength(a: ReadonlyVec2): Number source

import {squaredLength} from 'bimsurfer3/viewer/glmatrix/vec2.js'

Calculates the squared length of a vec2

Params:

NameTypeAttributeDescription
a ReadonlyVec2

vector to calculate squared length of

Return:

Number

squared length of a

public squaredLength(a: ReadonlyVec3): Number source

import {squaredLength} from 'bimsurfer3/viewer/glmatrix/vec3.js'

Calculates the squared length of a vec3

Params:

NameTypeAttributeDescription
a ReadonlyVec3

vector to calculate squared length of

Return:

Number

squared length of a

public squaredLength(a: ReadonlyVec4): Number source

import {squaredLength} from 'bimsurfer3/viewer/glmatrix/vec4.js'

Calculates the squared length of a vec4

Params:

NameTypeAttributeDescription
a ReadonlyVec4

vector to calculate squared length of

Return:

Number

squared length of a

public str(a: ReadonlyMat2): String source

Returns a string representation of a mat2

Params:

NameTypeAttributeDescription
a ReadonlyMat2

matrix to represent as a string

Return:

String

string representation of the matrix

public str(a: ReadonlyMat2d): String source

Returns a string representation of a mat2d

Params:

NameTypeAttributeDescription
a ReadonlyMat2d

matrix to represent as a string

Return:

String

string representation of the matrix

public str(a: ReadonlyMat3): String source

Returns a string representation of a mat3

Params:

NameTypeAttributeDescription
a ReadonlyMat3

matrix to represent as a string

Return:

String

string representation of the matrix

public str(a: ReadonlyMat4): String source

Returns a string representation of a mat4

Params:

NameTypeAttributeDescription
a ReadonlyMat4

matrix to represent as a string

Return:

String

string representation of the matrix

public str(a: ReadonlyQuat): String source

Returns a string representation of a quatenion

Params:

NameTypeAttributeDescription
a ReadonlyQuat

vector to represent as a string

Return:

String

string representation of the vector

public str(a: ReadonlyQuat2): String source

Returns a string representation of a dual quatenion

Params:

NameTypeAttributeDescription
a ReadonlyQuat2

dual quaternion to represent as a string

Return:

String

string representation of the dual quat

public str(a: ReadonlyVec2): String source

Returns a string representation of a vector

Params:

NameTypeAttributeDescription
a ReadonlyVec2

vector to represent as a string

Return:

String

string representation of the vector

public str(a: ReadonlyVec3): String source

Returns a string representation of a vector

Params:

NameTypeAttributeDescription
a ReadonlyVec3

vector to represent as a string

Return:

String

string representation of the vector

public str(a: ReadonlyVec4): String source

Returns a string representation of a vector

Params:

NameTypeAttributeDescription
a ReadonlyVec4

vector to represent as a string

Return:

String

string representation of the vector

public subtract(out: mat2, a: ReadonlyMat2, b: ReadonlyMat2): mat2 source

import {subtract} from 'bimsurfer3/viewer/glmatrix/mat2.js'

Subtracts matrix b from matrix a

Params:

NameTypeAttributeDescription
out mat2

the receiving matrix

a ReadonlyMat2

the first operand

b ReadonlyMat2

the second operand

Return:

mat2

out

public subtract(out: mat2d, a: ReadonlyMat2d, b: ReadonlyMat2d): mat2d source

import {subtract} from 'bimsurfer3/viewer/glmatrix/mat2d.js'

Subtracts matrix b from matrix a

Params:

NameTypeAttributeDescription
out mat2d

the receiving matrix

a ReadonlyMat2d

the first operand

b ReadonlyMat2d

the second operand

Return:

mat2d

out

public subtract(out: mat3, a: ReadonlyMat3, b: ReadonlyMat3): mat3 source

import {subtract} from 'bimsurfer3/viewer/glmatrix/mat3.js'

Subtracts matrix b from matrix a

Params:

NameTypeAttributeDescription
out mat3

the receiving matrix

a ReadonlyMat3

the first operand

b ReadonlyMat3

the second operand

Return:

mat3

out

public subtract(out: mat4, a: ReadonlyMat4, b: ReadonlyMat4): mat4 source

import {subtract} from 'bimsurfer3/viewer/glmatrix/mat4.js'

Subtracts matrix b from matrix a

Params:

NameTypeAttributeDescription
out mat4

the receiving matrix

a ReadonlyMat4

the first operand

b ReadonlyMat4

the second operand

Return:

mat4

out

public subtract(out: vec2, a: ReadonlyVec2, b: ReadonlyVec2): vec2 source

import {subtract} from 'bimsurfer3/viewer/glmatrix/vec2.js'

Subtracts vector b from vector a

Params:

NameTypeAttributeDescription
out vec2

the receiving vector

a ReadonlyVec2

the first operand

b ReadonlyVec2

the second operand

Return:

vec2

out

public subtract(out: vec3, a: ReadonlyVec3, b: ReadonlyVec3): vec3 source

import {subtract} from 'bimsurfer3/viewer/glmatrix/vec3.js'

Subtracts vector b from vector a

Params:

NameTypeAttributeDescription
out vec3

the receiving vector

a ReadonlyVec3

the first operand

b ReadonlyVec3

the second operand

Return:

vec3

out

public subtract(out: vec4, a: ReadonlyVec4, b: ReadonlyVec4): vec4 source

import {subtract} from 'bimsurfer3/viewer/glmatrix/vec4.js'

Subtracts vector b from vector a

Params:

NameTypeAttributeDescription
out vec4

the receiving vector

a ReadonlyVec4

the first operand

b ReadonlyVec4

the second operand

Return:

vec4

out

public targetTo(out: mat4, eye: ReadonlyVec3, center: ReadonlyVec3, up: ReadonlyVec3): mat4 source

import {targetTo} from 'bimsurfer3/viewer/glmatrix/mat4.js'

Generates a matrix that makes something look at something else.

Params:

NameTypeAttributeDescription
out mat4

mat4 frustum matrix will be written into

eye ReadonlyVec3

Position of the viewer

center ReadonlyVec3

Point the viewer is looking at

up ReadonlyVec3

vec3 pointing up

Return:

mat4

out

public toRadian(a: Number): * source

import {toRadian} from 'bimsurfer3/viewer/glmatrix/common.js'

Convert Degree To Radian

Params:

NameTypeAttributeDescription
a Number

Angle in Degrees

Return:

*

public transformMat2(out: vec2, a: ReadonlyVec2, m: ReadonlyMat2): vec2 source

import {transformMat2} from 'bimsurfer3/viewer/glmatrix/vec2.js'

Transforms the vec2 with a mat2

Params:

NameTypeAttributeDescription
out vec2

the receiving vector

a ReadonlyVec2

the vector to transform

m ReadonlyMat2

matrix to transform with

Return:

vec2

out

public transformMat2d(out: vec2, a: ReadonlyVec2, m: ReadonlyMat2d): vec2 source

import {transformMat2d} from 'bimsurfer3/viewer/glmatrix/vec2.js'

Transforms the vec2 with a mat2d

Params:

NameTypeAttributeDescription
out vec2

the receiving vector

a ReadonlyVec2

the vector to transform

m ReadonlyMat2d

matrix to transform with

Return:

vec2

out

public transformMat3(out: vec2, a: ReadonlyVec2, m: ReadonlyMat3): vec2 source

import {transformMat3} from 'bimsurfer3/viewer/glmatrix/vec2.js'

Transforms the vec2 with a mat3 3rd vector component is implicitly '1'

Params:

NameTypeAttributeDescription
out vec2

the receiving vector

a ReadonlyVec2

the vector to transform

m ReadonlyMat3

matrix to transform with

Return:

vec2

out

public transformMat3(out: vec3, a: ReadonlyVec3, m: ReadonlyMat3): vec3 source

import {transformMat3} from 'bimsurfer3/viewer/glmatrix/vec3.js'

Transforms the vec3 with a mat3.

Params:

NameTypeAttributeDescription
out vec3

the receiving vector

a ReadonlyVec3

the vector to transform

m ReadonlyMat3

the 3x3 matrix to transform with

Return:

vec3

out

public transformMat4(out: vec2, a: ReadonlyVec2, m: ReadonlyMat4): vec2 source

import {transformMat4} from 'bimsurfer3/viewer/glmatrix/vec2.js'

Transforms the vec2 with a mat4 3rd vector component is implicitly '0' 4th vector component is implicitly '1'

Params:

NameTypeAttributeDescription
out vec2

the receiving vector

a ReadonlyVec2

the vector to transform

m ReadonlyMat4

matrix to transform with

Return:

vec2

out

public transformMat4(out: vec3, a: ReadonlyVec3, m: ReadonlyMat4): vec3 source

import {transformMat4} from 'bimsurfer3/viewer/glmatrix/vec3.js'

Transforms the vec3 with a mat4. 4th vector component is implicitly '1'

Params:

NameTypeAttributeDescription
out vec3

the receiving vector

a ReadonlyVec3

the vector to transform

m ReadonlyMat4

matrix to transform with

Return:

vec3

out

public transformMat4(out: vec4, a: ReadonlyVec4, m: ReadonlyMat4): vec4 source

import {transformMat4} from 'bimsurfer3/viewer/glmatrix/vec4.js'

Transforms the vec4 with a mat4.

Params:

NameTypeAttributeDescription
out vec4

the receiving vector

a ReadonlyVec4

the vector to transform

m ReadonlyMat4

matrix to transform with

Return:

vec4

out

public transformQuat(out: vec3, a: ReadonlyVec3, q: ReadonlyQuat): vec3 source

import {transformQuat} from 'bimsurfer3/viewer/glmatrix/vec3.js'

Transforms the vec3 with a quat Can also be used for dual quaternions. (Multiply it with the real part)

Params:

NameTypeAttributeDescription
out vec3

the receiving vector

a ReadonlyVec3

the vector to transform

q ReadonlyQuat

quaternion to transform with

Return:

vec3

out

public transformQuat(out: vec4, a: ReadonlyVec4, q: ReadonlyQuat): vec4 source

import {transformQuat} from 'bimsurfer3/viewer/glmatrix/vec4.js'

Transforms the vec4 with a quat

Params:

NameTypeAttributeDescription
out vec4

the receiving vector

a ReadonlyVec4

the vector to transform

q ReadonlyQuat

quaternion to transform with

Return:

vec4

out

public translate(out: mat2d, a: ReadonlyMat2d, v: ReadonlyVec2): mat2d source

import {translate} from 'bimsurfer3/viewer/glmatrix/mat2d.js'

Translates the mat2d by the dimensions in the given vec2

Params:

NameTypeAttributeDescription
out mat2d

the receiving matrix

a ReadonlyMat2d

the matrix to translate

v ReadonlyVec2

the vec2 to translate the matrix by

Return:

mat2d

out

public translate(out: mat3, a: ReadonlyMat3, v: ReadonlyVec2): mat3 source

import {translate} from 'bimsurfer3/viewer/glmatrix/mat3.js'

Translate a mat3 by the given vector

Params:

NameTypeAttributeDescription
out mat3

the receiving matrix

a ReadonlyMat3

the matrix to translate

v ReadonlyVec2

vector to translate by

Return:

mat3

out

public translate(out: mat4, a: ReadonlyMat4, v: ReadonlyVec3): mat4 source

import {translate} from 'bimsurfer3/viewer/glmatrix/mat4.js'

Translate a mat4 by the given vector

Params:

NameTypeAttributeDescription
out mat4

the receiving matrix

a ReadonlyMat4

the matrix to translate

v ReadonlyVec3

vector to translate by

Return:

mat4

out

public translate(out: quat2, a: ReadonlyQuat2, v: ReadonlyVec3): quat2 source

import {translate} from 'bimsurfer3/viewer/glmatrix/quat2.js'

Translates a dual quat by the given vector

Params:

NameTypeAttributeDescription
out quat2

the receiving dual quaternion

a ReadonlyQuat2

the dual quaternion to translate

v ReadonlyVec3

vector to translate by

Return:

quat2

out

public transpose(out: mat2, a: ReadonlyMat2): mat2 source

import {transpose} from 'bimsurfer3/viewer/glmatrix/mat2.js'

Transpose the values of a mat2

Params:

NameTypeAttributeDescription
out mat2

the receiving matrix

a ReadonlyMat2

the source matrix

Return:

mat2

out

public transpose(out: mat3, a: ReadonlyMat3): mat3 source

import {transpose} from 'bimsurfer3/viewer/glmatrix/mat3.js'

Transpose the values of a mat3

Params:

NameTypeAttributeDescription
out mat3

the receiving matrix

a ReadonlyMat3

the source matrix

Return:

mat3

out

public transpose(out: mat4, a: ReadonlyMat4): mat4 source

import {transpose} from 'bimsurfer3/viewer/glmatrix/mat4.js'

Transpose the values of a mat4

Params:

NameTypeAttributeDescription
out mat4

the receiving matrix

a ReadonlyMat4

the source matrix

Return:

mat4

out

public zero(out: vec2): vec2 source

Set the components of a vec2 to zero

Params:

NameTypeAttributeDescription
out vec2

the receiving vector

Return:

vec2

out

public zero(out: vec3): vec3 source

Set the components of a vec3 to zero

Params:

NameTypeAttributeDescription
out vec3

the receiving vector

Return:

vec3

out

public zero(out: vec4): vec4 source

Set the components of a vec4 to zero

Params:

NameTypeAttributeDescription
out vec4

the receiving vector

Return:

vec4

out