2013-11-05 10:45:26 +00:00
|
|
|
#ifndef EXPLORERCHUNKTERRAIN_H
|
|
|
|
#define EXPLORERCHUNKTERRAIN_H
|
2012-06-08 12:28:46 +00:00
|
|
|
|
2013-12-23 13:09:52 +00:00
|
|
|
#include "opengl_global.h"
|
2013-11-14 17:47:03 +00:00
|
|
|
|
2013-12-23 13:09:52 +00:00
|
|
|
#include <QMutex>
|
|
|
|
class QImage;
|
|
|
|
class QOpenGLTexture;
|
2012-06-08 12:28:46 +00:00
|
|
|
|
2013-11-05 10:45:26 +00:00
|
|
|
namespace paysages {
|
|
|
|
namespace opengl {
|
|
|
|
|
2013-12-23 13:09:52 +00:00
|
|
|
class OPENGLSHARED_EXPORT ExplorerChunkTerrain
|
2012-06-08 12:28:46 +00:00
|
|
|
{
|
|
|
|
public:
|
2013-12-23 13:09:52 +00:00
|
|
|
ExplorerChunkTerrain(OpenGLRenderer* renderer, double x, double z, double size, int nbchunks, double water_height);
|
2012-06-08 12:28:46 +00:00
|
|
|
~ExplorerChunkTerrain();
|
2013-01-19 22:42:50 +00:00
|
|
|
|
2013-12-23 13:09:52 +00:00
|
|
|
bool maintain();
|
|
|
|
void updatePriority(CameraDefinition* camera);
|
|
|
|
void render(OpenGLFunctions* functions);
|
|
|
|
|
|
|
|
void askReset();
|
|
|
|
void setMaxTextureSize(int size);
|
|
|
|
|
2012-06-08 12:28:46 +00:00
|
|
|
bool onMaintainEvent();
|
2012-06-17 09:40:40 +00:00
|
|
|
double getDisplayedSizeHint(CameraDefinition* camera);
|
|
|
|
Color getTextureColor(double x, double y);
|
2013-01-19 22:42:50 +00:00
|
|
|
|
2013-12-23 13:09:52 +00:00
|
|
|
double priority;
|
|
|
|
|
2012-06-08 12:28:46 +00:00
|
|
|
private:
|
|
|
|
Vector3 getCenter();
|
2013-01-19 22:42:50 +00:00
|
|
|
|
2012-06-17 09:40:40 +00:00
|
|
|
double _startx;
|
|
|
|
double _startz;
|
|
|
|
double _size;
|
|
|
|
double _overall_step;
|
2013-01-19 22:42:50 +00:00
|
|
|
|
2013-02-05 21:25:30 +00:00
|
|
|
double _distance_to_camera;
|
|
|
|
double _water_height;
|
|
|
|
bool _overwater;
|
|
|
|
|
2012-06-17 09:40:40 +00:00
|
|
|
double* _tessellation;
|
2012-06-08 12:28:46 +00:00
|
|
|
int _tessellation_max_size;
|
|
|
|
int _tessellation_current_size;
|
2012-06-17 09:40:40 +00:00
|
|
|
double _tessellation_step;
|
2013-01-19 22:42:50 +00:00
|
|
|
|
2013-12-23 13:09:52 +00:00
|
|
|
QMutex _lock_data;
|
|
|
|
|
|
|
|
OpenGLRenderer* _renderer;
|
|
|
|
ColorProfile* _color_profile;
|
|
|
|
|
|
|
|
bool _reset_needed;
|
|
|
|
|
|
|
|
QImage* _texture;
|
|
|
|
QOpenGLTexture* texture;
|
|
|
|
bool _texture_changed;
|
|
|
|
int _texture_current_size;
|
|
|
|
int _texture_max_size;
|
2012-06-08 12:28:46 +00:00
|
|
|
};
|
|
|
|
|
2013-11-05 10:45:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // EXPLORERCHUNKTERRAIN_H
|