camera.h

来自「c++程序」· C头文件 代码 · 共 72 行

H
72
字号
// Camera.h: Schnittstelle f黵 die Klasse CCamera.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_CAMERA_H__265E3981_AFBF_11D3_8F4A_706973C10500__INCLUDED_)
#define AFX_CAMERA_H__265E3981_AFBF_11D3_8F4A_706973C10500__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

// math stuff
#include <math.h>

#include "Landscape.h"

class CCamera  
{
public:
	// Member data acess functions
	float GetYRotation();
	float GetZPos();
	float GetYPos();
	float GetXPos();
	float GetUpDownRotation();
	float GetSpeed();
	float GetSizeOfViewer();
	CLandscape* GetLandscape();
	void SetZPos(float fZPos);
	void SetYPos(float fYPos);
	void SetXPos(float fXPos);
	void SetSpeed(float fSpeed);
	void SetSizeOfViewer(float fSizeOfViewer);
	void SetLandscape(CLandscape* pLandscape);
	// Movement functions
	void MoveDefaultSpeed(bool bForward, bool bBackward, bool bStrafeLeft, 
		bool bStrafeRight, bool bMoveUp, bool bMoveDown);
	void MoveCustomSpeed(float fForward, float fBackward, float fStrafeLeft, float fStrafeRight, 
		float fMoveUp, float fMoveDown);
	void RotateVertical(float fDegrees);
	void RotateHorizontal(float fDegrees);
	void CenterVertical();
	// Get the height of the landscape at the camera position
	float GetSurfaceHeight();
	// Do camera transformation
	void TransformWorld();
	// Increment the walkbias
	void IncrementWalkBias();
	CCamera();
	virtual ~CCamera();
private:
	// Look up/down
	GLfloat	m_UpDown;
	// Y rotation
	GLfloat	m_YRotate;		
	// Camera position
	GLfloat m_XPos;
	GLfloat m_YPos;
	GLfloat m_ZPos;
	// Walkbias
	GLfloat m_WalkBiasAngle;
	GLfloat m_WalkBias ;
	// Size of viewer
	GLfloat m_SizeOfViewer;
	// Movement speed
	GLfloat m_Speed;
	// Associated landscape
	CLandscape* m_Landscape;
};

#endif // !defined(AFX_CAMERA_H__265E3981_AFBF_11D3_8F4A_706973C10500__INCLUDED_)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?