cryph utilities [subset]  2.0
Subset of the full cryph package of mathematical utilities for points, vectors, and matrices
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | Friends | List of all members
cryph::Matrix4x4 Class Reference

Public Member Functions

 Matrix4x4 ()
 
 Matrix4x4 (const Matrix4x4 &m)
 
 Matrix4x4 (double m11, double m12, double m13, double m14, double m21, double m22, double m23, double m24, double m31, double m32, double m33, double m34, double m41, double m42, double m43, double m44)
 
 Matrix4x4 (const Matrix3x3 &M)
 
 Matrix4x4 (const Matrix3x3 &M, const AffVector &t)
 
 Matrix4x4 (const Matrix3x3 &M, const AffPoint &FixedPoint)
 
 Matrix4x4 (const Matrix3x3 &M, const AffPoint &PreImage, const AffPoint &PostImage)
 
virtual ~Matrix4x4 ()
 
Matrix4x4 operator= (const Matrix4x4 &rhs)
 
Matrix4x4 operator*= (const Matrix4x4 &rhs)
 
Matrix4x4 operator*= (double f)
 
Matrix4x4 operator+= (const Matrix4x4 &rhs)
 
AffPoint operator* (const AffPoint &p) const
 
ProjPoint operator* (const ProjPoint &p) const
 
AffVector operator* (const AffVector &v) const
 
Matrix4x4 operator* (const Matrix4x4 &m2) const
 
Matrix4x4 operator+ (const Matrix4x4 &m2) const
 
Matrix4x4 operator- (const Matrix4x4 &m2) const
 
double determinant () const
 
double elementAt (int r, int c) const
 
float * extractColMajor (float m[16]) const
 
double * extractColMajor (double m[16]) const
 
float * extractRowMajor (float m[16]) const
 
double * extractRowMajor (double m[16]) const
 
void extractAffineMt (Matrix3x3 &M, AffVector &t) const
 
int extractAxisAngle (AffPoint &B, AffVector &w, double &theta, AffVector &postTranslation) const
 
bool inverse (Matrix4x4 &mInv) const
 
int isAffineTransformation () const
 
void multiply (const double a[], double b[], int nElements=4) const
 
void multiply (const float a[], float b[], int nElements=4) const
 
void setElementAt (int r, int c, double newValue)
 
Matrix3x3 subMatrix (int skipRow, int skipCol) const
 

Static Public Member Functions

static Matrix4x4 fromColMajor (const float *m)
 
static Matrix4x4 fromColMajor (const double *m)
 
static Matrix4x4 fromRowMajor (const float *m)
 
static Matrix4x4 fromRowMajor (const double *m)
 
static Matrix4x4 generalRotationDegrees (const AffPoint &B, const AffVector &axis, double angle)
 
static Matrix4x4 generalRotationRadians (const AffPoint &B, const AffVector &axis, double angle)
 
static Matrix4x4 mirror (const AffPoint &B, const AffVector &n)
 
static Matrix4x4 xRotationDegrees (double angle)
 
static Matrix4x4 yRotationDegrees (double angle)
 
static Matrix4x4 zRotationDegrees (double angle)
 
static Matrix4x4 xRotationRadians (double angle)
 
static Matrix4x4 yRotationRadians (double angle)
 
static Matrix4x4 zRotationRadians (double angle)
 
static Matrix4x4 translation (const AffVector &trans)
 
static Matrix4x4 translation (double dx, double dy, double dz)
 
static Matrix4x4 scale (double sx, double sy, double sz)
 
static Matrix4x4 lookAt (const cryph::AffPoint &eye, const cryph::AffPoint &center, const cryph::AffVector &up)
 
static Matrix4x4 orthogonal (double xmin, double xmax, double ymin, double ymax, double zmin, double zmax)
 
static Matrix4x4 oblique (double zpp, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, const cryph::AffVector &projDir)
 
static Matrix4x4 perspective (double zpp, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, double h=0.0)
 
static bool getECvw (const cryph::AffPoint &eye, const cryph::AffPoint &center, const cryph::AffVector &up, cryph::AffVector &v, cryph::AffVector &w)
 

Static Public Attributes

static const Matrix4x4 IdentityMatrix
 
static const Matrix4x4 ZeroMatrix
 
static const int InternalBasePointComputationError = -30
 
static const int NotAffine = -10
 
static const int Extracted_BwTheta = 1
 

Protected Attributes

double mElem [4][4]
 

Friends

Matrix4x4 operator* (double f, const Matrix4x4 &m)
 
std::ostream & operator<< (std::ostream &os, const Matrix4x4 &m)
 
std::istream & operator>> (std::istream &is, Matrix4x4 &m)
 

Constructor & Destructor Documentation

cryph::Matrix4x4::Matrix4x4 ( )

Default constructor creates a 4x4 identity matrix

cryph::Matrix4x4::Matrix4x4 ( const Matrix4x4 m)

The copy constructor

Parameters
mthe matrix whose elements are copied
cryph::Matrix4x4::Matrix4x4 ( double  m11,
double  m12,
double  m13,
double  m14,
double  m21,
double  m22,
double  m23,
double  m24,
double  m31,
double  m32,
double  m33,
double  m34,
double  m41,
double  m42,
double  m43,
double  m44 
)

Construct a 4x4 matrix directly from 16 values given in row-major order

Parameters
mrcThe element for row r, column c
cryph::Matrix4x4::Matrix4x4 ( const Matrix3x3 M)

Construct a 4x4 transformation matrix from a 3x3 matrix that is assumed to encode a 2D transformation in projective space. The implementation slides the third row and third column over to the fourth, and inserts a third row and third column from a 4x4 Identity matrix.

Parameters
Ma 3x3 matrix that describes a 2D xform in projective space. That is, it is assumed to do (x', y', w')^T = M*(x, y, 1)^T.
cryph::Matrix4x4::Matrix4x4 ( const Matrix3x3 M,
const AffVector t 
)

Construct a 4x4 matrix from an Affine transformation: (M, t), where (x', y', z')^T = M*(x, y, z)^T + t. The implementation places M in the upper left 3x3 submatrix of the 4x4 matrix, it places t in the first three rows of the fourth column, and it assigns (0,0,0,1) to the 4th row.

Parameters
Ma 3x3 matrix encoding a linear transformation on 3D vectors
ta 3D vector
See also
extractAffineMt
cryph::Matrix4x4::Matrix4x4 ( const Matrix3x3 M,
const AffPoint FixedPoint 
)

Construct a 4x4 matrix from a 3x3 matrix, M (encoding a linear transformation on 3D vectors) and a fixed point. It first constructs the translation vector, t, such that: M*FixedPoint + t = FixedPoint. It then creates the matrix as if the constructor with prototype Matrix4x4(Matrix3x3, AffVector) were called.

Parameters
Ma 3x3 matrix encoding a linear transformation on 3D vectors
FixedPointa 3D affine point unaffected by the affine transformation
cryph::Matrix4x4::Matrix4x4 ( const Matrix3x3 M,
const AffPoint PreImage,
const AffPoint PostImage 
)

Construct a 4x4 matrix from a 3x3 matrix, M (encoding a linear transformation on 3D vectors) and a pair of points, the latter being the point to which the former is mapped by the transformation to be encoded in this newly constructed matrix. It first constructs the translation vector, t, such that: M*PreImage + t = PostImage. It then creates the matrix as if the constructor with prototype Matrix4x4(Matrix3x3, AffVector) were called.

Parameters
Ma 3x3 matrix encoding a linear transformation on 3D vectors
PreImagea 3D affine point
PostImagethe 3D affine point to which "PreImage" is mapped
cryph::Matrix4x4::~Matrix4x4 ( )
virtual

The destructor

Member Function Documentation

double cryph::Matrix4x4::determinant ( ) const

Compute the determinant of "this" matrix

Returns
the determinant
double cryph::Matrix4x4::elementAt ( int  r,
int  c 
) const

Retrieve a specific element of the matrix

Parameters
rthe row containing the desired element
cthe column containing the desired element
Returns
the element at [r][c]
See also
setElementAt
void cryph::Matrix4x4::extractAffineMt ( Matrix3x3 M,
AffVector t 
) const

Retrieve the affine transformation embedded in "this" 4x4 matrix. This method assumes that "this" matrix encodes an affine transformation and it simply places the upper left 3x3 into M, and the first three rows of the fourth column into t. It does not check to make sure that the 4th row is (0, 0, 0, 1).

Parameters
M[OUTPUT ONLY] the 3x3 matrix into which the upper left 3x3 submatrix of "this" matrix is to be written
t[OUTPUT ONLY] the 3D vector into which the first three rows of the fourth column of "this" matrix is to be written.
See also
isAffineTransformation - a method that can be used to verify whether "this" matrix does actually encode an affine transformation.
int cryph::Matrix4x4::extractAxisAngle ( AffPoint B,
AffVector w,
double &  theta,
AffVector postTranslation 
) const

The following routine attempts to find the unit axis vector (w) and angle (theta) which, when interpreted as a rotatition axis and angle, will reproduce the upper 3x3 portion of the matrix. It then computes a base point B which, when combined with (w,theta) will at least approximate the entire 4x4 matrix. At worst, a residual "postTranslation" will be required to reproduce the effect of the original 4x4 matrix. That translation (possibly 0) is returned in "postTranslation".

Parameters
B[OUTPUT ONLY] the base point for the equivalent rotation axis
w[OUTPUT ONLY] the unit rotation axis vector
theta[OUTPUT ONLY] the computed rotation angle in radians
postTranslation[OUTPUT ONLY] the post-translation required to complete the matching of the original 4x4 matrix
Returns
  • Matrix4x4::Extracted_BwTheta if the extraction was successful
  • Matrix4x4::NotAffine if the bottom row of "this" matrix is not (0,0,0,1)
  • Matrix3x3::NotOrthogonal if the upper left 3x3 is not an orthogonal matrix
  • Matrix3x3::NotRightHanded if the upper left 3x3 is not a right-handed matrix
float * cryph::Matrix4x4::extractColMajor ( float  m[16]) const

Extract the components of the matrix into the given single-precision array in column-major order.

Parameters
m[OUTPUT ONLY] an array of float of length 16
Returns
the base address of "m" so that the method call can be used as a parameter to an OpenGL function expecting an array of float.
See also
fromColMajor
double * cryph::Matrix4x4::extractColMajor ( double  m[16]) const

Extract the components of the matrix into the given double-precision array in column-major order.

Parameters
m[OUTPUT ONLY] an array of double of length 16
Returns
the base address of "m" so that the method call can be used as a parameter to an OpenGL function expecting an array of double.
See also
fromColMajor
float * cryph::Matrix4x4::extractRowMajor ( float  m[16]) const

Extract the components of the matrix into the given single-precision array in row-major order.

Parameters
m[OUTPUT ONLY] an array of float of length 16
Returns
the base address of "m" so that the method call can be used as a parameter to an OpenGL function expecting an array of float.
See also
fromRowMajor
double * cryph::Matrix4x4::extractRowMajor ( double  m[16]) const

Extract the components of the matrix into the given double-precision array in row-major order.

Parameters
m[OUTPUT ONLY] an array of double of length 16
Returns
the base address of "m" so that the method call can be used as a parameter to an OpenGL function expecting an array of double.
See also
fromRowMajor
Matrix4x4 cryph::Matrix4x4::fromColMajor ( const float *  m)
static

Factory method to create a 4x4 matrix from a single precision array of 16 elements assumed to hold the values of the matrix in column-major order.

Parameters
man array of float of length 16
Returns
the constructed 4x4 matrix
See also
extractColMajor
Matrix4x4 cryph::Matrix4x4::fromColMajor ( const double *  m)
static

Factory method to create a 4x4 matrix from a double precision array of 16 elements assumed to hold the values of the matrix in column-major order.

Parameters
man array of double of length 16
Returns
the constructed 4x4 matrix
See also
extractColMajor
Matrix4x4 cryph::Matrix4x4::fromRowMajor ( const float *  m)
static

Factory method to create a 4x4 matrix from a single precision array of 16 elements assumed to hold the values of the matrix in row-major order.

Parameters
man array of float of length 16
See also
extractRowMajor
Matrix4x4 cryph::Matrix4x4::fromRowMajor ( const double *  m)
static

Factory method to create a 4x4 matrix from a double precision array of 16 elements assumed to hold the values of the matrix in row-major order.

Parameters
man array of double of length 16
Returns
the constructed 4x4 matrix
See also
extractRowMajor
Matrix4x4 cryph::Matrix4x4::generalRotationDegrees ( const AffPoint B,
const AffVector axis,
double  angle 
)
static

Factory method to create a 4x4 matrix that performs a rotation about a general axis in 3D space.

Parameters
Ba 3D point on the desired rotation axis
axisa 3D vector along the rotation axis
anglethe desired rotation angle in degrees
Returns
the constructed 4x4 matrix
See also
extractAxisAngle
Matrix4x4 cryph::Matrix4x4::generalRotationRadians ( const AffPoint B,
const AffVector axis,
double  angle 
)
static

Factory method to create a 4x4 matrix that performs a rotation about a general axis in 3D space.

Parameters
Ba 3D point on the desired rotation axis
axisa 3D vector along the rotation axis
anglethe desired rotation angle in radians
Returns
the constructed 4x4 matrix
bool cryph::Matrix4x4::getECvw ( const cryph::AffPoint eye,
const cryph::AffPoint center,
const cryph::AffVector up,
cryph::AffVector v,
cryph::AffVector w 
)
static

Determine whether a given (eye, center, up) specification uniquely specifies a MC to EC transformation. This method is primarily designed for internal use (i.e., as a part of the implementation of "lookAt"), but it is potentially useful externally as well in order to ensure that a given set of viewing parameters is valid.

Parameters
eyethe (x,y,z) model coordinate position of the viewer
centerthe (x,y,z) model coordinate position of the "center of attention", typically a point in front of the eye near the center of the scene to be viewed.
upa 3D vector to fix the final rotational degree of freedom. The component of the "up" vector perpendicular to the line of sight (the vector from "center" towards "eye") will become the y-axis of the eye coordinate system.
v[OUTPUT ONLY] the unit vector as measured in MC of the EC y-axis
w[OUTPUT ONLY] the unit vector as measured in MC of the EC z-axis
Returns
true if and only if the (eye, center, up) parameters are valid and the output "v" and "w" parameters have been computed.
See also
lookAt
bool cryph::Matrix4x4::inverse ( Matrix4x4 mInv) const

Invert "this" matrix. This method is NOT highly numerical stable. It is OK with well-conditioned matrices. For a better matrix inverse implementation for when the matrix may be poorly conditioned, use MatrixNxN::inverse.

Parameters
mInv[OUTPUT ONLY] the inverted matriux will be deposited here
Returns
true if and only if the inverse was successfully computed
int cryph::Matrix4x4::isAffineTransformation ( ) const

Determine whether "this" matrix represents an affine transformation

Returns
an integer with bit 0 set iff M44==1; bit 1 set iff (M41, M42, M43) != (0, 0, 0)
Matrix4x4 cryph::Matrix4x4::lookAt ( const cryph::AffPoint eye,
const cryph::AffPoint center,
const cryph::AffVector up 
)
static

Factory method to create a 4x4 matrix that maps model coordinates into an eye coordinate system in which the x-axis is oriented left to right in the field of view; the y-axis is oriented bottom to top, and the z-axis is oriented from the scene back towards the eye.

Parameters
eyethe (x,y,z) model coordinate position of the viewer
centerthe (x,y,z) model coordinate position of the "center of attention", typically a point in front of the eye near the center of the scene to be viewed.
upa 3D vector to fix the final rotational degree of freedom. The component of the "up" vector perpendicular to the line of sight (the vector from "center" towards "eye") will become the y-axis of the eye coordinate system.
Returns
the constructed 4x4 matrix
See also
getECvw
Matrix4x4 cryph::Matrix4x4::mirror ( const AffPoint B,
const AffVector n 
)
static

Factory method to create a 4x4 matrix that mirrors geometry about a general plane in 3D space.

Parameters
Ba 3D point on the desired mirror plane
na 3D vector perpendicular to the plane
Returns
the constructed 4x4 matrix
void cryph::Matrix4x4::multiply ( const double  a[],
double  b[],
int  nElements = 4 
) const

Compute b = this * a

Parameters
a[INPUT ONLY] the untransformed tuple
b[OUTPUT ONLY] the computed product
nElementsthe length of the 'a' and 'b' arrays. If nElements<4, then (i) a[3] is assumed to be 1.0, and (ii) a[i] for nElements<=i<3 are assumed to be zero. nElements cannot be larger than 4. Only nElements positions of 'b' will be set.
void cryph::Matrix4x4::multiply ( const float  a[],
float  b[],
int  nElements = 4 
) const

Compute b = this * a

Parameters
a[INPUT ONLY] the untransformed tuple
b[OUTPUT ONLY] the computed product
nElementsthe length of the 'a' and 'b' arrays. If nElements<4, then (i) a[3] is assumed to be 1.0, and (ii) a[i] for nElements<=i<3 are assumed to be zero. nElements cannot be larger than 4. Only nElements positions of 'b' will be set.
Matrix4x4 cryph::Matrix4x4::oblique ( double  zpp,
double  xmin,
double  xmax,
double  ymin,
double  ymax,
double  zmin,
double  zmax,
const cryph::AffVector projDir 
)
static

Factory method to create a 4x4 matrix that performs an oblique projection from an eye coordinate system into a logical device space (LDS) in which the x, y, and z limits are -1 .. +1. This will incorporate a shear transformation that will produce an orthogonal left-handed LDS system as expected by OpenGL.

Parameters
zppthe eye coordinate z value that specifies the location of the projection plane
xminthe minimum x eye coordinate of the desired field of view defined on the projection plane
xmaxthe maximum x eye coordinate of the desired field of view defined on the projection plane
yminthe minimum y eye coordinate of the desired field of view defined on the projection plane
ymaxthe maximum y eye coordinate of the desired field of view defined on the projection plane
zminthe minimum z eye coordinate of the desired field of view
zmaxthe maximum z eye coordinate of the desired field of view
projDira vector defined in eye coordinates that specifies the common direction of projection. projDir.dz cannot be zero.
Returns
the constructed 4x4 matrix
AffPoint cryph::Matrix4x4::operator* ( const AffPoint p) const

Multiply an affine point by "this" matrix: p' = this * p. The point will be transformed using only the upper left 3x3 submatrix, M, and the translation vector, t, taken from the first three rows of the fourth column: p' = M*p + t.

Parameters
pthe 3D affine point to be transformed
Returns
the transformed affine point
ProjPoint cryph::Matrix4x4::operator* ( const ProjPoint p) const

Multiply a point in projective space by "this" matrix: p' = this * p.

Parameters
pthe 4D projective space point to be transformed
Returns
the transformed projective space point
AffVector cryph::Matrix4x4::operator* ( const AffVector v) const

Multiply a 3D vector by "this" matrix: v' = this * v. The vector will be transformed using only the upper left 3x3 submatrix, M. v' = M*v.

Parameters
vthe 3D vector to be transformed
Returns
the transformed vector
Matrix4x4 cryph::Matrix4x4::operator* ( const Matrix4x4 m2) const

Multiply "this" matrix on the right by "m2"

Parameters
m2the matrix to be multiplied by "this" matrix
Returns
the product: this*m2
Matrix4x4 cryph::Matrix4x4::operator*= ( const Matrix4x4 rhs)

Assign this = this*rhs

Parameters
rhsthe 4x4 matrix to be multiplied on the right of "this"
Returns
the updated matrix value
Matrix4x4 cryph::Matrix4x4::operator*= ( double  f)

Assign this = f*this. (That is, scale all elements of "this" matrix by "f".)

Parameters
fthe scale factor
Returns
the updated matrix value
Matrix4x4 cryph::Matrix4x4::operator+ ( const Matrix4x4 m2) const

Add "this" matrix to matrix "m2"

Parameters
m2the matrix to be added to "this" matrix
Returns
the sum: this + m2
Matrix4x4 cryph::Matrix4x4::operator+= ( const Matrix4x4 rhs)

Assign this = this + rhs

Parameters
rhsthe 4x4 matrix whose elements are to be added to "this"
Returns
the updated matrix value
Matrix4x4 cryph::Matrix4x4::operator- ( const Matrix4x4 m2) const

Subtract m2 from "this" matrix

Parameters
m2the matrix to be subtracted from "this" matrix
Returns
the difference: this - m2
Matrix4x4 cryph::Matrix4x4::operator= ( const Matrix4x4 rhs)

Assigns the matrix "rhs" to "this" matrix

Parameters
rhsthe matrix whose values are to be copied
Returns
the value assigned
Matrix4x4 cryph::Matrix4x4::orthogonal ( double  xmin,
double  xmax,
double  ymin,
double  ymax,
double  zmin,
double  zmax 
)
static

Factory method to create a 4x4 matrix that performs an orthogonal projection from an eye coordinate system into a logical device space (LDS) in which the x, y, and z limits are -1 .. +1. This will produce a left-handed LDS system as expected by OpenGL.

Parameters
xminthe minimum x eye coordinate of the desired field of view
xmaxthe maximum x eye coordinate of the desired field of view
yminthe minimum y eye coordinate of the desired field of view
ymaxthe maximum y eye coordinate of the desired field of view
zminthe minimum z eye coordinate of the desired field of view
zmaxthe maximum z eye coordinate of the desired field of view
Returns
the constructed 4x4 matrix
Matrix4x4 cryph::Matrix4x4::perspective ( double  zpp,
double  xmin,
double  xmax,
double  ymin,
double  ymax,
double  zmin,
double  zmax,
double  h = 0.0 
)
static

Factory method to create a 4x4 matrix that performs a perspective projection from an eye coordinate system into a logical device space (LDS) in which the x, y, and z limits are -1 .. +1. This will produce an orthogonal left-handed LDS system as expected by OpenGL.

Parameters
zppthe eye coordinate z value that specifies the location of the projection plane
xminthe minimum x eye coordinate of the desired field of view defined on the projection plane
xmaxthe maximum x eye coordinate of the desired field of view defined on the projection plane
yminthe minimum y eye coordinate of the desired field of view defined on the projection plane
ymaxthe maximum y eye coordinate of the desired field of view defined on the projection plane
zminthe minimum z eye coordinate of the desired field of view (must be negative)
zmaxthe maximum z eye coordinate of the desired field of view (must be negative AND strictly greater than zmin)
hthe signed half-distance between the left and right eye, if generating a matrix for a stereo display. If (h<0), this is for the left eye; if (h>0) this is for the right eye. To generate a single perspective matrix for a monoscopic view, use the default h==0.

NOTE: if a stereo pair is being created by generating two different MC to EC matrices, then a common perspective matrix should be used for both the left and right eye cumulative matrices, and h should be 0.

Returns
the constructed 4x4 matrix
Matrix4x4 cryph::Matrix4x4::scale ( double  sx,
double  sy,
double  sz 
)
static

Factory method to create a 4x4 matrix that performs a non-uniform scale transformation.

Parameters
sxthe scale factor along the x-axis
sythe scale factor along the y-axis
szthe scale factor along the z-axis
Returns
the constructed 4x4 matrix
void cryph::Matrix4x4::setElementAt ( int  r,
int  c,
double  newValue 
)

Set a specific element of the matrix

Parameters
rthe row containing the desired element
cthe column containing the desired element
newValuethe value to be placed into this[r][c]
See also
elementAt
Matrix3x3 cryph::Matrix4x4::subMatrix ( int  skipRow,
int  skipCol 
) const

Extract the 3x3 submatrix determined by removing row "skipRow" and column "skipCol".

Parameters
skipRowthe row to be removed
skipColthe column to be removed
Returns
the resulting 3x3 matrix
Matrix4x4 cryph::Matrix4x4::translation ( const AffVector trans)
static

Factory method to create a 4x4 matrix that performs a translation

Parameters
transthe desired translation vector
Returns
the constructed 4x4 matrix
Matrix4x4 cryph::Matrix4x4::translation ( double  dx,
double  dy,
double  dz 
)
static

Factory method to create a 4x4 matrix that performs a translation

Parameters
dxthe x component of the desired translation vector
dythe y component of the desired translation vector
dzthe z component of the desired translation vector
Returns
the constructed 4x4 matrix
Matrix4x4 cryph::Matrix4x4::xRotationDegrees ( double  angle)
static

Factory method to create a 4x4 matrix that performs a rotation about the x-axis.

Parameters
anglethe desired rotation angle in degrees
Returns
the constructed 4x4 matrix
Matrix4x4 cryph::Matrix4x4::xRotationRadians ( double  angle)
static

Factory method to create a 4x4 matrix that performs a rotation about the x-axis.

Parameters
anglethe desired rotation angle in radians
Returns
the constructed 4x4 matrix
Matrix4x4 cryph::Matrix4x4::yRotationDegrees ( double  angle)
static

Factory method to create a 4x4 matrix that performs a rotation about the y-axis.

Parameters
anglethe desired rotation angle in degrees
Returns
the constructed 4x4 matrix
Matrix4x4 cryph::Matrix4x4::yRotationRadians ( double  angle)
static

Factory method to create a 4x4 matrix that performs a rotation about the y-axis.

Parameters
anglethe desired rotation angle in radians
Returns
the constructed 4x4 matrix
Matrix4x4 cryph::Matrix4x4::zRotationDegrees ( double  angle)
static

Factory method to create a 4x4 matrix that performs a rotation about the z-axis.

Parameters
anglethe desired rotation angle in degrees
Returns
the constructed 4x4 matrix
Matrix4x4 cryph::Matrix4x4::zRotationRadians ( double  angle)
static

Factory method to create a 4x4 matrix that performs a rotation about the z-axis.

Parameters
anglethe desired rotation angle in radians
Returns
the constructed 4x4 matrix

Friends And Related Function Documentation

Matrix4x4 operator* ( double  f,
const Matrix4x4 m 
)
friend

Scale the given matrix by the given scale factor

Parameters
fthe scale factor
mthe matrix to scale (will not be modified)
Returns
the scaled matrix

Member Data Documentation

const Matrix4x4 cryph::Matrix4x4::IdentityMatrix
static
Initial value:
=
1.0 , 0.0 , 0.0 , 0.0 ,
0.0 , 1.0 , 0.0 , 0.0 ,
0.0 , 0.0 , 1.0 , 0.0 ,
0.0 , 0.0 , 0.0 , 1.0
)

the 4x4 identity matrix

const Matrix4x4 cryph::Matrix4x4::ZeroMatrix
static
Initial value:
=
0.0 , 0.0 , 0.0 , 0.0 ,
0.0 , 0.0 , 0.0 , 0.0 ,
0.0 , 0.0 , 0.0 , 0.0 ,
0.0 , 0.0 , 0.0 , 0.0
)

the 4x4 zero matrix


The documentation for this class was generated from the following files: