27 lines
555 B
C++
27 lines
555 B
C++
#pragma once
|
|
|
|
#include "scene/3d/mesh_instance_3d.h"
|
|
class TerrainMeshGenerator;
|
|
|
|
class TerrainChunk : public MeshInstance3D {
|
|
GDCLASS(TerrainChunk, MeshInstance3D);
|
|
static void _bind_methods();
|
|
void ready();
|
|
void on_terrain_changed();
|
|
|
|
protected:
|
|
void _notification(int what);
|
|
|
|
public:
|
|
void set_size(float size);
|
|
float get_size() const;
|
|
void set_lod1_detail(int detail);
|
|
int get_lod1_detail() const;
|
|
|
|
private:
|
|
Ref<ArrayMesh> lod1{ memnew(ArrayMesh) };
|
|
TerrainMeshGenerator *generator{ nullptr };
|
|
int lod1_detail{ 100 };
|
|
float size{ 50 };
|
|
};
|