Ignore:
Timestamp:
09/19/08 11:41:18 (16 years ago)
Author:
mattausch
Message:

preetham working

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Transform3.cpp

    r2955 r2957  
    11#include "Transform3.h" 
    2 #include "Matrix4x4.h" 
    32#include "RenderState.h" 
    43 
     
    109 
    1110 
    12 Transform3::Transform3(Matrix4x4 *trafo): mMatrix(trafo) 
     11Transform3::Transform3(const Matrix4x4 &trafo): mMatrix(trafo) 
    1312{ 
     13        mIsIdentity = false; 
    1414} 
    1515 
    1616 
    17 Transform3::~Transform3() 
     17Transform3::Transform3() 
    1818{ 
    19         DEL_PTR(mMatrix); 
     19        Reset(); 
    2020} 
    2121 
     
    2323void Transform3::Load(RenderState *state) 
    2424{ 
    25         if (!mMatrix) return; 
     25        if (mIsIdentity) return; 
    2626         
    2727        if (state->GetRenderPassType() == RenderState::DEFERRED) 
    2828        { 
    29                 cgGLSetMatrixParameterfc(sModelMatrixParam, (const float *)mMatrix->x); 
     29                cgGLSetMatrixParameterfc(sModelMatrixParam, (const float *)mMatrix.x); 
    3030        } 
    3131 
    3232        glPushMatrix(); 
    33         glMultMatrixf((float *)mMatrix->x); 
     33        glMultMatrixf((float *)mMatrix.x); 
    3434} 
    3535 
     
    3737void Transform3::Unload(RenderState *state) 
    3838{ 
    39         if (!mMatrix) return; 
     39        if (mIsIdentity) return; 
    4040 
    4141        if (state->GetRenderPassType() == RenderState::DEFERRED) 
     
    4848} 
    4949 
     50 
     51void Transform3::MultMatrix(const Matrix4x4 &trafo) 
     52{ 
     53        mIsIdentity = false; 
     54        mMatrix = mMatrix * trafo; 
    5055} 
     56 
     57 
     58void Transform3::Reset() 
     59{ 
     60        mIsIdentity = true; 
     61        mMatrix = IdentityMatrix(); 
     62} 
     63 
     64 
     65} 
Note: See TracChangeset for help on using the changeset viewer.