home *** CD-ROM | disk | FTP | other *** search
/ Programming an RTS Game with Direct3D / Programming an RTS Game with Direct3D.iso / Examples / Chapter 5 / Example 5.1 / camera.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-06-29  |  725 b   |  35 lines

  1. #ifndef _CAMERA
  2. #define _CAMERA
  3.  
  4. #include <d3dx9.h>
  5. #include "debug.h"
  6.  
  7. class CAMERA{
  8.     public:
  9.         //Init Camera
  10.         CAMERA();
  11.         void Init(IDirect3DDevice9* Dev);
  12.  
  13.         //Movement
  14.         void Scroll(D3DXVECTOR3 vec);    //Move Focus
  15.         void Pitch(float f);            //Change B-angle
  16.         void Yaw(float f);                //Change A-angle
  17.         void Zoom(float f);                //Change FOV
  18.         void ChangeRadius(float f);        //Change Radius... douh
  19.  
  20.         //Calculate Eye position etc
  21.         void Update(float timeDelta);
  22.  
  23.         //Calculate Matrices
  24.         D3DXMATRIX GetViewMatrix();
  25.         D3DXMATRIX GetProjectionMatrix();
  26.  
  27.     private:
  28.  
  29.         IDirect3DDevice9* m_pDevice;
  30.         float m_alpha, m_beta, m_radius, m_fov;
  31.         D3DXVECTOR3 m_eye, m_focus, m_right, m_look;
  32. };
  33.  
  34. #endif
  35.