Ignore:
Timestamp:
07/10/08 15:57:47 (16 years ago)
Author:
mattausch
Message:

worked on environment + hud

File:
1 edited

Legend:

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

    r2806 r2829  
    182182        const Vector3 fc = mPosition + view * z_far;  
    183183         
    184         const Vector3 up = GetUpVector(); 
     184        const Vector3 up = -GetUpVector(); 
    185185 
    186186        const Vector3 right = GetRightVector(); 
     
    218218        mYaw += angle; 
    219219        CalculateFromPitchAndYaw(); 
    220         /* 
    221         Matrix4x4 viewOrientation(mRight, mUp, mDirection); 
    222         Matrix4x4 rot = RotationYMatrix(angle); 
    223  
    224         viewOrientation = viewOrientation * rot; 
    225  
    226         mDirection = Vector3(viewOrientation.x[2][0], viewOrientation.x[2][1], viewOrientation.x[2][2]); 
    227         mRight =     Vector3(viewOrientation.x[0][0], viewOrientation.x[0][1], viewOrientation.x[0][2]); 
    228         mUp =        Vector3(viewOrientation.x[1][0], viewOrientation.x[1][1], viewOrientation.x[1][2]);*/ 
    229220} 
    230221 
     
    237228 
    238229 
     230void Camera::SetDirection(const Vector3 &direction) 
     231{ 
     232        Vector3 h1 = direction; h1.z = 0; h1.Normalize(); 
     233        Vector3 h2 = direction; h1.x = 0; h2.Normalize(); 
     234 
     235        mYaw = acos(DotProd(h1, Vector3(0, 1, 0))); 
     236        mPitch = acos(DotProd(h2, Vector3(0, 1, 0))); 
     237 
     238        CalculateFromPitchAndYaw(); 
     239} 
     240 
     241 
    239242void Camera::CalculateFromPitchAndYaw() 
    240243{ 
Note: See TracChangeset for help on using the changeset viewer.