Camera.h
资源名称:g.rar [点击查看]
上传用户:laitongbao
上传日期:2021-02-20
资源大小:8176k
文件大小:1k
源码类别:
射击游戏
开发平台:
Visual C++
- #pragma once
- #include "NodeObject.h"
- /*
- 摄像机类:继承NodeObject
- */
- class Point;
- class Camera : public NodeObject
- {
- friend class TransitionController;
- friend class ShaderController;
- friend class FileController;
- friend class SceneTree;
- friend class BillBoard;
- public:
- Camera(Camera& cam);
- Camera(TCHAR* name,VECTOR3 pos = VECTOR3());
- Camera(TCHAR* name ,bool orthographic,bool taget,VECTOR3 pos = VECTOR3()); //新加的函数
- virtual ~Camera();
- void SetLookAtPoint(Point * p);
- void SetFov(float fov);
- void SetAspect(float aspect);
- void SetWide(float wide);
- void SetPrespectModel(bool orthographic);
- void SetNearPlane(float near);
- void SetFarPlane(float far);
- Point* GetLookAtPoint()const{return m_lookAtPoint;};
- void DrawObject(){}; //画虚拟物体(摄相机)
- void PreDraw(){}; //设置视矩阵和投影矩阵
- void CleanUp();
- private:
- D3DXVECTOR3 m_up;
- bool m_orthographic;
- bool m_target;
- Point *m_lookAtPoint;
- float m_fov;//普通透视时视野大小(弧度)
- float m_aspect;//宽/高
- float m_wide;//正交透视时摄像机的可视宽度
- float m_near;//near View plane
- float m_far;//far View plane
- };