#ifndef CLIENT_WORLD_BLOCK_HH_ #define CLIENT_WORLD_BLOCK_HH_ #include #include #include #include #include #include #include "shared/world/block.hh" namespace client { namespace world { // Doesn't add any data, just information for rendering. class block : public shared::world::block { public: struct glvert { glm::vec3 vertice; glm::vec3 texture; }; using glface_t = std::array; // array of verts (a face) using glfaces_t = std::vector; // vector of faces (a block) // Render types refer to how the block should be culled when making the vbo. enum class draw_type { block, // face testing custom, // no testing }; public: static enum draw_type get_draw_type(const enum block::type& type) noexcept; static const glfaces_t& get_glfaces(const enum block::type& type) noexcept; public: template block(Args&&... args) noexcept : block(std::forward(args)...) {} public: enum draw_type get_draw_type() const noexcept { return get_draw_type(this->type); } const glfaces_t& get_glfaces() const noexcept { return get_glfaces(this->type); } }; } // namespace world } // namespace client #endif