Ignore:
Timestamp:
06/22/08 09:23:45 (16 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r2782 r2796  
    2020        { 
    2121                /// the 6 clip planes 
    22                 //float mClipPlane[6][4]; 
    2322                Plane3 mClipPlanes[6]; 
    2423 
     
    3029        Camera(int width, int height, float fieldOfView = 90.f); 
    3130 
    32         void Precompute(); 
    33  
    34         void LookInBox(const AxisAlignedBox3 &box); 
    35  
    36         void LookAtBox(const AxisAlignedBox3 &box); 
    3731 
    3832        void SetPosition(const Vector3 &pos); 
    3933 
    40         void SetDirection(const Vector3 &dir); 
    41  
    4234        inline Vector3 GetPosition() const { return mPosition; } 
    43         inline Vector3 GetDirection() const { return mDirection; } 
    44         inline Vector3 GetUpVector() const { return mUp; } 
    45         inline Vector3 GetRightVector() const { return mRight; } 
     35        Vector3 GetDirection() const; 
     36        Vector3 GetUpVector() const; 
     37        Vector3 GetRightVector() const; 
    4638 
    4739        inline float GetFov() const { return mFovy; } 
     
    4941        inline float GetAspect() const { return (float) mWidth / mHeight; } 
    5042 
     43        /** Sets up viewing in gl 
     44        */ 
    5145        void SetupCameraView(); 
    5246        void GetProjectionMatrix(Matrix4x4 &mat); 
     
    6054        inline float GetNear() const { return mNear; } 
    6155        void SetNear(float nearDist); 
     56         
     57        inline float GetFar() const { return mFar; } 
     58 
     59        void SetFar(float farDist) { mFar = farDist; } 
     60 
     61        void SetOrtho(bool ortho); 
     62 
     63        void Yaw(float angle); 
     64        void Pitch(float angle); 
     65         
    6266 
    6367 
    6468protected: 
    6569 
     70        void Precompute(const Vector3 &direction); 
     71 
     72        void CalculateFromPitchAndYaw(); 
     73 
     74 
    6675        //////////////// 
    67  
    68         Vector3 mPosition; 
    69         Vector3 mDirection; 
    70  
    71         /// up vector takes into account the FOV at a unit distance from the origin 
    72         Vector3 mUp; 
    73         /// right vector takes into account the FOV at a unit distance from the origin 
    74         Vector3 mRight; 
     76        //-- members 
    7577 
    7678        float mFovy; 
     
    7981 
    8082        float mNear; 
     83 
     84        float mFar; 
     85 
     86        bool mIsOrtho; 
     87 
     88        Matrix4x4 mBaseOrientation; 
     89        Matrix4x4 mViewOrientation; 
     90 
     91        float mPitch; 
     92        float mYaw; 
     93 
     94        Vector3 mPosition; 
    8195}; 
    8296 
Note: See TracChangeset for help on using the changeset viewer.