Camera.h

Go to the documentation of this file.
00001 // Copyright (C) 2005 Dave Griffiths
00002 //
00003 // This program is free software; you can redistribute it and/or modify
00004 // it under the terms of the GNU General Public License as published by
00005 // the Free Software Foundation; either version 2 of the License, or
00006 // (at your option) any later version.
00007 //
00008 // This program is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011 // GNU General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU General Public License
00014 // along with this program; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
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

Generated on Wed Sep 17 21:16:30 2008 for The Fluxus Renderer (libfluxus) by  doxygen 1.5.1