www.pudn.com > SurfWareNew06.3.5(LYW).rar > Camera.H


/************************************************************************* 
* This head file is for 3D scene script. We will define a scene class    * 
* with some light and camera and models.                                 * 
*************************************************************************/ 
#ifndef _CAMERA_H__ 
#define _CAMERA_H__ 
 
#include "include/PredefineData.h" 
#include "Point.h" 
 
class GCamera	{ 
 
public: 
	//eye position 
    Point	m_eye; 
	Point	m_ref; 
	Point	m_vecUp; 
 
	//viewing volume 
    float		m_far, m_near; 
	float	 	m_width,m_height; 
 
	double		m_orthoLeft,m_orthoRight,m_orthoTop,m_orthoBottom; 
 
	UINT		m_fovy;			 
	//viewport 
	float		m_screen[2]; 
	ViewType	m_pViewPort; 
 
public: 
	void Move(short zDelta); 
	void OverTurn(); 
    GCamera(); 
	~GCamera(); 
 
	void	init(); 
     
	void	projection(GLenum mode); 
	void	SetViewDirection(); 
	 
	float	GetObserveDistance(); 
 
	//set viewport acoording to window 
	void set_screen( int x, int y); 
 
	//set eye coordinate 
	void set_eye(double eye_x,double eye_y,double eye_z); 
	void set_ref(float ref_x,float ref_y,float ref_z); 
	void set_vecUp(float up_dx,float up_dy,float up_dz); 
 
	//set viewing volume 
	void get_view_rect(float& width,float& height); 
 
	void Span(CPoint mousedown,CPoint point); 
	void Orbit(CPoint mousedown, CPoint point); 
	void Zoom(short zDelta); 
 
 
}; 
#endif