Revision 3089,
704 bytes
checked in by mattausch, 16 years ago
(diff) |
working better but stil not fully there
|
Line | |
---|
1 | #include "Transform3.h"
|
---|
2 | #include "RenderState.h"
|
---|
3 | #include "ShaderProgram.h"
|
---|
4 |
|
---|
5 |
|
---|
6 | namespace CHCDemoEngine
|
---|
7 | {
|
---|
8 |
|
---|
9 |
|
---|
10 | Transform3::Transform3()
|
---|
11 | {
|
---|
12 | Reset();
|
---|
13 | }
|
---|
14 |
|
---|
15 |
|
---|
16 | Transform3::Transform3(const Matrix4x4 &trafo): mMatrix(trafo)
|
---|
17 | {
|
---|
18 | mIsIdentity = false;
|
---|
19 | }
|
---|
20 |
|
---|
21 |
|
---|
22 | void Transform3::Load(RenderState *state)
|
---|
23 | {
|
---|
24 | if (!mIsIdentity)
|
---|
25 | {
|
---|
26 | glPushMatrix();
|
---|
27 | glMultMatrixf((float *)mMatrix.x);
|
---|
28 | }
|
---|
29 | }
|
---|
30 |
|
---|
31 |
|
---|
32 | void Transform3::Unload(RenderState *state)
|
---|
33 | {
|
---|
34 | if (!mIsIdentity)
|
---|
35 | {
|
---|
36 | glPopMatrix();
|
---|
37 | }
|
---|
38 | }
|
---|
39 |
|
---|
40 |
|
---|
41 | void Transform3::MultMatrix(const Matrix4x4 &trafo)
|
---|
42 | {
|
---|
43 | mIsIdentity = false;
|
---|
44 | mMatrix = mMatrix * trafo;
|
---|
45 | }
|
---|
46 |
|
---|
47 |
|
---|
48 | void Transform3::Reset()
|
---|
49 | {
|
---|
50 | mIsIdentity = true;
|
---|
51 | mMatrix = IdentityMatrix();
|
---|
52 | }
|
---|
53 |
|
---|
54 |
|
---|
55 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.