This object defines a RenderWare Matrix object.
The Matrix is heavily used throughout the API and a full range of functions are provided, including: rotation, multiplication, concatenation, scaling, translation, creation, destruction, stream read/write functions and a number of access functions to access particular vector data within the matrix.
RenderWare uses 4x3, row-major affine matrices.
|
enum RwOpCombineType This type represents a combination operator which can be applied to frames and matrices. The operator determines the order in which one object is combined with another |
|
RwEngineGetMatrixTolerances Returns current tolerances for matrix optimizations with RwMatrixOptimize
|
|
RwEngineSetMatrixTolerances Sets current tolerances for matrix optimizations with RwMatrixOptimize
|
|
RwMatrixChunkInfoRead extracts Chunk Info data from a RenderWare stream. The data is converted from its original format and inserted into an RwMatrixChunkInfo structure. A pointer to this structure is returned on success.
|
|
RwMatrixCopy is used to copy the contents of one matrix to another. Both matrices must exist or have been created using RwMatrixCreate before calling this function.
|
|
RwMatrixCreate creates a new transformation matrix initialized to the identity matrix. Note that the matrix must be destroyed when it is no longer required by an application.
|
|
RwMatrixDestroy is used to delete a transformation matrix previously created by the API function RwMatrixCreate matrix.
|
|
RwMatrixGetAt is used to retrieve the 'look-at' vector of the specified transformation matrix.
|
|
RwMatrixGetPos is used to retrieve the 'position' vector from the specified transformation matrix.
|
|
RwMatrixGetRight is used to retrieve the 'look-right' vector of the specified transformation matrix.
|
|
RwMatrixGetUp is used to retrieve the 'look-up' vector of the specified transformation matrix.
|
|
RwMatrixInvert performs a matrix inversion calculation on the input matrix. Note that the input and output arguments must not point to the same matrix.
|
|
RwMatrixMultiply multiplies two matrices in the order given.
|
|
RwMatrixOptimize informs the library that the application has changed the specified matrix and that the library should take note of the new matrix values. This is only necessary when the application directly modifies the matrix with RwMatrixGetRight, RwMatrixGetUp, RwMatrixGetAt or RwMatrixGetPos. This differs from RwMatrixUpdate in that extra work is undertaken to identify special properties of the matrix suitable for subsequent optimizations.
|
|
RwMatrixOrthoNormalize extracts the 'rigid-body' transformation component from a matrix. Whilst RenderWare supports arbitrary 4x3 affine matrices, many applications deal only in 'rigid-body' transformations comprising rotation and translation without scaling or shearing. The 4x3 matrix representing such a transformation has a special form of upper-left 3x3 sub-matrix known as an orthonormal matrix, characterized by its inverse being equal to its transpose. Mathematically, this sub-matrix remains orthonormal following any rigid-body transformation. Numerically, however, after extended matrix composition some scale or shear factors begin to accumulate due to rounding. To prevent the significant build-up of such factors, RwMatrixOrthoNormalize should be periodically applied to ensure the matrix keeps its orthonormal form. The minimal satisfactory frequency of orthonormalization will depend on the nature of the application. Typically, a frequency of once every 128 frames is adequate.
|
|
RwMatrixQueryRotate determines the rotation component from a matrix comprising only rotations and translations. The rotation is returned as a unit vector along the axis of rotation, an angle of rotation and a point on the axis which is the nearest to the origin (hence the line joining this point with the origin is perpendicular to the axis). The rotation component has two possible descriptions since a rotation about an axis of theta degrees is equivalent to a rotation about an axis pointing in the opposite direction by an angle of 360-theta in the reverse direction. The angle returned by RwMatrixQueryRotate is always between 0 and 180 degrees and the direction of the axis of rotation returned is chosen to ensure the angle is in this range.
|
|
RwMatrixRotate builds a rotation matrix from the given axis and angle of rotation and applies it to the specified matrix. The combine operation may be pre-concatenation, post-concatenation or replacement.
|
|
RwMatrixRotateOneMinusCosineSine builds a rotation matrix from the given axis and applies it to the specified matrix. The angle of rotation is supplied by giving values for 1-cos(theta) and sin(theta) where theta is the angle of rotation. This function should be used in preference to RwMatrixRotate, where possible, as it is substantially faster. The combine operation may be pre-concatenation, post-concatenation or replacement.
|
|
RwMatrixScale builds a scaling matrix from the given scale factors and applies it to the specified matrix in place. The combine operation may be pre-concatenation, post-concatenation or replacement.
|
|
RwMatrixSetFreeListCreateParams allows the developer to specify how many RwMatrix s to preallocate space for. Call before RwEngineInit.
|
|
RwMatrixSetIdentity is used to convert the specified matrix to the identity matrix.
|
|
RwMatrixStreamGetSize determines the size in bytes of the binary representation of the given matrix. This is used in the binary chunk header to indicate the size of the chunk.
|
|
RwMatrixStreamRead reads a matrix from a binary stream. If the matrix argument is NULL then a new matrix is created, otherwise the specified one is over-written.
RwStream *stream; RwMatrix *matrix; stream = RwStreamOpen(rwSTREAMFILENAME, rwSTREAMREAD, "mybinary.xxx"); if( stream ) { if( RwStreamFindChunk(stream, rwID_MATRIX, NULL, NULL) ) { matrix = RwMatrixStreamRead(stream, NULL); } RwStreamClose(stream, NULL); } The second parameter is useful if you have a matrix allocated on the stack so you could also do: RwStream *stream; RwMatrix matrix; stream = RwStreamOpen(rwSTREAMFILENAME, rwSTREAMREAD, "mybinary.xxx"); if( stream ) { if( RwStreamFindChunk(stream, rwID_MATRIX, NULL, NULL) ) { RwMatrixStreamRead(stream, &matrix); } RwStreamClose(stream, NULL); }
|
|
RwMatrixStreamWrite writes the specified matrix to a binary stream.
|
|
RwMatrixTransform calculates the result of applying a general transformation matrix to the given matrix. The combine operation may be pre-concatenation, post-concatenation or replacement. The two input matrices must not be the same.
|
|
RwMatrixTranslate builds a translation matrix from the given vector and applies it to the specified matrix. The combine operation may be pre-concatenation, post-concatenation or replacement.
|
|
RwMatrixUpdate informs the library that the application has changed the specified matrix and that the library should take note of the new matrix values. This is only necessary when the application directly modifies the matrix with RwMatrixGetRight, RwMatrixGetUp, RwMatrixGetAt or RwMatrixGetPos.
|
Converted from CHM to HTML with chm2web Pro 2.85 (unicode) |