pipeline.h

00001 /*
00002 * "PS2" Application Framework
00003 *
00004 * University of Abertay Dundee
00005 * May be used for educational purposed only
00006 *
00007 * Author - Dr Henry S Fortuna
00008 *
00009 * $Revision: 1.4 $
00010 * $Date: 2007/08/27 19:37:12 $
00011 *
00012 */
00013 
00014 #ifndef _PIPELINE_H_
00015 #define _PIPELINE_H_
00016 
00017 #include "singleton.h"
00018 #include "ps2matrix4x4.h"
00019 #include "ps2vector4.h"
00020 
00021 
00022 #define Pipeline CPipeline::GetSingleton()
00023 
00024 class CPipeline : public CSingleton<CPipeline>
00025 {
00026 public:
00027         CPipeline();
00028         ~CPipeline(){};
00029         
00030         inline const Matrix4x4 & GetProjection(void) const;
00031         inline const Matrix4x4 & GetCamera(void) const;
00032         inline const Matrix4x4 & GetViewProjection(void) const;
00033         inline const Matrix4x4 & GetLightDirs(void) const;
00034         inline const Matrix4x4 & GetLightCols(void) const;
00035         inline const Vector4 & GetScaleVector(void) const;
00036         
00037         inline const float GetCameraX(void) const;
00038         inline const float GetCameraY(void) const;
00039         inline const float GetCameraZ(void) const;
00040         inline const float GetCameraXRot(void) const;
00041         inline const float GetCameraYRot(void) const;
00042         
00043         void SetLight1(const Vector4 & Direction, const Vector4 & Colour);
00044         void SetLight2(const Vector4 & Direction, const Vector4 & Colour);
00045         void SetLight3(const Vector4 & Direction, const Vector4 & Colour);
00046         void SetAmbient(const Vector4 & Colour);
00047         
00048         void Update(float Strafe, float Advance, float UpDown, float XRot, float YRot);
00049         void PositionCamera(const Vector4 & Position, const float XRot, const float YRot);
00050         void PositionCamera(const Vector4 & Position, const Vector4 & LookAt);
00051         void Initialise(void);
00052 
00053 protected:      
00054 
00055         float m_near;           // Near plane
00056         float m_far;            // Far plane
00057         float m_FOV;            // Field of View
00058         float m_Aspect;         // Aspect Ratio
00059         float m_ScreenW;        // Screen Width
00060         float m_ScreenH;        // Screen height;
00061         
00062         Matrix4x4 m_Projection;
00063         Matrix4x4 m_Camera;
00064         Matrix4x4 m_ViewProjection;
00065         Matrix4x4 m_LightDirs;
00066         Matrix4x4 m_LightCols;
00067         
00068         Vector4 m_Scale;
00069                 
00070         Vector4 m_CamPos;
00071         float m_XRot, m_YRot;
00072         
00073         void CalcProjection(void);      
00074 };
00075 
00076 inline const Matrix4x4 & CPipeline::GetProjection(void) const
00077         {return (m_Projection);}
00078 
00079 inline const Matrix4x4 & CPipeline::GetCamera(void) const
00080         {return (m_Camera);}
00081 
00082 inline const Matrix4x4 & CPipeline::GetViewProjection(void) const
00083         {return (m_ViewProjection);}
00084         
00085 inline const Matrix4x4 & CPipeline::GetLightDirs(void) const
00086         {return (m_LightDirs);}
00087         
00088 inline const Matrix4x4 & CPipeline::GetLightCols(void) const
00089         {return (m_LightCols);}
00090         
00091 inline const Vector4 & CPipeline::GetScaleVector(void) const
00092         {return (m_Scale);}
00093         
00094 inline const float CPipeline::GetCameraX(void) const
00095         {return m_CamPos.x;}
00096         
00097 inline const float CPipeline::GetCameraY(void) const
00098         {return m_CamPos.y;}
00099         
00100 inline const float CPipeline::GetCameraZ(void) const
00101         {return m_CamPos.z;}
00102         
00103 inline const float CPipeline::GetCameraXRot(void) const
00104                 {return m_XRot;}
00105                 
00106 inline const float CPipeline::GetCameraYRot(void) const
00107         {return m_YRot;}
00108 
00109 
00110 #endif

Generated on Sun May 18 21:45:08 2008 for PS2X by  doxygen 1.5.4