Initial commit

This commit is contained in:
Segey Lapin
2021-07-31 03:30:12 +03:00
commit 91cf9d2d34
249 changed files with 27582 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
#ifndef TERRAIN_OBJECT_H
#define TERRAIN_OBJECT_H
#include <scene/resources/packed_scene.h>
class TerrainObject {
List<Ref<Mesh> > lods;
public:
inline void add_mesh(Ref<Mesh> &mesh)
{
lods.push_back(mesh);
}
inline Ref<Mesh> get_mesh(int id) const
{
id = id * (id < lods.size()) + (lods.size() - 1) * (id >= lods.size());
return lods[id];
}
inline int get_lod_count() const
{
return lods.size();
}
static List<TerrainObject> get_objects(const PackedScene *sc, const NodePath &path);
};
#endif