2012-05-08 12:07:15 +00:00
|
|
|
#ifndef _PAYSAGES_QT_WANDERERCHUNK_H_
|
|
|
|
#define _PAYSAGES_QT_WANDERERCHUNK_H_
|
|
|
|
|
|
|
|
#include <QMutex>
|
|
|
|
#include <QImage>
|
|
|
|
#include <QGLWidget>
|
|
|
|
#include "../lib_paysages/renderer.h"
|
|
|
|
|
|
|
|
class WandererChunk
|
|
|
|
{
|
|
|
|
public:
|
2012-05-09 21:11:23 +00:00
|
|
|
WandererChunk(Renderer* renderer, double x, double z, double size, int nbchunks);
|
2012-05-08 12:07:15 +00:00
|
|
|
~WandererChunk();
|
|
|
|
|
2012-05-09 11:39:03 +00:00
|
|
|
bool maintain();
|
2012-05-09 16:26:07 +00:00
|
|
|
void updatePriority(CameraDefinition* camera);
|
2012-05-08 12:07:15 +00:00
|
|
|
void render(QGLWidget* widget);
|
|
|
|
|
2012-05-08 14:07:47 +00:00
|
|
|
Vector3 getCenter();
|
|
|
|
|
2012-05-09 16:26:07 +00:00
|
|
|
double priority;
|
2012-05-08 22:03:39 +00:00
|
|
|
|
2012-05-08 12:07:15 +00:00
|
|
|
private:
|
2012-05-08 22:03:39 +00:00
|
|
|
QMutex _lock_data;
|
|
|
|
Renderer* _renderer;
|
|
|
|
|
2012-05-08 12:07:15 +00:00
|
|
|
double _startx;
|
|
|
|
double _startz;
|
2012-05-08 22:03:39 +00:00
|
|
|
double _size;
|
2012-05-09 21:11:23 +00:00
|
|
|
double _overall_step;
|
|
|
|
bool _restart_needed;
|
2012-05-08 22:03:39 +00:00
|
|
|
|
|
|
|
double* _tessellation;
|
|
|
|
int _tessellation_max_size;
|
|
|
|
int _tessellation_current_size;
|
|
|
|
double _tessellation_step;
|
|
|
|
|
2012-05-08 12:07:15 +00:00
|
|
|
QImage* _texture;
|
|
|
|
GLuint _texture_id;
|
2012-05-08 22:03:39 +00:00
|
|
|
bool _texture_changed;
|
|
|
|
int _texture_max_size;
|
|
|
|
int _texture_current_size;
|
2012-05-08 12:07:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|