-
new Matrix4Notifier()
-
4x4 矩阵,具有 onUpdate 回调
Extends
Members Show Inherited
| Name | Type | Default | Description |
|---|---|---|---|
className
|
String | Matrix4Notifier |
类名 |
isMatrix4Notifier
|
Boolean | true | |
elements
|
Float32Array |
数据 |
|
isMatrix4
|
Boolean | true | inherited |
Methods Show Inherited
-
onUpdate()
-
更新的回调
-
copy(m){Matrix4Notifier}
-
Copy the values from one mat4 to this
Name Type Description mMatrix4 the source matrix
Returns:
Type Description Matrix4Notifier this -
fromArray(array, offset){Matrix4Notifier}
-
从数组赋值
Name Type Default Description arrayArray.<number> | TypedArray 数组
offsetNumber 0 optional 数组偏移值
Returns:
Type Description Matrix4Notifier this -
set(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33){Matrix4Notifier}
-
Set the components of a mat3 to the given values
Name Type Description m00Number m01Number m02Number m03Number m10Number m11Number m12Number m13Number m20Number m21Number m22Number m23Number m30Number m31Number m32Number m33Number Returns:
Type Description Matrix4Notifier this -
identity(){Matrix4Notifier}
-
Set this to the identity matrix
Returns:
Type Description Matrix4Notifier this -
transpose(){Matrix4Notifier}
-
Transpose the values of this
Returns:
Type Description Matrix4Notifier this -
invert(m){Matrix4Notifier}
-
invert a matrix
Name Type Default Description mMatrix4 this optional Returns:
Type Description Matrix4Notifier this -
adjoint(m){Matrix4Notifier}
-
Calculates the adjugate of a mat4
Name Type Default Description mMatrix4 this optional Returns:
Type Description Matrix4Notifier this -
determinant(){Matrix4Notifier}
-
Calculates the determinant of this
Returns:
Type Description Matrix4Notifier this -
multiply(a, b){Matrix4Notifier}
-
Multiplies two matrix4's
Name Type Description aMatrix4 bMatrix4 optional 如果不传,计算 this 和 a 的乘积
Returns:
Type Description Matrix4Notifier this -
premultiply(m){Matrix4Notifier}
-
左乘
Name Type Description mMatrix4 Returns:
Type Description Matrix4Notifier this -
translate(v){Matrix4Notifier}
-
Translate this by the given vector
Name Type Description vVector3 vector to translate by
Returns:
Type Description Matrix4Notifier this -
scale(v){Matrix4Notifier}
-
Scales the mat3 by the dimensions in the given vec2
Name Type Description vVector3 the vec3 to scale the matrix by
Returns:
Type Description Matrix4Notifier this -
rotate(rad, axis){Matrix4Notifier}
-
Rotates this by the given angle
Name Type Description radNumber the angle to rotate the matrix by
axisVector3 the axis to rotate around
Returns:
Type Description Matrix4Notifier this -
rotateX(rad){Matrix4Notifier}
-
Rotates this by the given angle around the X axis
Name Type Description radNumber the angle to rotate the matrix by
Returns:
Type Description Matrix4Notifier this -
rotateY(rad){Matrix4Notifier}
-
Rotates this by the given angle around the Y axis
Name Type Description radNumber the angle to rotate the matrix by
Returns:
Type Description Matrix4Notifier this -
rotateZ(rad){Matrix4Notifier}
-
Rotates this by the given angle around the Z axis
Name Type Description radNumber the angle to rotate the matrix by
Returns:
Type Description Matrix4Notifier this -
fromTranslation(transition){Matrix4Notifier}
-
Creates a matrix from a vector translation
Name Type Description transitionVector3 Translation vector
Returns:
Type Description Matrix4Notifier this -
fromScaling(v){Matrix4Notifier}
-
Creates a matrix from a vector scaling
Name Type Description vVector3 Scaling vector
Returns:
Type Description Matrix4Notifier this -
fromRotation(rad, axis){Matrix4Notifier}
-
Creates a matrix from a given angle around a given axis
Name Type Description radNumber the angle to rotate the matrix by
axisVector3 the axis to rotate around
Returns:
Type Description Matrix4Notifier this -
fromXRotation(rad){Matrix4Notifier}
-
Creates a matrix from the given angle around the X axis
Name Type Description radNumber the angle to rotate the matrix by
Returns:
Type Description Matrix4Notifier this -
fromYRotation(rad){Matrix4Notifier}
-
Creates a matrix from the given angle around the Y axis
Name Type Description radNumber the angle to rotate the matrix by
Returns:
Type Description Matrix4Notifier this -
fromZRotation(rad){Matrix4Notifier}
-
Creates a matrix from the given angle around the Z axis
Name Type Description radNumber the angle to rotate the matrix by
Returns:
Type Description Matrix4Notifier this -
fromRotationTranslation(q, v){Matrix4Notifier}
-
Creates a matrix from a quaternion rotation and vector translation
Name Type Description qQuaternion Rotation quaternion
vVector3 Translation vector
Returns:
Type Description Matrix4Notifier this -
getTranslation(out){Vector3}
-
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.
Name Type Default Description outVector3 new Vector3 optional Vector to receive translation component
Returns:
Type Description Vector3 out -
getScaling(out){Vector3}
-
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.
Name Type Default Description outVector3 new Vector3 optional Vector to receive scaling factor component
Returns:
Type Description Vector3 out -
getRotation(out){Quaternion}
-
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.
Name Type Description outQuaternion Quaternion to receive the rotation component
Returns:
Type Description Quaternion out -
fromRotationTranslationScale(q, v, s){Matrix4Notifier}
-
Creates a matrix from a quaternion rotation, vector translation and vector scale
Name Type Description qQuaternion Rotation quaternion
vVector3 Translation vector
sVector3 Scaling vector
Returns:
Type Description Matrix4Notifier this -
fromRotationTranslationScaleOrigin(q, v, s, o, notCallUpdate){Matrix4Notifier}
-
Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin
Name Type Default Description qQuaternion Rotation quaternion
vVector3 Translation vector
sVector3 Scaling vector
oVector3 The origin vector around which to scale and rotate
notCallUpdateBoolean false optional notCallUpdate
Returns:
Type Description Matrix4Notifier this -
fromQuat(q){Matrix4Notifier}
-
Calculates a 4x4 matrix from the given quaternion
Name Type Description qQuaternion Quaternion to create matrix from
Returns:
Type Description Matrix4Notifier this -
frustum(left, right, bottom, top, near, far){Matrix4Notifier}
-
Generates a frustum matrix with the given bounds
Name Type Description leftNumber Left bound of the frustum
rightNumber Right bound of the frustum
bottomNumber Bottom bound of the frustum
topNumber Top bound of the frustum
nearNumber Near bound of the frustum
farNumber Far bound of the frustum
Returns:
Type Description Matrix4Notifier this -
perspective(fovy, aspect, near, far){Matrix4Notifier}
-
Generates a perspective projection matrix with the given bounds
Name Type Description fovyNumber Vertical field of view in radians
aspectNumber Aspect ratio. typically viewport width/height
nearNumber Near bound of the frustum
farNumber Far bound of the frustum
Returns:
Type Description Matrix4Notifier this -
perspectiveFromFieldOfView(fov, Near, far){Matrix4Notifier}
-
Generates a perspective projection matrix with the given field of view.
Name Type Description fovObject Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees
NearNumber bound of the frustum
farNumber Far bound of the frustum
Returns:
Type Description Matrix4Notifier this -
ortho(left, right, bottom, top, near, far){Matrix4Notifier}
-
Generates a orthogonal projection matrix with the given bounds
Name Type Description leftNumber Left bound of the frustum
rightNumber Right bound of the frustum
bottomNumber Bottom bound of the frustum
topNumber Top bound of the frustum
nearNumber Near bound of the frustum
farNumber Far bound of the frustum
Returns:
Type Description Matrix4Notifier this -
lookAt(eye, center, up){Matrix4Notifier}
-
Generates a look-at matrix with the given eye position, focal point, and up axis
Name Type Description eyeXYZObject Position of the viewer
centerXYZObject Point the viewer is looking at
upVector3 pointing up
Returns:
Type Description Matrix4Notifier this -
targetTo(eye, Point, up){Matrix4Notifier}
-
Generates a matrix that makes something look at something else.
Name Type Description eyeXYZObject Position of the viewer
PointXYZObject the viewer is looking at
upVector3 pointing up
Returns:
Type Description Matrix4Notifier this -
frob(){Number}
-
Returns Frobenius norm of a mat4
Returns:
Type Description Number Frobenius norm -
add(a, b){Matrix4}
-
Adds two mat4's
Name Type Description aMatrix4 bMatrix4 optional 如果不传,计算 this 和 a 的和
Returns:
Type Description Matrix4 this -
subtract(a, b){Matrix4}
-
Subtracts matrix b from matrix a
Name Type Description aMatrix4 bMatrix4 optional 如果不传,计算 this 和 a 的差
Returns:
Type Description Matrix4 this -
exactEquals(a, b){Boolean}
-
Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)
Name Type Description aMatrix4 bMatrix4 optional 如果不传,比较 this 和 a 是否相等
Returns:
Type Description Boolean -
equals(a, b){Boolean}
-
Returns whether or not the matrices have approximately the same elements in the same position.
Name Type Description aMatrix4 bMatrix4 optional 如果不传,比较 this 和 a 是否近似相等
Returns:
Type Description Boolean -
compose(q, v, s, p){Matrix4Notifier}
-
compose
Name Type Description qQuaternion quaternion
vVector3 position
sVector3 scale
pVector3 [pivot]
Returns:
Type Description Matrix4Notifier this -
decompose(q, v, s, p){Matrix4Notifier}
-
decompose
Name Type Description qQuaternion quaternion
vVector3 position
sVector3 scale
pVector3 [pivot]
Returns:
Type Description Matrix4Notifier this -
Creates a new mat4 initialized with values from this matrix
Returns:
Type Description Matrix4 a new Matrix4 -
inherited toArray(array, offset){Array}
-
转换到数组
Name Type Default Description arrayArray.<number> | TypedArray [] optional 数组
offsetNumber 0 optional 数组偏移值
Returns:
Type Description Array -
inherited sub()
-
Alias for
Matrix4#subtract -
inherited mul()
-
Alias for
Matrix4#multiply