00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef FLUX_CAMERA
00018 #define FLUX_CAMERA
00019
00020 #include "Primitive.h"
00021
00022 namespace Fluxus
00023 {
00024
00027 class Camera
00028 {
00029 public:
00030 Camera();
00031 ~Camera();
00032
00036
00040 bool NeedsInit() { return !m_Initialised; }
00041
00043 void DoProjection();
00044
00046 void DoCamera();
00048
00052 dMatrix *GetMatrix() { return &m_Transform; }
00053 void SetMatrix(const dMatrix &m) { m_Transform=m; }
00054 dMatrix *GetLockedMatrix() { return &m_LockedMatrix; }
00055 dMatrix GetProjection();
00056 float GetUp() { return m_Up; }
00057 float GetLeft() { return m_Left; }
00059 void LockCamera(Primitive *p);
00060 void SetCameraLag(float s) { m_CameraLag=s; }
00061 void SetOrtho(bool s) { m_Ortho=s; m_Initialised=false; }
00062 void SetOrthoZoom(float s) { m_OrthZoom=s; m_Initialised=false; }
00063 void SetFrustum(float u, float d, float l, float r) { m_Up=u; m_Down=d; m_Left=l; m_Right=r; m_Initialised=false; }
00064 void SetClip(float f, float b) { m_Front=f; m_Back=b; m_Initialised=false; }
00065 void SetViewport(float x, float y, float w, float h)
00066 { m_ViewX=x; m_ViewY=y; m_ViewWidth=w; m_ViewHeight=h; }
00067 float GetViewportX() { return m_ViewX; }
00068 float GetViewportY() { return m_ViewY; }
00069 float GetViewportWidth() { return m_ViewWidth; }
00070 float GetViewportHeight() { return m_ViewHeight; }
00072
00073 private:
00074
00075 bool m_Initialised;
00076 dMatrix m_Transform;
00077 bool m_Ortho;
00078 Primitive *m_CameraAttached;
00079 float m_CameraLag;
00080 dMatrix m_LockedMatrix;
00081 float m_Up,m_Down,m_Left,m_Right,m_Front,m_Back;
00082 float m_OrthZoom;
00083 float m_ViewX,m_ViewY,m_ViewWidth,m_ViewHeight;
00084 };
00085
00086 }
00087
00088 #endif