Ninja Library - Matrix Function

njCalcVector

Performs matrix conversion for an arbitrary vector

FORMAT

void njCalcVector( *m, *vs, *vd )
NJS_MATRIX *m
NJS_VECTOR *vs
NJS_VECTOR *vd

PARAMETER

 *m  Calculation matrix 
 *vs  Arbitrary vector 
 *vd  Vector after conversion 

RETURN

None

DESCRIPTION

Performs matrix conversion for arbitrary vector vs, then stores the vector resulting from conversion in vd. When parameter m is NULL, the current matrix is taken as the calculation matrix.

EXAMPLE

The following rotates vector vs(100, 0, 0) by 45 degrees around the Y axis.
NJS_MATRIX m;
NJS_VECTOR vs, vd;
vs.x = 100.f;
vs.y = 0.f;
vs.z = 0.f;
njUnitMatrix(&m);
njRotateY(&m, NJM_DEG_ANG(45));
njCalcVector(&m, &vs, &vd);
% Result %
vd(70.710701, 00,000000, -70.710701)

NOTE

When the flag for the njInitMatrix() function is set to "1", the processing result is converted into the unit vector. Results carried out with a matrix that inherited the base matrix are returned not as Ninja coordinates but as hardware coordinates.

REFERENCE

njInitMatrix()

njCalcVector
COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999