#include <xmatrix.h>
Inheritance diagram for XMatrix:
Public Member Functions | |
XMatrix () | |
Default initialisation - sets up the identity matrix. | |
XMatrix (const FIXED16 &, const FIXED16 &) | |
Default initialisation - sets up the scale matrix. | |
XMatrix (const ANGLE &theta) | |
Default initialisation - sets up the rotation matrix. | |
XMatrix (const WorkCoord &) | |
Default initialisation - Sets up a translate matrix. | |
XMatrix (const XLONG x, const XLONG y) | |
Default initialisation - Sets up a translate matrix. | |
XMatrix (const INT32 x, const INT32 y) | |
XMatrix (const Matrix &) | |
Default initialisation - copies elements from 32- to 64-bit matrix. | |
XMatrix (const FIXED16 &ca, const FIXED16 &cb, const FIXED16 &cc, const FIXED16 &cd, const XLONG ce, const XLONG cf) | |
Initialise a whole XMatrix. | |
void | transform (WorkCoord *) |
Transforms a single point. | |
void | transform (WorkCoord[], UINT32 count) |
Transforms a list of points. | |
void | transform (WorkCoord[], const WorkCoord[], UINT32) |
Transforms a list of points. | |
XMatrix & | operator= (const XMatrix &) |
Matrix assignment. | |
XMatrix & | operator *= (const XMatrix &) |
Overloads the *= operator for Matrices. | |
Private Attributes | |
FIXED16 | a |
FIXED16 | b |
FIXED16 | c |
FIXED16 | d |
XLONG | e |
XLONG | f |
Friends | |
class | OSRenderRegion |
XMatrix | operator * (const XMatrix &, const XMatrix &) |
Matrix multiplication. Cannot be used in a nested form as the result is contained in a static local (e.g. a = (b*c)*(d*e) will fail). |
Definition at line 124 of file xmatrix.h.
|
Default initialisation - sets up the identity matrix.
Definition at line 136 of file xmatrix.cpp. 00137 { 00138 a = (FIXED16) 1; 00139 b = (FIXED16) 0; 00140 c = (FIXED16) 0; 00141 d = (FIXED16) 1; 00142 e = 0; 00143 f = 0; 00144 }
|
|
Default initialisation - sets up the scale matrix.
Definition at line 189 of file xmatrix.cpp. 00190 { 00191 a = xScale; 00192 b = (FIXED16) 0; 00193 c = (FIXED16) 0; 00194 d = yScale; 00195 e = 0; 00196 f = 0; 00197 }
|
|
Default initialisation - sets up the rotation matrix.
Definition at line 217 of file xmatrix.cpp. 00218 { 00219 #if 0 00220 a = b = c = d = theta; 00221 00222 a.Cos(); 00223 b.Sin(); 00224 c = -(c.Sin()); 00225 d.Cos(); 00226 #else 00227 double thetaradians = TORADIANS(theta.MakeDouble()); 00228 FIXED16 costheta = cos(thetaradians); 00229 FIXED16 sintheta = sin(thetaradians); 00230 00231 a = d = costheta; 00232 b = sintheta; 00233 c = -sintheta; 00234 #endif 00235 00236 e = 0; 00237 f = 0; 00238 }
|
|
Default initialisation - Sets up a translate matrix.
Definition at line 258 of file xmatrix.cpp. 00259 { 00260 a = (FIXED16) 1; 00261 b = (FIXED16) 0; 00262 c = (FIXED16) 0; 00263 d = (FIXED16) 1; 00264 e = disp.x; 00265 f = disp.y; 00266 }
|
|
Default initialisation - Sets up a translate matrix.
Definition at line 284 of file xmatrix.cpp. 00285 { 00286 a = (FIXED16) 1; 00287 b = (FIXED16) 0; 00288 c = (FIXED16) 0; 00289 d = (FIXED16) 1; 00290 e = x; 00291 f = y; 00292 }
|
|
Definition at line 295 of file xmatrix.cpp. 00296 { 00297 a = (FIXED16) 1; 00298 b = (FIXED16) 0; 00299 c = (FIXED16) 0; 00300 d = (FIXED16) 1; 00301 e = x; 00302 f = y; 00303 }
|
|
Default initialisation - copies elements from 32- to 64-bit matrix.
Definition at line 160 of file xmatrix.cpp. 00161 { 00162 a = mat32.a; 00163 b = mat32.b; 00164 c = mat32.c; 00165 d = mat32.d; 00166 e = mat32.e; 00167 f = mat32.f; 00168 }
|
|
Initialise a whole XMatrix.
Definition at line 325 of file xmatrix.cpp.
|
|
Overloads the *= operator for Matrices.
Definition at line 487 of file xmatrix.cpp. 00488 { 00489 XMatrix temp; 00490 00491 temp.a = ((a * op.a) + (b * op.c)); 00492 temp.b = ((a * op.b) + (b * op.d)); 00493 temp.c = ((c * op.a) + (d * op.c)); 00494 temp.d = ((c * op.b) + (d * op.d)); 00495 XMatrixCalc(op.a, e, op.c, f, RESULT temp.e); 00496 temp.e += op.e; 00497 XMatrixCalc(op.b, e, op.d, f, RESULT temp.f); 00498 temp.f += op.f; 00499 00500 *this = temp; 00501 00502 return *this; 00503 }
|
|
Matrix assignment.
Definition at line 425 of file xmatrix.cpp. 00426 { 00427 this->a = rhs.a; 00428 this->b = rhs.b; 00429 this->c = rhs.c; 00430 this->d = rhs.d; 00431 this->e = rhs.e; 00432 this->f = rhs.f; 00433 00434 return *this; 00435 }
|
|
Transforms a list of points.
Definition at line 394 of file xmatrix.cpp. 00395 { 00396 UINT32 i; 00397 00398 for (i = 0; i < count; i++) 00399 { 00400 XMatrixCalc(a, input[i].x, c, input[i].y, RESULT pts[i].x); 00401 pts[i].x += e; 00402 XMatrixCalc(b, input[i].x, d, input[i].y, RESULT pts[i].y); 00403 pts[i].y += f; 00404 } 00405 }
|
|
Transforms a list of points.
Definition at line 360 of file xmatrix.cpp. 00361 { 00362 UINT32 i; 00363 XLONG tx; // Holds INPUT value of pts[i].x for use in second MatrixCalc 00364 00365 for (i = 0; i < count; i++) 00366 { 00367 tx = pts[i].x; 00368 XMatrixCalc(a, tx, c, pts[i].y, RESULT pts[i].x); 00369 pts[i].x += e; 00370 XMatrixCalc(b, tx, d, pts[i].y, RESULT pts[i].y); 00371 pts[i].y += f; 00372 } 00373 }
|
|
Transforms a single point.
Definition at line 521 of file xmatrix.cpp. 00522 { 00523 XLONG tx = pt->x; // Holds INPUT value of x for use in second MatrixCalc 00524 00525 XMatrixCalc(a, tx, c, pt->y, RESULT pt->x); 00526 pt->x += e; 00527 XMatrixCalc(b, tx, d, pt->y, RESULT pt->y); 00528 pt->y += f; 00529 }
|
|
Matrix multiplication. Cannot be used in a nested form as the result is contained in a static local (e.g. a = (b*c)*(d*e) will fail).
Definition at line 454 of file xmatrix.cpp. 00455 { 00456 static XMatrix result; 00457 00458 result.a = ((op1.a * op2.a) + (op1.b * op2.c)); 00459 result.b = ((op1.a * op2.b) + (op1.b * op2.d)); 00460 result.c = ((op1.c * op2.a) + (op1.d * op2.c)); 00461 result.d = ((op1.c * op2.b) + (op1.d * op2.d)); 00462 00463 XMatrixCalc(op2.a, op1.e, op2.c, op1.f, RESULT result.e); 00464 result.e += op2.e; 00465 XMatrixCalc(op2.b, op1.e, op2.d, op1.f, RESULT result.f); 00466 result.f += op2.f; 00467 00468 return result; 00469 }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|