#include <SIBCMatrix.h>
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.
|
Default constructor. Sets the matrix to the identity matrix. |
|
Copy constructor. Sets the matrix to be identical to the
|
|
Constructor. Sets the matrix values to those contained in the
|
|
Computes a rotation matrix where the x-axis is given by the vector
|
|
Computes a rotation matrix which is pointing along the vector
|
|
Copies the contents of this matrix into the 16 SI_Float array
|
|
Not implemented yet.
|
|
Gets the value at row
|
|
Gets the value at
|
|
Retrives the entire matrix into another CSIBCMatrix4x4 object. The values inside
|
|
Retrives the entire matrix into an array of 16 SI_Float values (in column-major order).
|
|
Computes the inverse of this matrix, and stores it in
|
|
Retrives the orientation axes for the rotation of this matrix.
|
|
Retrives the euler rotation angles for this matrix (as pitch-roll-yaw angles).
|
|
Retrives the scaling components for this matrix in the X, Y and Z directions.
|
|
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.
|
|
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.
|
|
Retrives the translation for this matrix.
|
|
Determines whether this matrix is the identity matrix.
|
|
Computes the 'camera' positioning matrix, such that the camera is located at position
|
|
Computes the matrix-product between this matrix and the row vector
|
|
Computes the matrix-product between this matrix and the row vector
|
|
Computes the matrix-product between this matrix and the row vector
|
|
Computes the matrix-product between this matrix and the row vector
|
|
Computes the matrix-product between this matrix and
|
|
Replaces this matrix with the matrix-product between this matrix and
|
|
Computes the matrix-product between this matrix and
|
|
Replaces this matrix with the matrix-product between this matrix and
|
|
Computes the matrix-product between this matrix and the column vector
|
|
Not implemented.
|
|
Computes the matrix-product between this matrix and the row vector
|
|
Computes the matrix-product between this matrix and the row vector
|
|
Computes the matrix-product between this matrix and the row vector
|
|
Computes the matrix-product between this matrix and
|
|
Adds this matrix and
|
|
Assigns the values in
|
|
Computes an orthogonal projection matrix. This call replaces the current matrix.
|
|
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.
|
|
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.
|
|
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.
|
|
Copies the contents of this matrix into the 16 SI_Float array
|
|
Not implemented yet.
|
|
Sets the value at row
|
|
Sets the value at
|
|
Sets the matrix values to those contained in the
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);
|
|
Sets the values in this matrix to the values in the
|
|
Sets the matrix to the identity matrix.
|
|
Sets each value in the matrix to zero.
|
|
Sets the rotation in the matrix to the rotation defined by the three axes given by the parameters
|
|
Sets the rotation in the matrix to the rotation given by the rotation matrixin
|
|
Sets the rotation in the matrix to the euler rotation given by the angles in
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);
|
|
Sets the scaling factor in X, Y and Z directions, using the values from the corresponding components in the
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.
|
|
Sets this matrix to a rotation matrix, determined by a counter-clockwise rotation of
|
|
Sets this matrix to a rotation matrix, determined by the euler angles supplied in
|
|
Sets this matrix to a scaling matrix, whose X, Y and Z values are obtained from the X, Y and Z components of the
|
|
Sets this matrix to a translation matrix, determined by the vector
|
|
Sets this matrix with euler rotation, scale, and translation transformations produced from the
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
|
|
Set the translation in the matrix to the translation in the X, Y and Z directions given by the components of the vector
|
|
Sets this matrix to be the its transpose matrix.
|
© Copyright 2001-2003 Avid Technology, Inc. All rights reserved.