Walls And Holes  1
abstractpolygontilemesher.h
Go to the documentation of this file.
1 #ifndef POLYGONMESHMAKER_H
2 #define POLYGONMESHMAKER_H
3 
4 #include "m2mtilemesher.h"
5 #include "polygon.h"
6 #include "m2mpartialmesh.h"
7 
8 namespace M2M {
9 
11 {
12 public:
14 
15  QVector<QSharedPointer<SimpleTexturedObject>> makeMesh(QVector2D offset);
16 
17 protected:
18  //Justification of heightAndMAterial:
19  //Some meshers may want to not use this tiles height and material, so the mesher can handle an optional vector of tiles
20  //The vector must either be left empty, or filled to equal the size of the main return vector
21  virtual QVector<Triplet<BetterPolygon, QVector<float>, QVector<bool>>> topPolygons(QVector<const Tile *> *heightAndMaterial) = 0;
22 
23 private:
24  PartialMeshData makeTop(const BetterPolygon &polygon,
25  float height,
26  const TileMaterial *material) const;
27  PartialMeshData makeSide(const BetterPolygon &polygon,
28  float startHegiht,
29  const QVector<float> endHeight,
30  const QVector<bool> dropWall,
31  const TileMaterial *material) const;
32 };
33 
34 }
35 
36 #endif // POLYGONMESHMAKER_H
virtual QVector< Triplet< BetterPolygon, QVector< float >, QVector< bool > > > topPolygons(QVector< const Tile *> *heightAndMaterial)=0
Definition: m2mtilemesher.h:14
Class to allow piece-by-piece mesh construction.
Definition: m2mpartialmesh.h:201
Definition: abstractpolygontilemesher.h:8
AbstractPolygonTileMesher(TileNeighborhoodInfo nbhd)
Definition: abstractpolygontilemesher.cpp:5
QVector< QSharedPointer< SimpleTexturedObject > > makeMesh(QVector2D offset)
makeMesh Creates the mesh for this tile.
Definition: abstractpolygontilemesher.cpp:8
Definition: abstractpolygontilemesher.h:10
The Polygon class.
Definition: polygon.h:22
A collection of methods for generating tile mesh data.
Definition: m2mtilemesher.h:36
Definition: tilematerial.h:8