afCamera.h
资源名称:AirForce.rar [点击查看]
上传用户:kaiguan
上传日期:2007-10-28
资源大小:1074k
文件大小:2k
源码类别:
其他游戏
开发平台:
Visual C++
- // afCamera.h: interface for the afCamera class.
- //
- //////////////////////////////////////////////////////////////////////
- #ifndef AF_CAMERA
- #define AF_CAMERA
- #pragma once
- #include "stdafx.h"
- class afPlane;
- class afCamera
- {
- protected:
- D3DXVECTOR3 m_vEyePt; // Attributes for view matrix
- D3DXVECTOR3 m_vLookatPt;
- D3DXVECTOR3 m_vUpVec;
- D3DXVECTOR3 m_vView;
- D3DXVECTOR3 m_vCross;
- D3DXMATRIXA16 m_matView;
- D3DXMATRIXA16 m_matBillboard; // Special matrix for billboarding effects
- FLOAT m_fFOV; // Attributes for projection matrix
- FLOAT m_fAspect;
- FLOAT m_fNearPlane;
- FLOAT m_fFarPlane;
- bool m_updateVisibility;
- D3DXMATRIXA16 m_matProj;
- public:
- void createClippingPlanes(afPlane nPlanes[6]);
- void SetUpdateVisibility(bool visible);
- bool getUpdateVisibility();
- // Access functions
- D3DXVECTOR3 GetEyePt() { return m_vEyePt; }
- D3DXVECTOR3 GetLookatPt() { return m_vLookatPt; }
- D3DXVECTOR3 GetUpVec() { return m_vUpVec; }
- D3DXVECTOR3 GetViewDir() { return m_vView; }
- D3DXVECTOR3 GetCross() { return m_vCross; }
- FLOAT GetFOVY() { return m_fFOV; }
- FLOAT GetFOVX() { return m_fFOV*m_fAspect;}
- FLOAT GetAspect() { return m_fAspect; }
- FLOAT GetNearPlane() { return m_fNearPlane; }
- FLOAT GetFarPlane() { return m_fFarPlane; }
- D3DXMATRIX* GetViewMatrix() { return &m_matView; }
- D3DXMATRIX* GetBillboardMatrix() { return &m_matBillboard; }
- D3DXMATRIX* GetProjMatrix() { return &m_matProj; }
- VOID SetViewParams( D3DXVECTOR3 &vEyePt, D3DXVECTOR3& vLookatPt,
- D3DXVECTOR3& vUpVec );
- VOID SetProjParams( FLOAT fFOV, FLOAT fAspect, FLOAT fNearPlane,
- FLOAT fFarPlane );
- afCamera();
- };
- #endif