Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

CSIBCMatrix4x4 Class Reference

Class representing matricies with 4 rows, and 4 columns. More...

#include <SIBCMatrix.h>

List of all members.

Public Methods


Detailed Description

Class representing matricies with 4 rows, and 4 columns.

CSIBCMatrix4x4 objects store values in column-major order (the form which C/C++ stores them). In fact, the data values for the matrix stored within the object are represented with a SI_Matrix, which is a typedef for a 4x4 C matrix (this is true except on the Playstation 2). Special optimizations for this class are made on the Playstation 2 to use the VU processor.

This class uses double precision floating point numbers to store element values. There exists three other matrix classes, CSIBCMatrix44d, CSIBCMatrix33d and CSIBCMatrixMNd. They are used to represent 4x4 matricies with double precision floating-point numbers, 3x3 matricies with double precision floating-point numbers, and MxN matricies with double precision floating-point numbers, respectively.


Constructor & Destructor Documentation

CSIBCMatrix4x4::CSIBCMatrix4x4  
 

Default constructor. Sets the matrix to the identity matrix.

CSIBCMatrix4x4::CSIBCMatrix4x4 const CSIBCMatrix4x4 &    i_Matrix
 

Copy constructor. Sets the matrix to be identical to the i_Matrix matrix.

Parameters:
i_Matrix  The matrix to copy values for the new matrix from.

CSIBCMatrix4x4::CSIBCMatrix4x4 SI_Float *    i_pMatrix
 

Constructor. Sets the matrix values to those contained in the i_pMatrix array. The array should be in column-major form. That is, [row][column] matches with i_pMatrix[column*4 + row].

Parameters:
i_pMatrix  Array of 16 SI_Float values in column-major form to set the new matrix to.
See also:
CSIBCMatrix4x4::Set(const SI_Float *)


Member Function Documentation

SI_Bool CSIBCMatrix4x4::AlignAxes CSIBCVector3D   x_vec,
CSIBCVector3D   xy_vec
 

Computes a rotation matrix where the x-axis is given by the vector x_vec, the y-axis lies in the plane defined by the x_vec and xy_vec vectors, and the z-axis is the cross-product between x_vec and xy_vec. This call replaces the current matrix.

Parameters:
x_vec  Pointer to the vector to use as the x-axis of the rotation matrix.
xy_vec  Pointer to the vector to define the plane (along with x_vec) in which the y-axis lies.
Returns:
SI_Bool TRUE if the rotation matrix was computed properly, this matrix contains the new rotation matrix. FALSE otherwise, this matrix contains the identity matrix.
See also:
CSIBCMatrix4x4::AlignRoll

SI_Bool CSIBCMatrix4x4::AlignRoll SI_Float    in_Roll,
CSIBCVector3D   in_pVector
 

Computes a rotation matrix which is pointing along the vector in_pVector, with a roll angle of in_Roll. This call replaces the current matrix.

Parameters:
in_Roll  The roll angle (in radians) for the rotation matrix.
in_pVector  Pointer to the vector defining the desired rotation of the new matrix.
Returns:
SI_Bool Always TRUE.
See also:
CSIBCMatrix4x4::AlignAxes

void CSIBCMatrix4x4::ColumnMajor SI_Float *    o_pMatrix
 

Copies the contents of this matrix into the 16 SI_Float array o_pMatrix in column major order. This method is equivalent in functionality to SIBCMatrix4x4::Get(SI_Float *).

Parameters:
o_pMatrix  Array of 16 SI_Float values to receive the contents of this matrix.
See also:
CSIBCMatrix4x4::Get(SI_Float *) , CSIBCMatrix4x4::Raw , CSIBCMatrix4x4::RowMajor

SI_Error CSIBCMatrix4x4::Dump  
 

Not implemented yet.

Returns:
SI_Error Always SI_SUCCESS.

SI_Float CSIBCMatrix4x4::Get const SI_Byte    i_Column,
const SI_Byte    i_Row
const
 

Gets the value at row i_Row and column i_Column.

Parameters:
i_Column  The column of the item to get.
i_Row  The row of the item to get.
Returns:
SI_Float The value of the item at the given index.
See also:
CSIBCMatrix4x4::Set(const SI_Byte, const SI_Byte, const SI_Float)

SI_Float CSIBCMatrix4x4::Get const SI_Byte    i_Index const
 

Gets the value at i_bIndex. The index is a column-major index of the item to get.

Parameters:
i_bIndex  The column-major index of the item to get.
Returns:
SI_Float The value of the item at the given index.
See also:
CSIBCMatrix4x4::Set(const SI_Byte, SI_Float)

SI_Error CSIBCMatrix4x4::Get CSIBCMatrix4x4 &    o_Matrix const
 

Retrives the entire matrix into another CSIBCMatrix4x4 object. The values inside o_mMatrix are overwritten with the values from this matrix.

Parameters:
o_mMatrix  Matrix to receive the values from this matrix.
Returns:
SI_Error Error code indicating success or failure of function.
    Possible returns:
  • SI_SUCCESS - The matrix was obtained successfully.
See also:
CSIBCMatrix4x4::operator=

SI_Error CSIBCMatrix4x4::Get SI_Float *    o_pMatrix const
 

Retrives the entire matrix into an array of 16 SI_Float values (in column-major order).

Parameters:
o_pMatrix  Allocated array of 16 SI_Float, to receive the matrix values.
Returns:
SI_Error Error code indicating success or failure of function.
    Possible returns:
  • SI_SUCCESS - The matrix was obtained successfully.
See also:
CSIBCMatrix4x4::Raw

SI_Bool CSIBCMatrix4x4::GetInverse CSIBCMatrix4x4 &    o_Matrix
 

Computes the inverse of this matrix, and stores it in o_mMatrix. The contents of o_mMatrix are overwritten in this process.

Parameters:
o_mMatrix  Receives the inverse of this matrix.
Returns:
SI_Bool TRUE if the inverse can be computed (o_mMatrix contains the inverse), FALSE otherwise (the contents of o_mMatrix are unchanged).

void CSIBCMatrix4x4::GetOrientation CSIBCVector3D   x_axis,
CSIBCVector3D   y_axis,
CSIBCVector3D   z_axis
const
 

Retrives the orientation axes for the rotation of this matrix.

Parameters:
x_axis  Receives the x-axis of the rotation for this matrix.
y_axis  Receives the y-axis of the rotation for this matrix.
z_axis  Receives the z-axis of the rotation for this matrix.
See also:
CSIBCMatrix4x4::SetOrientation , CSIBCMatrix4x4::GetRotation

void CSIBCMatrix4x4::GetRotation CSIBCVector3D   r const
 

Retrives the euler rotation angles for this matrix (as pitch-roll-yaw angles).

Parameters:
o_vRot  Vector to receive the euler rotation angles for this matrix.
See also:
CSIBCMatrix4x4::SetRotation( const CSIBCVector3D & )

void CSIBCMatrix4x4::GetScaling CSIBCVector3D   s const
 

Retrives the scaling components for this matrix in the X, Y and Z directions.

Parameters:
o_vScale  Vector to receive the scaling components for this matrix.
See also:
CSIBCMatrix4x4::SetScaling

SI_Matrix* CSIBCMatrix4x4::GetSIMatrix   [inline]
 

Returns a pointer to the SI_Matrix containing the data used internally by this matrix object. The pointer received from this function should not be freed, and modification to the values within directly modify this matrix object.

Returns:
SI_Matrix* Pointer to the SI_Matrix containing the values for this matrix object.

void CSIBCMatrix4x4::GetTransforms CSIBCVector3D   s,
CSIBCVector3D   r,
CSIBCVector3D   t
 

Retrives the scaling, rotation, and translation of the current matrix. This is equivalent to calling CSIBCMatrix4x4::GetScaling, CSIBCMatrix4x4::GetRotation and CSIBCMatrix4x4::GetTranslation, with the corresponding inputs.

Parameters:
scale  Receives the scaling of this matrix in the X, Y and Z directions.
rot  Receives the euler angle rotations of this matrix (in pitch-roll-yaw angles).
trans  Receives the translation of this matrix in the X, Y and Z directions.
See also:
CSIBCMatrix4x4::SetTransforms , CSIBCMatrix4x4::GetScaling , CSIBCMatrix4x4::GetRotation , CSIBCMatrix4x4::GetTranslation

void CSIBCMatrix4x4::GetTranslation CSIBCVector3D   t const
 

Retrives the translation for this matrix.

Parameters:
o_vTrans  Receives the translation in the X, Y and Z directions for this matrix.
See also:
CSIBCMatrix4x4::SetTranslation , CSIBCMatrix4x4::SetToTranslation

SI_Bool CSIBCMatrix4x4::IsIdentity  
 

Determines whether this matrix is the identity matrix.

Returns:
SI_Bool TRUE if the matrix is the identity matrix, FALSE otherwise.

void CSIBCMatrix4x4::LookAt const CSIBCVector3D   pos,
const CSIBCVector3D   target,
const CSIBCVector3D   up,
const SI_Float    roll
 

Computes the 'camera' positioning matrix, such that the camera is located at position pos, it pointing at target. The up vector of the camera is given by up, and the camera is rotated about the position-target vector an angle of roll counter-clockwise from the up vector. This call replaces the current matrix.

Parameters:
pos  The desired position of the camera, in world coordinates.
target  The desired interest point of the camera, in world coordinates.
up  The up vector of the camera.
roll  The counter-clockwise roll angle (in degrees) from the up vector about the position-target vector.

void CSIBCMatrix4x4::Multiply CSIBCVector3D   res,
const CSIBCVector3D   i_V
 

Computes the matrix-product between this matrix and the row vector i_vVector. The W value of the vector (to make the multiplication possible) is assumed to be 1.0f. The vector is right-multiplied by this matrix thus the operation is as follows: Vout = Vin * Mthis. Only the X, Y and Z values of the resultant vector are given in the result i_vResult.

Parameters:
i_vVector  Row vector to multiply with this matrix.
i_vResult  Resultant vector from the multiplication.
See also:
CSIBCMatrix4x4::MultiplyLeft , CSIBCMatrix4x4::Multiply(const CSIBCVector2D&) , CSIBCMatrix4x4::Multiply(const CSIBCVector3D&) , CSIBCMatrix4x4::Multiply(const CSIBCVector4D&)

CSIBCVector4D CSIBCMatrix4x4::Multiply const CSIBCVector4D   i_V
 

Computes the matrix-product between this matrix and the row vector i_vVector. The vector is right-multiplied by this matrix thus the operation is as follows: Vout = Vin * Mthis.

Parameters:
i_vVector  Row vector to multiply with this matrix.
Returns:
CSIBCVector4D Resultant vector from the multiplication.
See also:
CSIBCMatrix4x4::Multiply(const CSIBCVector2D&) , CSIBCMatrix4x4::Multiply(const CSIBCVector3D&) , CSIBCMatrix4x4::operator *(CSIBCVector4D &)

CSIBCVector4D CSIBCMatrix4x4::Multiply const CSIBCVector3D   i_V
 

Computes the matrix-product between this matrix and the row vector i_vVector. The W value of the vector (to make the multiplication possible) is assumed to be 1.0f. The vector is right-multiplied by this matrix thus the operation is as follows: Vout = Vin * Mthis.

Parameters:
i_vVector  Row vector to multiply with this matrix.
Returns:
CSIBCVector4D Resultant vector from the multiplication.
See also:
CSIBCMatrix4x4::Multiply(const CSIBCVector2D&) , CSIBCMatrix4x4::Multiply(const CSIBCVector4D&) , CSIBCMatrix4x4::Multiply(CSIBCVector3D&, const CSIBCVector3D&) , CSIBCMatrix4x4::MultiplyLeft , CSIBCMatrix4x4::operator *(CSIBCVector3D &)

CSIBCVector4D CSIBCMatrix4x4::Multiply const CSIBCVector2D   i_V const
 

Computes the matrix-product between this matrix and the row vector i_vVector. The Z and W values of the vector (to make the multiplication possible) are assumed to be 0.0f and 1.0f, respectively. The vector is right-multiplied by this matrix, thus the operation is as follows: Vout = Vin * Mthis.

Parameters:
i_vVector  Row vector to multiply with this matrix.
Returns:
CSIBCVector4D Resultant vector from the multiplication.
See also:
CSIBCMatrix4x4::Multiply(const CSIBCVector3D&) , CSIBCMatrix4x4::Multiply(const CSIBCVector4D&) , CSIBCMatrix4x4::operator *(CSIBCVector2D &)

SI_Error CSIBCMatrix4x4::Multiply CSIBCMatrix4x4 &    i_Matrix,
CSIBCMatrix4x4 &    result
 

Computes the matrix-product between this matrix and i_mMatrix. This matrix is right-multiplied by the input matrix, thus the operation is as follows: Mout = Mthis * Minput.

Parameters:
i_mMatrix  The matrix to multiply this matrix by.
result  Reference to the matrix to store the multiplication results.
Returns:
SI_Error Error code indicating success or failure of function.
    Possible returns:
  • SI_SUCCESS - The matrix was multiplied successfully.
See also:
CSIBCMatrix4x4::Multiply(CSIBCMatrix4x4&) , CSIBCMatrix4x4::operator *(CSIBCMatrix4x4 &)

CSIBCMatrix4x4 & CSIBCMatrix4x4::Multiply CSIBCMatrix4x4 &    i_Matrix
 

Replaces this matrix with the matrix-product between this matrix and i_mMatrix. This matrix is right-multiplied by the input matrix, thus the operation is as follows: Mthis' = Mthis * Minput.

Parameters:
i_mMatrix  The matrix to multiply this matrix by.
Returns:
CSIBCMatrix4x4& Reference to this matrix.
See also:
CSIBCMatrix4x4::Multiply(CSIBCMatrix4x4&, CSIBCMatrix4x4&) , CSIBCMatrix4x4::operator *(CSIBCMatrix4x4 &)

SI_Error CSIBCMatrix4x4::Multiply4x3 const CSIBCMatrix4x4 &    i_Matrix,
CSIBCMatrix4x4 &    result
const
 

Computes the matrix-product between this matrix and i_mMatrix. The last column of the matrix is not computed, and is set to (0,0,0,1). This matrix is right-multiplied by the input matrix, thus the operation is as follows: Mout = Mthis * Minput.

Parameters:
i_mMatrix  The matrix to multiply this matrix by.
result  Reference to the matrix to store the multiplication results.
Returns:
SI_Error Error code indicating success or failure of function.
    Possible returns:
  • SI_SUCCESS - The matrix was multiplied successfully.
See also:
CSIBCMatrix4x4::Multiply4x3(const CSIBCMatrix4x4&) , CSIBCMatrix4x4::Multiply(CSIBCMatrix4x4 &)

CSIBCMatrix4x4 & CSIBCMatrix4x4::Multiply4x3 const CSIBCMatrix4x4 &    i_Matrix
 

Replaces this matrix with the matrix-product between this matrix and i_mMatrix. The last column of the matrix is not computed, and is set to (0,0,0,1). This matrix is right-multiplied by the input matrix, thus the operation is as follows: Mthis' = Mthis * Minput.

Parameters:
i_mMatrix  The matrix to multiply this matrix by.
Returns:
CSIBCMatrix4x4& Reference to this matrix.
See also:
CSIBCMatrix4x4::Multiply4x3(const CSIBCMatrix4x4&, CSIBCMatrix4x4&) , CSIBCMatrix4x4::Multiply(CSIBCMatrix4x4 &)

void CSIBCMatrix4x4::MultiplyLeft CSIBCVector3D   res,
const CSIBCVector3D   vec
const
 

Computes the matrix-product between this matrix and the column vector i_vVector. The W value of the vector (to make the multiplication possible) is assumed to be 1.0f. The vector is left-multiplied by this matrix thus the operation is as follows: Vout = Mthis * Vin. Only the X, Y and Z values of the resultant vector are given in the result i_vResult.

Parameters:
i_vVector  Row vector to multiply with this matrix.
i_vResult  Resultant vector from the multiplication.
See also:
CSIBCMatrix4x4::Multiply(CSIBCVector3D&, const CSIBCVector3D&) , CSIBCMatrix4x4::Multiply(const CSIBCVector2D&) , CSIBCMatrix4x4::Multiply(const CSIBCVector3D&) , CSIBCMatrix4x4::Multiply(const CSIBCVector4D&)

CSIBCMatrix4x4 & CSIBCMatrix4x4::Normalize  
 

Not implemented.

Returns:
CSIBCMatrix4x4& Reference to this matrix.

CSIBCVector4D CSIBCMatrix4x4::operator * CSIBCVector4D   i_V
 

Computes the matrix-product between this matrix and the row vector i_vVector. The vector is right-multiplied by this matrix thus the operation is as follows: Vout = Vin * Mthis.

Parameters:
i_vVector  Row vector to multiply with this matrix.
Returns:
CSIBCVector4D Resultant vector from the multiplication.
See also:
CSIBCMatrix4x4::Multiply(const CSIBCVector2D&) , CSIBCMatrix4x4::Multiply(const CSIBCVector3D&) , CSIBCMatrix4x4::Multiply(const CSIBCVector4D&) , CSIBCMatrix4x4::operator *(CSIBCVector4D &)

CSIBCVector4D CSIBCMatrix4x4::operator * CSIBCVector3D   i_V
 

Computes the matrix-product between this matrix and the row vector i_vVector. The W value of the vector (to make the multiplication possible) is assumed to be 1.0f. The vector is right-multiplied by this matrix thus the operation is as follows: Vout = Vin * Mthis.

Parameters:
i_vVector  Row vector to multiply with this matrix.
Returns:
CSIBCVector4D Resultant vector from the multiplication.
See also:
CSIBCMatrix4x4::Multiply(const CSIBCVector2D&) , CSIBCMatrix4x4::Multiply(const CSIBCVector3D&) , CSIBCMatrix4x4::Multiply(const CSIBCVector4D&) , CSIBCMatrix4x4::Multiply(CSIBCVector3D&, const CSIBCVector3D&) , CSIBCMatrix4x4::MultiplyLeft

CSIBCVector4D CSIBCMatrix4x4::operator * CSIBCVector2D   i_V
 

Computes the matrix-product between this matrix and the row vector i_vVector. The Z and W values of the vector (to make the multiplication possible) are assumed to be 0.0f and 1.0f, respectively. The vector is right-multiplied by this matrix, thus the operation is as follows: Vout = Vin * Mthis.

Parameters:
i_vVector  Row vector to multiply with this matrix.
Returns:
CSIBCVector4D Resultant vector from the multiplication.
See also:
CSIBCMatrix4x4::Multiply(const CSIBCVector2D&) , CSIBCMatrix4x4::Multiply(const CSIBCVector3D&) , CSIBCMatrix4x4::Multiply(const CSIBCVector4D&)

CSIBCMatrix4x4 CSIBCMatrix4x4::operator * CSIBCMatrix4x4 &    i_Matrix
 

Computes the matrix-product between this matrix and i_mMatrix. This matrix is right-multiplied by the input matrix, thus the operation is as follows: Mout = Mthis * Minput.

Parameters:
i_mMatrix  The matrix to multiply this matrix by.
Returns:
CSIBCMatrix4x4 Resultant of matrix multiplication.
See also:
CSIBCMatrix4x4::Multiply(CSIBCMatrix4x4&, CSIBCMatrix4x4&) , CSIBCMatrix4x4::Multiply(CSIBCMatrix4x4&)

CSIBCMatrix4x4 & CSIBCMatrix4x4::operator+= const CSIBCMatrix4x4 &    i_Matrix
 

Adds this matrix and i_mMatrix and stores the result in this matrix.

Parameters:
i_mMatrix  Matrix to add this matrix to.
Returns:
CSIBCMatrix4x4& Reference to this matrix.
See also:
CSIBCMatrix4x4::operator= , CSIBCMatrix4x4::Multiply

CSIBCMatrix4x4 & CSIBCMatrix4x4::operator= const CSIBCMatrix4x4 &    i_Matrix
 

Assigns the values in i_mMatrix to this matrix.

Parameters:
i_mMatrix  Matrix to copy data from.
Returns:
CSIBCMatrix4x4& Reference to this matrix.
See also:
CSIBCMatrix4x4::Set , CSIBCMatrix4x4::operator+=

void CSIBCMatrix4x4::Ortho const SI_Float    left,
const SI_Float    right,
const SI_Float    top,
const SI_Float    bottom,
const SI_Float    nearPlane,
const SI_Float    farPlane
 

Computes an orthogonal projection matrix. This call replaces the current matrix.

Parameters:
left  The left boundary of the viewing plane.
right  The right boundary of the viewing plane.
top  The top boundary of the viewing plane.
bottom  The bottom boundary of the viewing plane.
nearPlane  The distance of the near clipping plane from the viewing position.
farPlane  The distance of the far clipping plane from the viewing position.
See also:
CSIBCMatrix4x4::Perspective , CSIBCMatrix4x4::PerspectiveAlt

void CSIBCMatrix4x4::Perspective const SI_Float    nearPlane,
const SI_Float    farPlane,
const SI_Float    fov,
const SI_Float    aspect
 

Computes a perspective projection matrix. This call produces a perspective projection matrix compatible with OpenGL projection matricies. To produce a matrix that it compatible with Direct3D, use CSIBCMatrix4x4::PerspectiveAlt. This call replaces the current matrix.

Parameters:
nearPlane  The distance of the near clipping plane from the viewing position.
farPlane  The distance of the far clipping plane from the viewing position.
fov  The half field-of-view angle in radians. The actual view angle is double this value.
aspect  The aspect ratio (width/height) for the perspective matrix.
See also:
CSIBCMatrix4x4::PerspectiveAlt , CSIBCMatrix4x4::Ortho

void CSIBCMatrix4x4::PerspectiveAlt const SI_Float    nearPlane,
const SI_Float    farPlane,
const SI_Float    fov,
const SI_Float    aspect
 

Computes a perspective projection matrix. This call produces a perspective projection matrix compatible with Direct3D projection matricies. To produce a matrix that it compatible with OpenGL, use CSIBCMatrix4x4::Perspective. This call replaces the current matrix.

Parameters:
nearPlane  The distance of the near clipping plane from the viewing position.
farPlane  The distance of the far clipping plane from the viewing position.
fov  The half field-of-view angle in radians. The actual view angle is double this value.
aspect  The aspect ratio (width/height) for the perspective matrix.
See also:
CSIBCMatrix4x4::Perspective , CSIBCMatrix4x4::Ortho

SI_Float * CSIBCMatrix4x4::Raw  
 

Returns a pointer to the raw data of the matrix (16 SI_Float values in column major order). The pointer received from this function should not be freed, and modification to the values in the array directly modify this matrix object.

Returns:
SI_Float* Array of 16 SI_Float values containing the contents of this matrix.
See also:
CSIBCMatrix4x4::GetSIMatrix , CSIBCMatrix4x4::ColumnMajor , CSIBCMatrix4x4::Get(SI_Float *)

void CSIBCMatrix4x4::RowMajor SI_Float *    o_pMatrix
 

Copies the contents of this matrix into the 16 SI_Float array o_pMatrix in row major order.

Parameters:
o_pMatrix  Array of 16 SI_Float values to receive the contents of this matrix.
See also:
CSIBCMatrix4x4::ColumnMajor

SI_Error CSIBCMatrix4x4::SelfTest  
 

Not implemented yet.

Returns:
SI_Error Always SI_SUCCESS.

SI_Error CSIBCMatrix4x4::Set const SI_Byte    i_Column,
const SI_Byte    i_Row,
const SI_Float    i_Value
 

Sets the value at row i_Row and column i_Column to i_fValue.

Parameters:
i_Column  The column of the item to set.
i_Row  The row of the item to set.
i_fValue  The value to set the element to.
Returns:
SI_Error Error code indicating the success or failure of this command.
    Possible returns:
  • SI_SUCCESS - The matrix was set properly.
See also:
CSIBCMatrix4x4::Set(const SI_Byte, SI_Float) , CSIBCMatrix4x4::Get(const SI_Byte, const SI_Byte)

SI_Error CSIBCMatrix4x4::Set const SI_Byte    i_Index,
SI_Float    i_Value
 

Sets the value at i_bIndex to i_fValue. The index is a column-major index of the item to set.

Parameters:
i_bIndex  The column-major index of the item to set.
i_fValue  The value to set the element to.
Returns:
SI_Error Error code indicating the success or failure of this command.
    Possible returns:
  • SI_SUCCESS - The matrix was set properly.
See also:
CSIBCMatrix4x4::Set(const SI_Byte, const SI_Byte, SI_Float) , CSIBCMatrix4x4::Get(const SI_Byte)

SI_Error CSIBCMatrix4x4::Set const SI_Float *    i_pMatrix
 

Sets the matrix values to those contained in the i_pMatrix array. The array should be in column-major form. That is, [row][column] matches with i_pMatrix[column*4 + row].

Parameters:
i_pMatrix  Array of 16 SI_Float values in column-major form to set the matrix to.
Returns:
SI_Error Error code indicating the success or failure of this command.
    Possible returns:
  • SI_SUCCESS - The matrix was set properly.
Example:
                        SIBCMatrix4x4 * t_mMyMatrix = new SIBCMatrix(); // set to identity

                        // Assume that OpenGL is up and running, and get the GL_MODELVIEW matrix.
                        GLfloat         t_fModelView[16];
                        glGetFloatv(GL_MODELVIEW_MATRIX, t_fModelView);

                        // It is stored in column-major form, so we can now set our matrix to the GL_MODELVIEW matrix.
                        t_mMyMatrix->Set((SI_Float *)t_fModelView);

                        // Same with Direct3D. Assume we have it up and running, and now set our matrix 
                        // to the D3DTS_VIEW matrix (v8.1).
                        D3DXMATRIX      t_mView;
                        m_pDevice->GetTransform(D3DTS_VIEW, &t_mView);
                        t_mMyMatrix->Set((SI_Float *)t_mView);

See also:
CSIBCMatrix4x4::CSIBCMatrix4x4(const SI_Float *)

SI_Error CSIBCMatrix4x4::Set const CSIBCMatrix4x4 &    i_Matrix
 

Sets the values in this matrix to the values in the i_Matrix matrix.

Parameters:
i_Matrix  The matrix to set this matrix's values to.
Returns:
SI_Error Error code indicating the success or failure of this command.
    Possible returns:
  • SI_SUCCESS - The matrix was set properly.

CSIBCMatrix4x4 & CSIBCMatrix4x4::SetIdentity  
 

Sets the matrix to the identity matrix.

Returns:
Reference to this matrix.
See also:
CSIBCMatrix4x4::IsIdentity , CSIBCMatrix4x4::SetNull

CSIBCMatrix4x4 & CSIBCMatrix4x4::SetNull  
 

Sets each value in the matrix to zero.

Returns:
Reference to this matrix.
See also:
CSIBCMatrix4x4::SetIdentity

void CSIBCMatrix4x4::SetOrientation const CSIBCVector3D   x_axis,
const CSIBCVector3D   y_axis,
const CSIBCVector3D   z_axis
 

Sets the rotation in the matrix to the rotation defined by the three axes given by the parameters x_axis, y_axis and z_axis. The scaling and translation of the matrix are kept constant. This function is similar in functionality to CSIBCMatrix4x4::SetRotation, with different parameters, and is more efficient than CSIBCMatrix4x4::SetRotation( const CSIBCVector3D &).

Parameters:
x_axis  Normalized vector to use as the x-axis of the desired rotation.
y_axis  Normalized vector to use as the y-axis of the desired rotation.
y_axis  Normalized vector to use as the z-axis of the desired rotation.
See also:
CSIBCMatrix4x4::GetOrientation , CSIBCMatrix4x4::GetRotation , CSIBCMatrix4x4::SetRotation , CSIBCMatrix4x4::SetToRotation

void CSIBCMatrix4x4::SetRotation const CSIBCMatrix4x4 &    i_Mat
 

Sets the rotation in the matrix to the rotation given by the rotation matrixin i_mMatrix. The scaling and transformation of the matrix are kept constant. This function is more efficient than its counterpart, CSIBCMatrix4x4::SetRotation( const CSIBCVector3D &), if a rotation matrix has already been computed.

Parameters:
i_mMatrix  Rotation matrix containing the desired rotation for this matrix.
See also:
CSIBCMatrix4x4::SetRotation( const CSIBCVector3D &) , CSIBCMatrix4x4::SetToRotation , CSIBCMatrix4x4::GetRotation

void CSIBCMatrix4x4::SetRotation const CSIBCVector3D   i_Angles
 

Sets the rotation in the matrix to the euler rotation given by the angles in i_vRot (as pitch-roll-yaw). The scaling and transformation of the matrix are kept constant. For more efficiency, if a rotation matrix has already been computed, use CSIBCMatrix4x4::SetRotation( const CSIBCMatrix4x4 &).

Parameters:
i_vRot  The euler rotation angles to set the rotation of this matrix to (as pitch-roll-yaw angles).
Example:
                        CSIBCMatrix4x4          t_mMatrix;
                        CSIBCVector3D           t_vTrans, t_vScale, t_vRot;
                        CSIBCVector3D           t_vTrans2, t_vScale2, t_vRot2;
                        
                        // Set the components of the matrix.
                        t_vTrans = CSIBCVector3D(1.5f, 2.5f, 0.25f);
                        t_vScale = CSIBCVector3D(500.0f, 0.01f, 500.0f);
                        t_vRot   = CSIBCVector3D(M_PI_4, M_PI_4, M_PI_4);
                        t_mMatrix.SetTransforms(t_vScale, t_vRot, t_vTrans);

                        // Now set the rotation to a different value..
                        t_vRot = CSIBCVector3D(M_PI, M_PI_4, M_PI);
                        t_mMatrix.SetRotation(t_vRot);

                        // Notice that the scaling and translation components are the same.
                        t_mMatrix.GetTransforms(t_vScale2, t_vRot2, t_vTrans2);
                        printf("t_vScale == t_vScale2 = %s\n", (t_vScale == t_vScale2) ? "TRUE", "FALSE);
                        printf("t_vRot == t_vRot2 = %s\n", (t_vRot == t_vRot2) ? "TRUE", "FALSE);
                        printf("t_vTrans == t_vTrans2 = %s\n", (t_vTrans == t_vTrans2) ? "TRUE", "FALSE);

See also:
CSIBCMatrix4x4::SetRotation(const CSIBCMatrix4x4 &) , CSIBCMatrix4x4::GetRotation , CSIBCMatrix4x4::GetTransforms , CSIBCMatrix4x4::SetToRotation

void CSIBCMatrix4x4::SetScaling const CSIBCVector3D   i_Scaling
 

Sets the scaling factor in X, Y and Z directions, using the values from the corresponding components in the i_vScaling vector. This function first normalizes the scaling of the current matrix, and then scales the matrix by the given amount.

Parameters:
i_vScaling  Vector representing the desired scaling in X, Y and Z.
Example:
                        CSIBCMatrix4x4          t_mMatrix1, t_mMatrix2;
                        CSIBCVector3D           t_vScaling;
                        
                        // Create two identical scaling matricies.
                        t_vScaling = CSIBCVector3D(5.0f, 10.0f, 0.5f);
                        t_mMatrix1.SetToScale(t_vScaling);
                        t_mMatrix2.SetToScale(t_vScaling);

                        // Now use SetScaling on one, with the same scale vector.
                        t_mMatrix1.SetScaling(t_vScaling);

                        // Notice that t_mMatrix1 == t_mMatrix2, because SetScaling normalizes scaling.

See also:
CSIBCMatrix4x4::SetToScale , CSIBCMatrix4x4::GetScaling

void CSIBCMatrix4x4::SetToRotation const SI_Float    angl,
const CSIBCVector3D   axis
 

Sets this matrix to a rotation matrix, determined by a counter-clockwise rotation of angl radians, about an axis axis. This function replaces the current matrix.

Parameters:
angl  The angle of counter-clockwise rotation (in radians) about the axis.
axis  The vector representing the axis in which to rotate about.

void CSIBCMatrix4x4::SetToRotation const CSIBCVector3D   rot
 

Sets this matrix to a rotation matrix, determined by the euler angles supplied in i_vEuler vector. The euler angle convention used is the "xyz" convention (better known as the pitch-roll-yaw angles). This function replaces the current matrix.

Parameters:
i_vEuler  The euler angles to compute the values for this matrix. X is 'pitch', Y is 'roll' and Z is 'yaw'.
See also:
CSIBCMatrix4x4::SetRotation , CSIBCMatrix4x4::GetRotation , CSIBCMatrix4x4::SetTransforms

void CSIBCMatrix4x4::SetToScale const CSIBCVector3D   scl
 

Sets this matrix to a scaling matrix, whose X, Y and Z values are obtained from the X, Y and Z components of the i_vScale vector. This function replaces the current matrix.

Parameters:
i_vScale  The vector containing the X, Y and Z scaling factors for the matrix.
See also:
CSIBCMatrix4x4::GetScaling , CSIBCMatrix4x4::SetScaling , CSIBCMatrix4x4::SetTransforms

void CSIBCMatrix4x4::SetToTranslation const CSIBCVector3D   t
 

Sets this matrix to a translation matrix, determined by the vector i_vTrans, containing the amount of translation in each axis. This function replaces the current matrix.

Parameters:
i_vTrans  Vector containing translations.

void CSIBCMatrix4x4::SetTransforms const CSIBCVector3D   scl,
const CSIBCVector3D   rot,
const CSIBCVector3D   trs
 

Sets this matrix with euler rotation, scale, and translation transformations produced from the rot, scale, and trans vectors respectively. This function sets the current matrix to a rotation matrix with the rot parameter (equivalent to what gets produced from CSIBCMatrix4x4::SetToRotation), then applies a scaling to the matrix, and then applies the transformation. However, it is not the equivalent of matrix multiplication, the translation is not scaled. This function replaces the current matrix.

Parameters:
scale  Vector representing the scaling in the X, Y and Z directions.
rot  Vector representing the euler rotation angles (pitch, roll, yaw).
trans  Vector representing the translations in the X, Y and Z directions.
Example:
                        CSIBCMatrix4x4  t_mMatrix1, t_mMatrix2, t_mMatrix3, t_mMatrixProd, t_mMatrixTransforms;
                        CSIBCVector3D   t_vScale, t_vRot, t_vTrans;

                        t_vScale        = CSIBCVector3D(2.0f, 4.0f, 1.0f);                      // scale 2x in X, 4x in Y, and 1x in Z.
                        t_vRot          = CSIBCVector3D(M_PI_4, M_PI_4, M_PI_4);        // pitch and roll of 45deg, 180deg heading.
                        t_vTrans        = CSIBCVector3D(10.0f, -10.0f, 5.0f);           // translation of 10.0f, -10.0f, 5.0f in X, Y, Z respectively.

                        // Do the 'SetTo...' command for each of three transformation types, and multiply the results.
                        t_mMatrix1.SetToRotation(t_vRot);
                        t_mMatrix2.SetToScale(t_vScale);
                        t_mMatrix3.SetToTranslation(t_vTrans);
                        t_mMatrixProd = t_mMatrix1 * t_mMatrix2 * t_mMatrix3;

                        // Now do the 'all-in-one' on another matrix, using the same inputs.
                        t_mMatrixTransforms.SetTransforms(t_vScale, t_vRot, t_vTrans);

                        // Notice that these matricies are not equal

See also:
CSIBCMatrix4x4::SetToRotation , CSIBCMatrix4x4::SetToScale , CSIBCMatrix4x4::SetToTranslation

void CSIBCMatrix4x4::SetTranslation const CSIBCVector3D   trs
 

Set the translation in the matrix to the translation in the X, Y and Z directions given by the components of the vector i_vTrans. The scaling and rotation of the matrix is kept constant.

Parameters:
i_vTrans  The vector representing the desired translation in the X, Y and Z directions.
See also:
CSIBCMatrix4x4::GetTranslation , CSIBCMatrix4x4::SetToTranslation

CSIBCMatrix4x4 & CSIBCMatrix4x4::Transpose  
 

Sets this matrix to be the its transpose matrix.

Returns:
Reference to this matrix.


The documentation for this class was generated from the following files: © Copyright 2001-2003 Avid Technology, Inc. All rights reserved.

© Copyright 2001-2003 Avid Technology, Inc. All rights reserved.