chunkstream version fixedleaselication
git-svn-id: svn://db.shs.com.ru/libs@3 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -25,9 +25,14 @@
|
||||
#if __QNX__ || __QNXNTO__
|
||||
# define QNX
|
||||
#endif
|
||||
#ifdef __APPLE__
|
||||
# define MAC
|
||||
#endif
|
||||
#ifndef WINDOWS
|
||||
# ifndef QNX
|
||||
# define LINUX
|
||||
# ifndef MAC
|
||||
# define LINUX
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
#if __GNUC__
|
||||
@@ -39,10 +44,16 @@
|
||||
#ifdef WINDOWS
|
||||
# include "GLee.h"
|
||||
#else
|
||||
# include <GL/gl.h>
|
||||
# include <GL/glext.h>
|
||||
# ifdef MAC
|
||||
# include <OpenGL/gl.h>
|
||||
# include <OpenGL/glu.h>
|
||||
# include <GLUT/glut.h>
|
||||
# else
|
||||
# include <GL/gl.h>
|
||||
# include <GL/glext.h>
|
||||
# include <GL/glu.h>
|
||||
# endif
|
||||
#endif
|
||||
#include <GL/glu.h>
|
||||
#include <qgl.h>
|
||||
#include <cmath>
|
||||
#include <float.h>
|
||||
@@ -79,6 +90,10 @@
|
||||
#define M_2PI 6.28318530717958647692
|
||||
#define M_PI_3 1.04719755119659774615
|
||||
|
||||
#ifndef GL_RGBA16F
|
||||
# define GL_RGBA16F GL_RGBA16F_ARB
|
||||
#endif
|
||||
|
||||
using std::complex;
|
||||
|
||||
#ifndef PIP_VERSION
|
||||
@@ -270,7 +285,6 @@ public:
|
||||
QVector3D angles() const {return QVector3D(angle_xy, angle_roll, angle_z);}
|
||||
QVector3D direction() const {return (aim_ - pos_).normalized();}
|
||||
QVector3D directionXY() const {QVector3D tv = aim_ - pos_; return QVector3D(tv.x(), tv.y(), 0.).normalized();}
|
||||
QVector3D pointFromViewport(int x, int y, double z = 0.);
|
||||
double FOV() const {return fov_;}
|
||||
double distance() const {return (pos_ - aim_).length();}
|
||||
double angleZ() const {return angle_z;}
|
||||
@@ -285,8 +299,9 @@ public:
|
||||
void anglesFromPoints();
|
||||
void apply(const GLdouble & aspect = 1.);
|
||||
void assign(const Camera & c) {pos_ = c.pos_; aim_ = c.aim_; fov_ = c.fov_; angle_z = c.angle_z; angle_xy = c.angle_xy; angle_roll = c.angle_roll; angle_limit_lower_xy = c.angle_limit_lower_xy; angle_limit_upper_xy = c.angle_limit_upper_xy;}
|
||||
|
||||
QVector3D pointFromViewport(int x_, int y_, double z_);
|
||||
private:
|
||||
|
||||
QVector3D pos_;
|
||||
QVector3D aim_;
|
||||
GLdouble fov_;
|
||||
@@ -297,11 +312,11 @@ private:
|
||||
GLdouble angle_roll;
|
||||
GLdouble angle_limit_lower_xy;
|
||||
GLdouble angle_limit_upper_xy;
|
||||
GLdouble modelview[16], projection[16];
|
||||
GLint viewport[4];
|
||||
bool mirror_x;
|
||||
bool mirror_y;
|
||||
GLint viewport[4];
|
||||
GLdouble projection[16];
|
||||
GLdouble modelview[16];
|
||||
|
||||
};
|
||||
|
||||
extern Camera * currentCamera;
|
||||
@@ -490,7 +505,7 @@ class QGLViewBase
|
||||
public:
|
||||
QGLViewBase() {}
|
||||
Camera & camera() {return camera_;}
|
||||
void setCamera(const Camera &cam) {camera_ = cam;}
|
||||
void setCamera(const Camera & camera) {camera_ = camera;}
|
||||
protected:
|
||||
virtual void collectLights() = 0;
|
||||
Camera camera_;
|
||||
|
||||
Reference in New Issue
Block a user