feat: started work on terrain editor tools
This commit is contained in:
parent
a61b52806a
commit
ac139f01b6
11 changed files with 423 additions and 0 deletions
39
modules/terrain/terrain.h
Normal file
39
modules/terrain/terrain.h
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
#pragma once
|
||||
|
||||
#include "core/templates/vector.h"
|
||||
#include "macros.h"
|
||||
#include "scene/main/node.h"
|
||||
class TerrainChunkMesh;
|
||||
class TerrainModifier;
|
||||
|
||||
class Terrain : public Node {
|
||||
GDCLASS(Terrain, Node);
|
||||
static void _bind_methods();
|
||||
void ready();
|
||||
void update_modifier_list();
|
||||
void construct_chunk_grid();
|
||||
void generate_meshes();
|
||||
|
||||
void child_entered(Node *node);
|
||||
void child_exiting(Node *node);
|
||||
|
||||
protected:
|
||||
void _notification(int what);
|
||||
|
||||
public:
|
||||
float height_at(Vector2 world_coordinate);
|
||||
|
||||
private:
|
||||
size_t side_length{ 100 };
|
||||
size_t chunk_size{ 10 };
|
||||
size_t detail{ 1 };
|
||||
|
||||
public:
|
||||
GET_SET_FNS(size_t, side_length);
|
||||
GET_SET_FNS(size_t, chunk_size);
|
||||
GET_SET_FNS(size_t, detail);
|
||||
|
||||
private:
|
||||
Vector<TerrainChunkMesh *> meshes;
|
||||
Vector<TerrainModifier *> modifiers;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue