glcamera.h

来自「实战粒子系统例程」· C头文件 代码 · 共 41 行

H
41
字号
/*
	glcamera.h - Camera class
	Copyright (c) HalfLucifer, 2001.11.18
*/
#ifndef __GLCAMERAH__
#define __GLCAMERAH__

#include <windows.h>
#include <math.h>
#include <gl\gl.h>
#include <gl\glu.h>
#include "glvector.h"

const int XMOUSE_SENSITIVE = 100;
const int YMOUSE_SENSITIVE = 1;

class GLcamera
{

public:
	GLcamera(GLvector pos, GLvector view, GLvector up);
	void Update();
	void Move(float vec);
	void Strafe(float vec);
	void ViewMove();
	void RotateView(float x, float y, float z);
	GLvector GetPosition() { return m_Position; }
	GLvector GetViewPoint() { return m_ViewPoint; }
	GLvector GetUpVector() { return m_UpVector; }
	GLvector GetRightVector();
	void SetPosition(GLvector p) { m_Position = p; }
	void SetViewPoint(GLvector v) { m_ViewPoint = v; }

protected:
	GLvector m_Position;
	GLvector m_ViewPoint;
	GLvector m_UpVector;

};

#endif

⌨️ 快捷键说明

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