init versie
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
#ifndef TILE_H
|
||||
#define TILE_H
|
||||
#include <QOpenGLShaderProgram>
|
||||
#include <QOpenGLBuffer>
|
||||
#include <QOpenGLVertexArrayObject>
|
||||
#include <QOpenGLTexture>
|
||||
#include "vertex.h"
|
||||
#include "terrain.h"
|
||||
#include "tilevertexinfo.h"
|
||||
#include <QVector>
|
||||
#include "face.h"
|
||||
class QSceneRenderer;
|
||||
|
||||
class Tile
|
||||
{
|
||||
public:
|
||||
Tile();
|
||||
void init(QSceneRenderer* s,int x, int y);
|
||||
void paint(QMatrix4x4 p,QVector3D& cameraPosition,QVector3D& cameraUpDirection,QMatrix4x4& vMatrix, float zRot);
|
||||
void buildVertices();
|
||||
void buildNormals();
|
||||
bool isInitialized() const { return m_initialized; }
|
||||
bool normalsBuilt() const { return m_normalsBuilt; }
|
||||
void ensureInitialized(QSceneRenderer* s, int x, int y);
|
||||
void ensureNormalsBuilt();
|
||||
void findFaces(std::vector<Face *> &vec, QVector2D s);
|
||||
protected:
|
||||
void addTriangleVertices(int &cnt, QVector2D t1, QVector2D t2, QVector2D t3,int level, int hex, int l1);
|
||||
void drawSubTriangleVertices(int &cnt, QVector2D t1, QVector2D t2, QVector2D t3, int hex, int l1, int l2);
|
||||
void buildHeights();
|
||||
|
||||
QOpenGLBuffer m_heightsbuffer;
|
||||
static QOpenGLBuffer m_vertex;
|
||||
static QOpenGLVertexArrayObject m_object;
|
||||
static QOpenGLShaderProgram *m_program;
|
||||
QSceneRenderer *m_scene;
|
||||
static int m_numVertex;
|
||||
TileVertexInfo * m_tilevertices;
|
||||
|
||||
std::vector<Face> m_faces;
|
||||
Face m_face[6];
|
||||
|
||||
int m_x;
|
||||
int m_y;
|
||||
|
||||
float m_startpoint_x;
|
||||
float m_startpoint_y;
|
||||
bool m_initialized;
|
||||
bool m_normalsBuilt;
|
||||
static Vertex * m_vertices;
|
||||
static QOpenGLTexture * m_texture;
|
||||
static QOpenGLTexture * m_texture_border;
|
||||
static QOpenGLTexture * m_texture_rock;
|
||||
static QImage * m_image;
|
||||
static QImage * m_image_rock;
|
||||
static QImage * m_image_border;
|
||||
};
|
||||
|
||||
#endif // TILE_H
|
||||
Reference in New Issue
Block a user