pgMat Struct Reference
[pgMath -- Mathematics module]

A 3x4 matrix which is represented by four pgVecs. More...

#include <pg_mat.h>

List of all members.

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.


Detailed Description

A 3x4 matrix which is represented by four pgVecs.

Constructor & Destructor Documentation

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.

Parameters:
[in] x_axis_ The x-axis.
[in] y_axis_ The y-axis.
[in] z_axis_ The z-axis.
[in] trans_ The translation.


Member Function Documentation

static pgMat pgMat::fromR32x16 ( const r32 *  r32x16  )  [static]

Returns a pgMat which is converted from a 16-element array.

Parameters:
[in] r32x16 A 16-element array to be converted.
Returns:
A pgMat which is converted from the 16-element array.

bool pgMat::isUnit (  )  const

Returns whether this pgMat is equal to the unit matrix.

Returns:
Whether this pgMat is equal to the unit matrix.

static pgMat pgMat::lookAt ( const pgVec from,
const pgVec to,
const pgVec up 
) [static]

Returns a pgMat which is the look-at matrix built by the specified values.

Parameters:
[in] from The position of the camera.
[in] to The position of the camera look-at target.
[in] up The up direction of the camera.
Returns:
A pgMat which is the look-at matrix built by the specified values.

static void pgMat::mulR32x16 ( r32 *  res_r32x16,
const r32 *  lhs_r32x16,
const r32 *  rhs_r32x16 
) [static]

Multiplies two 16-element arrays as two matrices.

Parameters:
[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

Returns a pgMat which is orthonormalized version of this pgMat.

Returns:
A pgMat which is orthonormalized version of this pgMat.

pgMat pgMat::rotateX_r32 ( r32  deg  )  const

Returns a pgMat which is this pgMat rotated around its x-axis.

Parameters:
[in] deg An r32 angle of rotation in degrees.
Returns:
A pgMat which is this pgMat rotated around its x-axis.

pgMat pgMat::rotateX_s32 ( s32  deg  )  const

Returns a pgMat which is this pgMat rotated around its x-axis.

This method allows only an s32 type as an angle, but is faster than its r32 version.

Parameters:
[in] deg An s32 angle of rotation in degrees.
Returns:
A pgMat which is this pgMat rotated around its x-axis.

pgMat pgMat::rotateY_r32 ( r32  deg  )  const

Returns a pgMat which is this pgMat rotated around its y-axis.

Parameters:
[in] deg An r32 angle of rotation in degrees.
Returns:
A pgMat which is this pgMat rotated around its y-axis.

pgMat pgMat::rotateY_s32 ( s32  deg  )  const

Returns a pgMat which is this pgMat rotated around its y-axis.

This method allows only an s32 type as an angle, but is faster than its r32 version.

Parameters:
[in] deg An s32 angle of rotation in degrees.
Returns:
A pgMat which is this pgMat rotated around its y-axis.

pgMat pgMat::rotateZ_r32 ( r32  deg  )  const

Returns a pgMat which is this pgMat rotated around its z-axis.

Parameters:
[in] deg An r32 angle of rotation in degrees.
Returns:
A pgMat which is this pgMat rotated around its z-axis.

pgMat pgMat::rotateZ_s32 ( s32  deg  )  const

Returns a pgMat which is this pgMat rotated around its z-axis.

This method allows only an s32 type as an angle, but is faster than its r32 version.

Parameters:
[in] deg An s32 angle of rotation in degrees.
Returns:
A pgMat which is this pgMat rotated around its z-axis.

pgMat 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.

Parameters:
[in] x_scale The x-axis scale factor.
[in] y_scale The y-axis scale factor.
[in] z_scale The z-axis scale factor. If not specified, 1.0f is used.
Returns:
A pgMat which is this pgMat scaled by the specified values.

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.

Parameters:
[in] x_axis_ The x-axis.
[in] y_axis_ The y-axis.
[in] z_axis_ The z-axis.
[in] trans_ The translation.

pgMat 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.

Parameters:
[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 which is interpolated between two pgMats.

pgMat 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.

Parameters:
[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 two pgMats.

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.

Parameters:
[in] mat The origin pgMat of the local coordinate system.
Returns:
A pgMat which is this pgMat in the world coordinate system.

pgMat 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.

Parameters:
[in] mat The origin pgMat of the local coordinate system, whose translation is ignored.
Returns:
A pgMat which is this pgMat in the world coordinate system.

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.

Parameters:
[in] mat The origin pgMat of the local coordinate system.
Returns:
A pgMat which is this pgMat in the local coordinate system.

pgMat 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.

Parameters:
[in] mat The origin pgMat of the local coordinate system, whose translation is ignored.
Returns:
A pgMat which is this pgMat in the local coordinate system.

void pgMat::toR32x16 ( r32 *  r32x16  )  const

Converts this pgMat to a 16-element array.

Parameters:
[out] r32x16 A destination of the converted 16-element array.

pgMat 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.

Parameters:
[in] x A length of translation along the x-axis.
[in] y A length of translation along the y-axis.
[in] z A length of translation along the z-axis. If not specified, 0.0f is used.
Returns:
A pgMat which is this pgMat translated along its axes for the specified lengths.


Member Data Documentation

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.


The documentation for this struct was generated from the following file:

Generated on Sat Aug 15 11:24:38 2009 for Pogolyn by  doxygen 1.5.8