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

Revision 3034, 748 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
9CGparameter Transform3::sModelMatrixParam;
10
11
12Transform3::Transform3(const Matrix4x4 &trafo): mMatrix(trafo)
13{
14        mIsIdentity = false;
15}
16
17
18Transform3::Transform3()
19{
20        Reset();
21}
22
23
24void Transform3::Load(RenderState *state)
25{
26        if (mIsIdentity) return;
27
28        glPushMatrix();
29        glMultMatrixf((float *)mMatrix.x);
30}
31
32
33void Transform3::Unload(RenderState *state)
34{
35        if (mIsIdentity) return;
36
37        glPopMatrix();
38}
39
40
41void Transform3::MultMatrix(const Matrix4x4 &trafo)
42{
43        mIsIdentity = false;
44        mMatrix = mMatrix * trafo;
45}
46
47
48void Transform3::Reset()
49{
50        mIsIdentity = true;
51        mMatrix = IdentityMatrix();
52}
53
54
55}
Note: See TracBrowser for help on using the repository browser.