#include <pg_mat.h>
Public Member Functions | |
| pgMat () | |
| Constructs a pgMat. | |
| pgMat (const pgVec &x_axis_, const pgVec &y_axis_, const pgVec &z_axis_, const pgVec &trans_) | |
| Constructs and initialize a pgMat from the specified four pgVecs. | |
| void | set (const pgVec &x_axis_, const pgVec &y_axis_, const pgVec &z_axis_, const pgVec &trans_) |
| Sets all components from the specified four pgVecs. | |
| bool | isUnit () const |
| Returns whether this pgMat is equal to the unit matrix. | |
| pgMat | rotateX_r32 (r32 deg) const |
| Returns a pgMat which is this pgMat rotated around its x-axis. | |
| pgMat | rotateY_r32 (r32 deg) const |
| Returns a pgMat which is this pgMat rotated around its y-axis. | |
| pgMat | rotateZ_r32 (r32 deg) const |
| Returns a pgMat which is this pgMat rotated around its z-axis. | |
| pgMat | rotateX_s32 (s32 deg) const |
| Returns a pgMat which is this pgMat rotated around its x-axis. | |
| pgMat | rotateY_s32 (s32 deg) const |
| Returns a pgMat which is this pgMat rotated around its y-axis. | |
| pgMat | rotateZ_s32 (s32 deg) const |
| Returns a pgMat which is this pgMat rotated around its z-axis. | |
| pgMat | scale (r32 x_scale, r32 y_scale, r32 z_scale=1.0f) const |
| Returns a pgMat which is this pgMat scaled by the specified values. | |
| pgMat | translate (r32 x, r32 y, r32 z=0.0f) const |
| Returns a pgMat which is this pgMat translated along its axes for the specified lengths. | |
| pgMat | slerp (const pgMat &to, r32 ratio) const |
| Returns a pgMat which is interpolated between this pgMat and an another pgMat by the specified ratio, using spherical linear interpolation. | |
| pgMat | slerp_noTrans (const pgMat &to, r32 ratio) const |
| Returns a pgMat whose components except the translation is interpolated between this pgMat and an another pgMat by the specified ratio, using spherical linear interpolation, and whose translation is equal to the translation of this pgMat. | |
| pgMat | orthonormal () const |
| Returns a pgMat which is orthonormalized version of this pgMat. | |
| pgMat | toLocalOf (const pgMat &mat) const |
| Returns a pgMat which is this pgMat converted from in the world coordinate system to in the local coordinate system of the specified pgMat. | |
| pgMat | toGlobalFrom (const pgMat &mat) const |
| Returns a pgMat which is this pgMat converted from in the local coordinate system of the specified pgMat to in the world coordinate system. | |
| pgMat | toLocalOf_noTrans (const pgMat &mat) const |
| Returns a pgMat which is this pgMat converted from in the world coordinate system to in the local coordinate system of the specified pgMat whose translation is ignored. | |
| pgMat | toGlobalFrom_noTrans (const pgMat &mat) const |
| Returns a pgMat which is this pgMat converted from in the local coordinate system of the specified pgMat whose translation is ignored to in the world coordinate system. | |
| void | toR32x16 (r32 *r32x16) const |
| Converts this pgMat to a 16-element array. | |
Static Public Member Functions | |
| static pgMat | lookAt (const pgVec &from, const pgVec &to, const pgVec &up) |
| Returns a pgMat which is the look-at matrix built by the specified values. | |
| static pgMat | fromR32x16 (const r32 *r32x16) |
| Returns a pgMat which is converted from a 16-element array. | |
| static void | mulR32x16 (r32 *res_r32x16, const r32 *lhs_r32x16, const r32 *rhs_r32x16) |
| Multiplies two 16-element arrays as two matrices. | |
Public Attributes | |
| pgVec | x_axis |
| The 1st row, which is usually used as the x-axis. | |
| pgVec | y_axis |
| The 2nd row, which is usually used as the y-axis. | |
| pgVec | z_axis |
| The 3rd row, which is usually used as the z-axis. | |
| pgVec | trans |
| The 4th row, which is usually used as the translation. | |
Static Public Attributes | |
| static const pgMat | ZERO |
| The zero matrix. | |
| static const pgMat | UNIT |
| The unit matrix. | |
| pgMat::pgMat | ( | const pgVec & | x_axis_, | |
| const pgVec & | y_axis_, | |||
| const pgVec & | z_axis_, | |||
| const pgVec & | trans_ | |||
| ) |
Constructs and initialize a pgMat from the specified four pgVecs.
| [in] | x_axis_ | The x-axis. |
| [in] | y_axis_ | The y-axis. |
| [in] | z_axis_ | The z-axis. |
| [in] | trans_ | The translation. |
| static pgMat pgMat::fromR32x16 | ( | const r32 * | r32x16 | ) | [static] |
| bool pgMat::isUnit | ( | ) | const |
| static void pgMat::mulR32x16 | ( | r32 * | res_r32x16, | |
| const r32 * | lhs_r32x16, | |||
| const r32 * | rhs_r32x16 | |||
| ) | [static] |
Multiplies two 16-element arrays as two matrices.
| [out] | res_r32x16 | The destination of the multiplied 16-element array. |
| [in] | lhs_r32x16 | The left hand side 16-element array. |
| [in] | rhs_r32x16 | The right hand side 16-element array. |
| pgMat pgMat::orthonormal | ( | ) | const |
| pgMat pgMat::rotateX_r32 | ( | r32 | deg | ) | const |
| pgMat pgMat::rotateX_s32 | ( | s32 | deg | ) | const |
| pgMat pgMat::rotateY_r32 | ( | r32 | deg | ) | const |
| pgMat pgMat::rotateY_s32 | ( | s32 | deg | ) | const |
| pgMat pgMat::rotateZ_r32 | ( | r32 | deg | ) | const |
| pgMat pgMat::rotateZ_s32 | ( | s32 | deg | ) | const |
| pgMat pgMat::scale | ( | r32 | x_scale, | |
| r32 | y_scale, | |||
| r32 | z_scale = 1.0f | |||
| ) | const |
| void pgMat::set | ( | const pgVec & | x_axis_, | |
| const pgVec & | y_axis_, | |||
| const pgVec & | z_axis_, | |||
| const pgVec & | trans_ | |||
| ) |
Sets all components from the specified four pgVecs.
| [in] | x_axis_ | The x-axis. |
| [in] | y_axis_ | The y-axis. |
| [in] | z_axis_ | The z-axis. |
| [in] | trans_ | The translation. |
Returns a pgMat which is interpolated between this pgMat and an another pgMat by the specified ratio, using spherical linear interpolation.
| [in] | to | An another pgMat. |
| [in] | ratio | The value which indicates how far to interpolate between two pgMats. This value is clamped between 0.0f and 1.0f. |
Returns a pgMat whose components except the translation is interpolated between this pgMat and an another pgMat by the specified ratio, using spherical linear interpolation, and whose translation is equal to the translation of this pgMat.
| [in] | to | An another pgMat. |
| [in] | ratio | The value which indicates how far to interpolate between two pgMats. This value is clamped between 0.0f and 1.0f. |
| void pgMat::toR32x16 | ( | r32 * | r32x16 | ) | const |
Converts this pgMat to a 16-element array.
| [out] | r32x16 | A destination of the converted 16-element array. |
| pgMat pgMat::translate | ( | r32 | x, | |
| r32 | y, | |||
| r32 | z = 0.0f | |||
| ) | const |
The 4th row, which is usually used as the translation.
const pgMat pgMat::UNIT [static] |
The unit matrix.
The 1st row, which is usually used as the x-axis.
The 2nd row, which is usually used as the y-axis.
The 3rd row, which is usually used as the z-axis.
const pgMat pgMat::ZERO [static] |
The zero matrix.
1.5.8