12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- #ifndef BLOCKRENDERER_H
- #define BLOCKRENDERER_H
- #include <vector>
- #include "client/engine/Mesh.h"
- using namespace std;
- class BlockRenderer
- {
- public:
- BlockRenderer();
-
- void addTriangle(float p1x, float p1y, float p1z, float p1nx, float p1ny, float p1nz, float p1texX, float p1texY,
- float p2x, float p2y, float p2z, float p2nx, float p2ny, float p2nz, float p2texX, float p2texY,
- float p3x, float p3y, float p3z, float p3nx, float p3ny, float p3nz, float p3texX, float p3texY,
- int cullData);
-
- void addCuboid(float sx, float sy, float sz, float ex, float ey, float ez,
- float topTexStartX, float topTexStartY, float topTexEndX, float topTexEndY,
- float bottomTexStartX, float bottomTexStartY, float bottomTexEndX, float bottomTexEndY,
- float northTexStartX, float northTexStartY, float northTexEndX, float northTexEndY,
- float southTexStartX, float southTexStartY, float southTexEndX, float southTexEndY,
- float eastTexStartX, float eastTexStartY, float eastTexEndX, float eastTexEndY,
- float westTexStartX, float westTexStartY, float westTexEndX, float westTexEndY);
-
- void addToMesh(Mesh& m, int offsetX, int offsetY, int offsetZ, int cullData) const;
-
- private:
- struct Triangle
- {
- float p1x;
- float p1y;
- float p1z;
-
- float p1nx;
- float p1ny;
- float p1nz;
-
- float p1texX;
- float p1texY;
-
- float p2x;
- float p2y;
- float p2z;
-
- float p2nx;
- float p2ny;
- float p2nz;
-
- float p2texX;
- float p2texY;
-
- float p3x;
- float p3y;
- float p3z;
-
- float p3nx;
- float p3ny;
- float p3nz;
-
- float p3texX;
- float p3texY;
-
- int cullData;
- };
-
- vector<Triangle> data;
- };
- #endif
|