1
0
Fork 0
Univerxel/src/contouring/Abstract.hpp

37 lines
1.5 KiB
C++

#pragma once
#include "../render/buffer/Abstract.hpp"
#include "../data/geometry/Frustum.hpp"
#include "../data/geometry/Faces.hpp"
#include "../world/forward.h"
/// Mesh creation
namespace contouring {
/// Generating mesh from world data
class Abstract {
public:
Abstract() { }
virtual ~Abstract() { }
/// Each frame ping.
/// Mostly used for cleanup and to flush buffers data using main thread
virtual void update(const voxel_pos &pos, const world::area_map &areas) = 0;
/// Chunk data change
/// @param offset priority position offset
virtual void onUpdate(const area_<chunk_pos> &pos, const chunk_pos &offset, const world::ChunkContainer &data, geometry::Faces neighbors) = 0;
/// Chunk existante ping
/// @note notify for chunks entering view while moving
virtual void onNotify(const area_<chunk_pos> &pos, const chunk_pos &offset, const world::ChunkContainer &data) = 0;
/// Display ImGui config
virtual void onGui() = 0;
/// Get options
virtual std::string getOptions() const = 0;
// Get camera recommended far range
virtual std::pair<float, float> getFarRange() const = 0;
/// Get buffers in frustum with model matrices
/// @note buffers invalidated after update
virtual void getModels(std::vector<std::pair<glm::mat4, buffer::Abstract *const>> &buffers, const std::optional<geometry::Frustum>& frustum, const glm::llvec3& offset, int density) = 0;
};
}