#ifndef __TRANSFORM3_H #define __TRANSFORM3_H #include "Matrix4x4.h" #include "glInterface.h" #include "common.h" #include #include namespace CHCDemoEngine { class RenderState; /** Class representing a wrapper class for a 3D transformation */ class Transform3 { public: /** Creates a transformation. */ Transform3(const Matrix4x4 &trafo); /** The identity transformation. */ Transform3(); /** Loads this transformation. */ void Load(RenderState *state); /** Unloads this transformation */ void Unload(RenderState *state); /** Returns the trafo matrix. */ inline Matrix4x4 GetMatrix() const { return mMatrix; } /** See Get */ inline void SetMatrix(const Matrix4x4 &trafo) { mIsIdentity = false; mMatrix = trafo; } /** Right multiplies with the given matrix. */ void MultMatrix(const Matrix4x4 &trafo); /** Resets trafo to identiy. */ void Reset(); /** Returns true if this transformation is the identity. */ inline bool IsIdentity() const { return mIsIdentity; } static CGparameter sModelMatrixParam; protected: /// transform matrix Matrix4x4 mMatrix; /// if this matrix is still the identity matrix bool mIsIdentity; }; } #endif // __TRANSFORM_H