Members
Methods
create() → {Float32Array}
Creates a new identity 4x4 Matrix
- Source:
Returns:
a new 4x4 matrix
- Type
- Float32Array
fromQuat(outnon-null, qnon-null)
Calculates a 4x4 matrix from the given quaternion
Parameters:
Name | Type | Description |
---|---|---|
out |
Float32Array | 4x4 matrix receiving operation result |
q |
Float32Array | Quaternion to create matrix from |
- Source:
frustum(outnon-null, left, right, bottom, top, near, far)
Generates a frustum matrix with the given bounds
Parameters:
Name | Type | Description |
---|---|---|
out |
Float32Array | 4x4 matrix 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 |
- Source:
getRotation(outnon-null, matnon-null)
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.
Parameters:
Name | Type | Description |
---|---|---|
out |
Float32Array | Quaternion to receive the rotation component |
mat |
Float32Array | Matrix to be decomposed (input) |
- Source:
getScaling_(outnon-null, matnon-null)
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.
Parameters:
Name | Type | Description |
---|---|---|
out |
Float32Array | Vector to receive scaling factor component |
mat |
Float32Array | Matrix to be decomposed (input) |
- Source:
identity_(outnon-null)
Set a 4x4 matrix to the identity matrix
Parameters:
Name | Type | Description |
---|---|---|
out |
Float32Array | the receiving matrix |
- Source:
lookAt(outnon-null, eyenon-null, centernon-null, upnon-null)
Generates a look-at matrix with the given eye position, focal point, and
up axis.
Parameters:
Name | Type | Description |
---|---|---|
out |
Float32Array | 4x4 matrix frustum matrix will be written into |
eye |
Array.<number> | Position of the viewer |
center |
Array.<number> | Point the viewer is looking at |
up |
Array.<number> | Vector pointing up |
- Source:
multiply(outnon-null, anon-null, bnon-null)
Multiplies two 4x4 matrix
Parameters:
Name | Type | Description |
---|---|---|
out |
Float32Array | the receiving matrix |
a |
Float32Array | the first operand |
b |
Float32Array | the second operand |
- Source:
perspective(outnon-null, fovy, aspect, near, far)
Generates a perspective projection matrix with the given bounds.
The near/far clip planes correspond to a normalized device coordinate Z
range of [-1, 1], which matches WebGL's clip volume.
Passing null/undefined/no value for far will generate infinite projection
matrix.
Parameters:
Name | Type | Description |
---|---|---|
out |
Float32Array | 4x4 matrix 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 |
- Source:
rotateX(outnon-null, anon-null, rad)
Rotates a matrix by the given angle around the X axis
Parameters:
Name | Type | Description |
---|---|---|
out |
Float32Array | the receiving matrix |
a |
Float32Array | the matrix to rotate |
rad |
number | the angle to rotate the matrix by |
- Source:
rotateY(outnon-null, anon-null, rad)
Rotates a matrix by the given angle around the Y axis
Parameters:
Name | Type | Description |
---|---|---|
out |
Float32Array | the receiving matrix |
a |
Float32Array | the matrix to rotate |
rad |
number | the angle to rotate the matrix by |
- Source:
rotateZ(outnon-null, anon-null, rad)
Rotates a matrix by the given angle around the Z axis
Parameters:
Name | Type | Description |
---|---|---|
out |
Float32Array | the receiving matrix |
a |
Float32Array | the matrix to rotate |
rad |
number | the angle to rotate the matrix by |
- Source:
scale(outnon-null, anon-null, vnon-null)
Scales the 4x4 matrix by the dimensions in the given vector not using
vectorization
Parameters:
Name | Type | Description |
---|---|---|
out |
Float32Array | the receiving matrix |
a |
Float32Array | the matrix to scale |
v |
Array.<number> | the vector to scale the matrix by |
- Source: