Line | |
---|
1 | #ifndef __TRANSFORM3_H
|
---|
2 | #define __TRANSFORM3_H
|
---|
3 |
|
---|
4 | #include "Matrix4x4.h"
|
---|
5 | #include "common.h"
|
---|
6 |
|
---|
7 |
|
---|
8 | namespace CHCDemoEngine
|
---|
9 | {
|
---|
10 |
|
---|
11 | class RenderState;
|
---|
12 |
|
---|
13 |
|
---|
14 | /** Wrapper class for a 3D transformation
|
---|
15 | */
|
---|
16 | class Transform3
|
---|
17 | {
|
---|
18 | public:
|
---|
19 |
|
---|
20 | /** Creates a transformation.
|
---|
21 | */
|
---|
22 | Transform3(const Matrix4x4 &trafo);
|
---|
23 | /** The identity transformation.
|
---|
24 | */
|
---|
25 | Transform3();
|
---|
26 | /** Loads this transformation.
|
---|
27 | */
|
---|
28 | void Load(RenderState *state);
|
---|
29 | /** Unloads this transformation
|
---|
30 | */
|
---|
31 | void Unload(RenderState *state);
|
---|
32 | /** Returns the trafo matrix.
|
---|
33 | */
|
---|
34 | inline Matrix4x4 GetMatrix() const { return mMatrix; }
|
---|
35 | /** See Get
|
---|
36 | */
|
---|
37 | inline void SetMatrix(const Matrix4x4 &trafo) { mIsIdentity = false; mMatrix = trafo; }
|
---|
38 | /** Right multiplies with the given matrix.
|
---|
39 | */
|
---|
40 | void MultMatrix(const Matrix4x4 &trafo);
|
---|
41 | /** Resets trafo to identiy.
|
---|
42 | */
|
---|
43 | void Reset();
|
---|
44 | /** Returns true if this transformation is the identity.
|
---|
45 | */
|
---|
46 | inline bool IsIdentity() const { return mIsIdentity; }
|
---|
47 |
|
---|
48 |
|
---|
49 | protected:
|
---|
50 |
|
---|
51 | /// transform matrix
|
---|
52 | Matrix4x4 mMatrix;
|
---|
53 | /// if this matrix is still the identity matrix
|
---|
54 | bool mIsIdentity;
|
---|
55 | };
|
---|
56 |
|
---|
57 |
|
---|
58 | }
|
---|
59 |
|
---|
60 | #endif // __TRANSFORM_H |
---|
Note: See
TracBrowser
for help on using the repository browser.