nlib
|
The class with the collection of functions that handle 4x4 matrices. More...
#include "nn/nlib/simd/SimdMatrix.h"
Static Public Member Functions | |
static SimdVector | Determinant (SimdMatrixArg m) noexcept |
Calculates the determinant. More... | |
static SimdMatrix | Identity () noexcept |
Returns an identity matrix. | |
static SimdMatrix | Inverse (SimdVector *det, SimdMatrixArg m) noexcept |
Calculates the inverse matrix. More... | |
static bool | IsIdentity (SimdMatrixArg m) noexcept |
Determines whether a matrix is an identity matrix. More... | |
static bool | IsInfinite (SimdMatrixArg m) noexcept |
Determines whether matrix m has any infinite elements. More... | |
static bool | IsNaN (SimdMatrixArg m) noexcept |
Determines whether matrix m has any non-numeric elements. More... | |
static SimdMatrix | Mult (SimdMatrixArg a, SimdMatrixArg b) noexcept |
Multiplies matrices. More... | |
static SimdMatrix | Transpose (SimdMatrixArg m) noexcept |
Transposes a matrix. More... | |
static SimdMatrix | MultTranspose (SimdMatrixArg a, SimdMatrixArg b) noexcept |
Calculates the transpose of the product of two matrices. More... | |
static SimdMatrix | FromScaling (float scale_x, float scale_y, float scale_z) noexcept |
Creates a scaling matrix. More... | |
static SimdMatrix | FromScaling (SimdVectorArg scale) noexcept |
Creates a scaling matrix. More... | |
static SimdMatrix | FromTranslation (float ofs_x, float ofs_y, float ofs_z) noexcept |
Creates a translation matrix. More... | |
static SimdMatrix | FromTranslation (SimdVectorArg ofs) noexcept |
Creates a translation matrix. More... | |
static SimdMatrix | FromRotationX (float sin_value, float cos_value) noexcept |
Creates a matrix rotated around the x-axis. More... | |
static SimdMatrix | FromRotationY (float sin_value, float cos_value) noexcept |
Creates a matrix rotated around the y-axis. More... | |
static SimdMatrix | FromRotationZ (float sin_value, float cos_value) noexcept |
Creates a matrix rotated around the z-axis. More... | |
static SimdMatrix | FromRotationAxisAndSinCos (SimdVectorArg axis_normalized, float sin_value, float cos_value) noexcept |
Calculates a rotation matrix from the axis and the sin/cos of the angle of rotation. More... | |
static SimdMatrix | FromRotationQuaternion (SimdQuaternionArg quat) noexcept |
Calculates a rotation matrix from a quaternion. More... | |
static SimdMatrix | FromRotationZXY (SimdVectorArg sin_xyz, SimdVectorArg cos_xyz) noexcept |
Calculates a rotation matrix from the sin/cos of the angle of rotation around each of the ZXY axes. More... | |
static SimdMatrix | LookToLh (SimdVectorArg eye_pos, SimdVectorArg eye_dir_normalized, SimdVectorArg up_dir_normalized) noexcept |
Creates a camera matrix in a left-handed coordinate system from the camera position, the camera direction, and the up direction. More... | |
static SimdMatrix | LookAtLh (SimdVectorArg eye_pos, SimdVectorArg at_pos, SimdVectorArg up_dir_normalized) noexcept |
Creates a camera matrix in a left-handed coordinate system from the camera position, the focal point, and the up direction. More... | |
static SimdMatrix | LookToRh (SimdVectorArg eye_pos, SimdVectorArg eye_dir_normalized, SimdVectorArg up_dir_normalized) noexcept |
Creates a camera matrix in a right-handed coordinate system from the camera position, the camera direction, and the up direction. More... | |
static SimdMatrix | LookAtRh (SimdVectorArg eye_pos, SimdVectorArg at_pos, SimdVectorArg up_dir_normalized) noexcept |
Creates a camera matrix in a right-handed coordinate system from the camera position, the focal point, and the up direction. More... | |
static SimdMatrix | PerspectiveLh (float width, float height, float near_z, float far_z) noexcept |
Creates a perspective projection matrix in a left-handed coordinate system. More... | |
static SimdMatrix | PerspectiveRh (float width, float height, float near_z, float far_z) noexcept |
Creates a perspective projection matrix in a right-handed coordinate system. More... | |
static SimdMatrix | PerspectiveFovLh (float half_fovy_sin, float half_fovy_cos, float aspect, float near_z, float far_z) noexcept |
Creates a perspective projection matrix in a left-handed coordinate system. More... | |
static SimdMatrix | PerspectiveFovRh (float half_fovy_sin, float half_fovy_cos, float aspect, float near_z, float far_z) noexcept |
Creates a perspective projection matrix in a right-handed coordinate system. More... | |
static SimdMatrix | PerspectiveOffCenterLh (float left, float right, float bottom, float top, float near_z, float far_z) noexcept |
Creates a perspective projection matrix in a left-handed coordinate system. More... | |
static SimdMatrix | PerspectiveOffCenterRh (float left, float right, float bottom, float top, float near_z, float far_z) noexcept |
Creates a perspective projection matrix in a right-handed coordinate system. More... | |
static SimdMatrix | OrthographicLh (float width, float height, float near_z, float far_z) noexcept |
Creates an orthographic projection matrix in a left-handed coordinate system. More... | |
static SimdMatrix | OrthographicRh (float width, float height, float near_z, float far_z) noexcept |
Creates an orthographic projection matrix in a right-handed coordinate system. More... | |
static SimdMatrix | OrthographicOffCenterLh (float left, float right, float bottom, float top, float near_z, float far_z) noexcept |
Creates an orthographic projection matrix in a left-handed coordinate system. More... | |
static SimdMatrix | OrthographicOffCenterRh (float left, float right, float bottom, float top, float near_z, float far_z) noexcept |
Creates an orthographic projection matrix in a right-handed coordinate system. More... | |
static SimdMatrix | Shadow (SimdPlaneArg shadow_plane, SimdVector light_pos) noexcept |
Creates a matrix that projects from light_pos to shadow_plane. More... | |
static SimdMatrix | Reflect (SimdPlaneArg reflection_plane) noexcept |
Creates a matrix to reflect a vector from the plane reflection_plane. More... | |
static void | Decompose (SimdVector *scale, SimdMatrix *rot, SimdVector *trans, SimdMatrixArg m) noexcept |
Decomposes a matrix into its scale, rotation, and translation matrices. More... | |
Loading From Memory | |
static SimdMatrix | LoadFloat4x4 (const Float4x4 *p) noexcept |
Loads a 4x4 matrix from memory. | |
static SimdMatrix | LoadFloat3x4 (const Float3x4 *p) noexcept |
Loads a 3x4 matrix from memory. | |
static SimdMatrix | LoadFloat4x3 (const Float4x3 *p) noexcept |
Loads a 4x3 matrix from memory. | |
static SimdMatrix | LoadFloat3x3 (const Float3x3 *p) noexcept |
Loads a 3x3 matrix from memory. | |
Storing to Memory | |
static void | StoreFloat4x4 (Float4x4 *p, SimdMatrixArg m) noexcept |
Writes a 4x4 matrix to memory. | |
static void | StoreFloat3x4 (Float3x4 *p, SimdMatrixArg m) noexcept |
Transposes a matrix and writes the top three rows to memory. | |
static void | StoreFloat4x3 (Float4x3 *p, SimdMatrixArg m) noexcept |
Writes a 4x3 matrix to memory. | |
static void | StoreFloat3x3 (Float3x3 *p, SimdMatrixArg m) noexcept |
Writes a 3x3 matrix to memory. | |
The class with the collection of functions that handle 4x4 matrices.
Definition at line 28 of file SimdMatrix.h.
|
staticnoexcept |
Decomposes a matrix into its scale, rotation, and translation matrices.
[out] | scale | Pointer to where the scale is stored. |
[out] | rot | Pointer to where the rotation is stored. |
[out] | trans | Pointer to where the translation is stored. |
[in] | m | The 4x4 matrix to decompose. |
0
or larger for each scale.
|
staticnoexcept |
Calculates the determinant.
[in] | m | A 4x4 matrix. |
|
staticnoexcept |
Calculates a rotation matrix from the axis and the sin/cos
of the angle of rotation.
[in] | axis_normalized | A normalized 3D rotation axis vector. |
[in] | sin_value | Passes sin(rad) , where rad is the angle of rotation. |
[in] | cos_value | Passes cos(rad) , where rad is the angle of rotation. |
|
staticnoexcept |
Calculates a rotation matrix from a quaternion.
[in] | quat | A quaternion (x, y, z, w). |
|
staticnoexcept |
Creates a matrix rotated around the x-axis.
[in] | sin_value | sin(rad) , where rad is the angle of rotation. |
[in] | cos_value | cos(rad) , where rad is the angle of rotation. |
|
staticnoexcept |
Creates a matrix rotated around the y-axis.
[in] | sin_value | sin(rad) , where rad is the angle of rotation. |
[in] | cos_value | cos(rad) , where rad is the angle of rotation. |
|
staticnoexcept |
Creates a matrix rotated around the z-axis.
[in] | sin_value | sin(rad) , where rad is the angle of rotation. |
[in] | cos_value | cos(rad) , where rad is the angle of rotation. |
|
staticnoexcept |
Calculates a rotation matrix from the sin/cos
of the angle of rotation around each of the ZXY axes.
[in] | sin_xyz | A three-dimensional vector(sin(rad_x), sin(rad_y), sin(rad_z) ). |
[in] | cos_xyz | A three-dimensional vector(cos(rad_x), cos(rad_y), cos(rad_z) ). |
|
staticnoexcept |
Creates a scaling matrix.
[in] | scale_x | The scaling along the x-axis. |
[in] | scale_y | The scaling along the y-axis. |
[in] | scale_z | The scaling along the z-axis. |
|
staticnoexcept |
Creates a scaling matrix.
[in] | scale | The three-dimensional vector storing the scaling along the x-axis, y-axis, and z-axis. |
|
staticnoexcept |
Creates a translation matrix.
[in] | ofs_x | The translation along the x-axis. |
[in] | ofs_y | The translation along the y-axis. |
[in] | ofs_z | The translation along the z-axis. |
|
staticnoexcept |
Creates a translation matrix.
[in] | ofs | The three-dimensional vector storing the translation along the x-axis, y-axis, and z-axis. |
|
staticnoexcept |
Calculates the inverse matrix.
[in] | det | Stores the determinant, if not NULL . |
[in] | m | A 4x4 matrix. |
|
staticnoexcept |
Determines whether a matrix is an identity matrix.
[in] | m | A 4x4 matrix. |
true
if the matrix is an identity matrix, and false
otherwise.
|
staticnoexcept |
Determines whether matrix m has any infinite elements.
[in] | m | A 4x4 matrix. |
true
if m has any elements that are infinite, and false
otherwise.
|
staticnoexcept |
Determines whether matrix m has any non-numeric elements.
[in] | m | A 4x4 matrix. |
true
if m has any non-numeric elements, and false
otherwise.
|
staticnoexcept |
Creates a camera matrix in a left-handed coordinate system from the camera position, the focal point, and the up direction.
[in] | eye_pos | The camera position. |
[in] | at_pos | The focal point. |
[in] | up_dir_normalized | The normalized up direction. |
|
staticnoexcept |
Creates a camera matrix in a right-handed coordinate system from the camera position, the focal point, and the up direction.
[in] | eye_pos | The camera position. |
[in] | at_pos | The focal point. |
[in] | up_dir_normalized | The normalized up direction. |
|
staticnoexcept |
Creates a camera matrix in a left-handed coordinate system from the camera position, the camera direction, and the up direction.
[in] | eye_pos | The camera position. |
[in] | eye_dir_normalized | The normalized camera direction. |
[in] | up_dir_normalized | The normalized up direction. |
|
staticnoexcept |
Creates a camera matrix in a right-handed coordinate system from the camera position, the camera direction, and the up direction.
[in] | eye_pos | The camera position. |
[in] | eye_dir_normalized | The normalized camera direction. |
[in] | up_dir_normalized | The normalized up direction. |
|
staticnoexcept |
Multiplies matrices.
[in] | a | A 4x4 matrix. |
[in] | b | A 4x4 matrix. |
|
staticnoexcept |
Calculates the transpose of the product of two matrices.
[in] | a | A 4x4 matrix. |
[in] | b | A 4x4 matrix. |
|
staticnoexcept |
Creates an orthographic projection matrix in a left-handed coordinate system.
[in] | width | The width of the view frustum. |
[in] | height | The height of the view frustum. |
[in] | near_z | near Depth in the near plane. |
[in] | far_z | far Depth in the far plane. |
|
staticnoexcept |
Creates an orthographic projection matrix in a left-handed coordinate system.
[in] | left | The x-coordinate on the left side of the view frustum. |
[in] | right | The x-coordinate on the right side of the view frustum. |
[in] | bottom | The y-coordinate at the bottom of the view frustum. |
[in] | top | The y-coordinate at the top of the view frustum. |
[in] | near_z | near Depth in the near plane. |
[in] | far_z | far Depth in the far plane. |
|
staticnoexcept |
Creates an orthographic projection matrix in a right-handed coordinate system.
[in] | left | The x-coordinate on the left side of the view frustum. |
[in] | right | The x-coordinate on the right side of the view frustum. |
[in] | bottom | The y-coordinate at the bottom of the view frustum. |
[in] | top | The y-coordinate at the top of the view frustum. |
[in] | near_z | near Depth in the near plane. |
[in] | far_z | far Depth in the far plane. |
|
staticnoexcept |
Creates an orthographic projection matrix in a right-handed coordinate system.
[in] | width | The width of the view frustum. |
[in] | height | The height of the view frustum. |
[in] | near_z | near Depth in the near plane. |
[in] | far_z | far Depth in the far plane. |
|
staticnoexcept |
Creates a perspective projection matrix in a left-handed coordinate system.
[in] | half_fovy_sin | sin(rad/2) , where rad is the screen angle. |
[in] | half_fovy_cos | cos(rad/2) , where rad is the screen angle. |
[in] | aspect | The aspect ratio of the display area. |
[in] | near_z | near Depth in the near plane. |
[in] | far_z | far Depth in the far plane. |
|
staticnoexcept |
Creates a perspective projection matrix in a right-handed coordinate system.
[in] | half_fovy_sin | sin(rad/2) , where rad is the screen angle. |
[in] | half_fovy_cos | cos(rad/2) , where rad is the screen angle. |
[in] | aspect | The aspect ratio of the display area. |
[in] | near_z | near Depth in the near plane. |
[in] | far_z | far Depth in the far plane. |
|
staticnoexcept |
Creates a perspective projection matrix in a left-handed coordinate system.
[in] | width | The width of the view frustum. |
[in] | height | The height of the view frustum. |
[in] | near_z | near Depth in the near plane. |
[in] | far_z | far Depth in the far plane. |
|
staticnoexcept |
Creates a perspective projection matrix in a left-handed coordinate system.
[in] | left | The x-coordinate on the left side of the view frustum. |
[in] | right | The x-coordinate on the right side of the view frustum. |
[in] | bottom | The y-coordinate at the bottom of the view frustum. |
[in] | top | The y-coordinate at the top of the view frustum. |
[in] | near_z | near Depth in the near plane. |
[in] | far_z | far Depth in the far plane. |
|
staticnoexcept |
Creates a perspective projection matrix in a right-handed coordinate system.
[in] | left | The x-coordinate on the left side of the view frustum. |
[in] | right | The x-coordinate on the right side of the view frustum. |
[in] | bottom | The y-coordinate at the bottom of the view frustum. |
[in] | top | The y-coordinate at the top of the view frustum. |
[in] | near_z | near Depth in the near plane. |
[in] | far_z | far Depth in the far plane. |
|
staticnoexcept |
Creates a perspective projection matrix in a right-handed coordinate system.
[in] | width | The width of the view frustum. |
[in] | height | The height of the view frustum. |
[in] | near_z | near Depth in the near plane. |
[in] | far_z | far Depth in the far plane. |
|
staticnoexcept |
Creates a matrix to reflect a vector from the plane reflection_plane.
[in] | reflection_plane | The plane that reflects the vector. |
|
staticnoexcept |
Creates a matrix that projects from light_pos to shadow_plane.
[in] | shadow_plane | The projection plane. |
[in] | light_pos | If lane 3 (the w element) is 0 , the light source is an infinite parallel light. If 1 , it is a point light. |
|
staticnoexcept |
Transposes a matrix.
[in] | m | A 4x4 matrix. |
© 2012-2017 Nintendo Co., Ltd. All rights reserved.