#include <revolution/mtx.h>
void C_MTXMultVecArray (
const Mtx m,
const Vec* srcBase,
Vec* dstBase,
u32 count );
void PSMTXMultVecArray (
const Mtx m,
const Vec* srcBase,
Vec* dstBase,
u32 count );
#define MTXMultVecArray C_MTXMultVecArray // for debug build
#define MTXMultVecArray PSMTXMultVecArray // for nondebug build
m |
Source matrix to multiply. m is not altered by this function. The type of m may be either Mtx or MtxPtr. |
|---|---|
| srcBase | Pointer to the first Vec type of the source vector array. The type of srcBase may be either VecPtr or Point3dPtr. |
| dstBase | Pointer to the first Vec type of the calculated vector array. The type of dstBase may be either VecPtr or Point3dPtr. |
| count | Number of contiguous array elements to multiply. Acceptable if srcBase=dstBase. However, the condition srcBase<dstBase<(srcBase+count- 1) must be avoided. |
None.
Pre-multiplies an array of count 3D vectors and a matrix. For multiplication purposes, each vector is treated as a 4-element column vector with an implied fourth w coordinate of 1.
For arrays of vectors, this function is more efficient than calling the MTXMultVec function in a loop as it saves the overhead of repeated function calls.
Note: Vectors are transformed one array element at a time through a single temporary vector, so it is acceptable if srcBase=dstBase. However, problems will result if the dstBase pointer is within the range (srcBase+count-1). In this case, resultant vectors will overwrite part of the srcBase array before it can be used as a source value.
During a debug build, MTXMultVecArray is parsed as C_MTXMultVecArray, which is a normal C language version. During a non-debug build for a Broadway processor, the paired-singles equivalent of this function, PSMTXMultVecArray, will be automatically substituted. You can also call C_MTXMultVecArray and PSMTXMultVecArray explicitly.
Mtx, MtxPtr, Point3d, Point3dPtr, Vec, VecPtr, MTXMultVec, MTXMultVecSR, MTXMultVecArraySR
2008/05/26 Corrected errors.
2006/03/01 Initial version.
CONFIDENTIAL