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

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