- Timestamp:
- 09/19/08 11:41:18 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Transform3.cpp
r2955 r2957 1 1 #include "Transform3.h" 2 #include "Matrix4x4.h"3 2 #include "RenderState.h" 4 3 … … 10 9 11 10 12 Transform3::Transform3( Matrix4x4 *trafo): mMatrix(trafo)11 Transform3::Transform3(const Matrix4x4 &trafo): mMatrix(trafo) 13 12 { 13 mIsIdentity = false; 14 14 } 15 15 16 16 17 Transform3:: ~Transform3()17 Transform3::Transform3() 18 18 { 19 DEL_PTR(mMatrix);19 Reset(); 20 20 } 21 21 … … 23 23 void Transform3::Load(RenderState *state) 24 24 { 25 if ( !mMatrix) return;25 if (mIsIdentity) return; 26 26 27 27 if (state->GetRenderPassType() == RenderState::DEFERRED) 28 28 { 29 cgGLSetMatrixParameterfc(sModelMatrixParam, (const float *)mMatrix ->x);29 cgGLSetMatrixParameterfc(sModelMatrixParam, (const float *)mMatrix.x); 30 30 } 31 31 32 32 glPushMatrix(); 33 glMultMatrixf((float *)mMatrix ->x);33 glMultMatrixf((float *)mMatrix.x); 34 34 } 35 35 … … 37 37 void Transform3::Unload(RenderState *state) 38 38 { 39 if ( !mMatrix) return;39 if (mIsIdentity) return; 40 40 41 41 if (state->GetRenderPassType() == RenderState::DEFERRED) … … 48 48 } 49 49 50 51 void Transform3::MultMatrix(const Matrix4x4 &trafo) 52 { 53 mIsIdentity = false; 54 mMatrix = mMatrix * trafo; 50 55 } 56 57 58 void Transform3::Reset() 59 { 60 mIsIdentity = true; 61 mMatrix = IdentityMatrix(); 62 } 63 64 65 }
Note: See TracChangeset
for help on using the changeset viewer.