28 lines
518 B
C++
28 lines
518 B
C++
#ifndef WORLD_H
|
|
#define WORLD_H
|
|
|
|
#include <unordered_map>
|
|
#include <optional>
|
|
|
|
#include <glm/glm.hpp>
|
|
|
|
#include "Chunk.h"
|
|
|
|
class World
|
|
{
|
|
public:
|
|
std::unordered_map<glm::ivec3, Chunk> chunks;
|
|
|
|
World();
|
|
|
|
void set_voxel(glm::ivec3 position, VoxelKind kind);
|
|
|
|
std::optional<std::pair<glm::ivec3, glm::ivec3>> raycast_voxel(glm::vec3 start, glm::vec3 direction, float max_dist);
|
|
|
|
VoxelKind get_voxel(glm::ivec3 position);
|
|
|
|
Chunk* get_or_create_chunk(glm::ivec3 chunk_position);
|
|
};
|
|
|
|
#endif WORLD_H
|