Initial commit
This commit is contained in:
23
modules/world/terrain_object.h
Normal file
23
modules/world/terrain_object.h
Normal 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
|
||||
|
||||
Reference in New Issue
Block a user