source: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Transform3.cpp @ 3115

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