D:/Zythum/DinoKod/Render/Camera.h

00001 //---------------------------------------------------------------------------------------------
00002 //      This file is a part of "DinoKod".
00003 //      Copyright © 2003 Dino Productions. All Rights Reserved.
00004 //      
00005 //      File                    : Camera.h
00006 //      Author                  : Sebastien LEIX        sebastien.leix@wanadoo.fr
00007 //      Date                    : 09/09/2002
00008 //      Modification    :
00009 //
00010 //---------------------------------------------------------------------------------------------
00011 #ifndef __CAMERA_H__
00012 #define __CAMERA_H__
00013 
00014 #include "Render/RenderDll.h"
00015 #include "Common/Matrix.h"
00016 #include "Common/Vector.h"
00017 
00018 class KPlane;
00019 
00020 //--------------------------------------------------------------------------------------------------------------------------------
00021 class RENDER_API KCamera
00022 {
00023 protected:
00024         KMatrix                 m_Target;
00025         KMatrix                 m_TargetRot;
00026         KVector                 m_CameraPos;
00027         KVector                 m_TargetPos;
00028                                         
00029         KMatrix                 m_Matrix;
00030                                         
00031         float                   m_Fov;
00032         float                   m_Aspect;
00033         float                   m_Near;
00034         float                   m_Far;
00035                                         
00036         float                   m_fYaw;
00037         float                   m_fPitch;
00038         KVector                 m_Pos;
00039                                         
00040         void                    RotX( float ang );
00041         void                    RotY( float ang );
00042         void                    RotZ( float ang );
00043                                         
00044 
00045 public:
00046                                         KCamera( float Fov, float Aspect, float Near, float Far );
00047         virtual                 ~KCamera();
00048                 
00049         void                    SetParam( float Fov, float Aspect, float Near, float Far );
00050         void                    Reset();
00051                                         
00052         KMatrix                 GetMatrix();
00053                                         
00054         void                    RotateX( float ang );
00055         void                    RotateY( float ang );
00056         void                    RotateZ( float ang );
00057                                         
00058         virtual void    Translate( float x, float y, float z );
00059 
00060         virtual void    ComputeMatrix()=0;
00061 
00062         void                    SetCameraPosition( float x, float y, float z );
00063         void                    SetTargetPosition( float x, float y, float z );
00064         void                    ComputeLookAtMatrix();
00065                                         
00066         virtual KVector GetPos();
00067         virtual void    SetPos( float x, float y, float z );
00068 //      KVector                 GetDir();
00069         virtual void    GetAxes( KVector& vRight, KVector& vUp, KVector& vView );
00070         void                    GetFrustumPlanes( KPlane pPlanes[6] );
00071         void                    GetFrustumPoints( KVector pPoints[8] );
00072                                         
00073         void                    SetAxes( KVector& vRight, KVector& vUp, KVector& vView );
00074                                         
00075         float                   GetFov()                                                { return m_Fov;                 }
00076         float                   GetAspect()                                             { return m_Aspect;              }
00077         float                   GetNearPlane()                                  { return m_Near;                }
00078         float                   GetFarPlane()                                   { return m_Far;                 }
00079         void                    SetFarPlane( float FarPlane )   { m_Far = FarPlane;             }
00080         void                    SetFov( float Fov )                             { m_Fov = Fov;                  }
00081 
00082         float                   GetYaw()                                                { return m_fYaw;                }
00083         float                   GetPitch()                                              { return m_fPitch;              }
00084 };
00085 
00086 //--------------------------------------------------------------------------------------------------------------------------------
00087 class RENDER_API KKeyFrameCamera
00088 {
00089 public:
00090         int                                     m_Frame;
00091         KVector                         m_Pos;
00092 };
00093 
00094 //--------------------------------------------------------------------------------------------------------------------------------
00095 class RENDER_API KFrameCamera
00096 {
00097 public:
00098         int                                     m_nFrame;
00099         int                                     m_nKey;
00100         int                                     m_nFPS;
00101 
00102         KKeyFrameCamera*        m_pKeyFrameCamera;
00103         KKeyFrameCamera*        m_pKeyFrameTarget;
00104 
00105         KFrameCamera();
00106         ~KFrameCamera();
00107 
00108         KVector                         GetKeyFramePos( KKeyFrameCamera* pKeyFrame, int Time );
00109         KVector                         GetCameraPos( int Time );
00110         KVector                         GetTargetPos( int Time );
00111 };
00112 
00113 #endif __CAMERA_H__

Generated on Sun Mar 25 20:02:15 2007 for Zythum Project by  doxygen 1.5.1-p1