38 std::shared_ptr<Mesh>
mesh;
75 void add_level(std::shared_ptr<Mesh> mesh,
float max_distance);
88 std::shared_ptr<Mesh>
get_mesh(
float distance_sq)
const;
100 std::shared_ptr<Mesh>
get_mesh(
const glm::vec3 &camera_pos,
const glm::vec3 &object_pos)
const;
128 inline void clear() { m_levels.clear(); }
133 std::vector<LODLevel> m_levels;
LOD()=default
Default constructor.
~LOD()=default
Default destructor.
bool has_levels() const
Checks if there are any LOD levels defined.
Definition lod.hpp:123
size_t get_level_count() const
Retrieves the number of LOD levels.
Definition lod.hpp:107
void clear()
Clears all LOD levels.
Definition lod.hpp:128
std::shared_ptr< Mesh > get_mesh(float distance_sq) const
Retrieves the appropriate mesh based on the squared distance.
Definition lod.cpp:14
const LODLevel & get_level(size_t index) const
Retrieves a specific LOD level by index.
Definition lod.hpp:116
void add_level(std::shared_ptr< Mesh > mesh, float max_distance)
Adds a new LOD level.
Definition lod.cpp:8
Defines the Mesh class for managing 3D mesh data.
Namespace for scene-related classes and functions.
Definition camera.cpp:7
Forward declarations for Assimp Material structure.
Definition model_loader.cpp:12
Level of Detail (LOD) structure representing a single LOD level.
Definition lod.hpp:36
std::shared_ptr< Mesh > mesh
Shared pointer to the mesh representing this LOD level.
Definition lod.hpp:38
LODLevel(std::shared_ptr< Mesh > m, float distance)
Constructor for LODLevel.
Definition lod.hpp:49
float max_distance_sq
Maximum distance squared at which this LOD level is used.
Definition lod.hpp:41