|
Core library
A simple library for handling 3D scenes
|
00001 #ifndef CAMERA_H 00002 #define CAMERA_H 00003 00004 #define _USE_MATH_DEFINES 1 00005 #include "GL/glew.h" 00006 #include "point.h" 00007 #include "vector.h" 00008 #include "box.h" 00009 00015 class CORE_EXPORT Camera 00016 { 00017 public: 00024 void init(const Box& b); 00025 00029 void setModelview() const; 00030 00034 void setProjection() const; 00035 00039 Point getObs() const; 00040 00044 void setAspectRatio(float ar); 00045 00050 void updateClippingPlanes(const Box&); 00051 00056 void incrementDistance(float inc); 00057 00062 void incrementAngleX(float inc); 00063 00068 void incrementAngleY(float inc); 00069 00074 void pan(const Vector& offset); 00075 00076 private: 00077 Point pvrp; // view reference point 00078 float pdist; // distance obs-vrp 00079 float pangleX, pangleY, pangleZ; // Euler angles 00080 float pfovy; // fielf of view, vertical 00081 float paspectRatio; // aspect ratio 00082 float pzNear, pzFar; // clipping planes 00083 }; 00084 00085 #endif 00086
1.7.6.1