19#ifndef HEADER_LOD_NODE_HPP
20#define HEADER_LOD_NODE_HPP
24#include <ISceneNode.h>
30 namespace scene {
class ISceneManager;
class ISceneNode; }
41 const int ESNT_LOD_NODE = MAKE_IRR_ID(
'l',
'o',
'd',
'n');
52 core::matrix4 RelativeTransformationMatrix;
53 core::aabbox3d<f32> Box;
55 std::vector<int> m_detail;
56 std::vector<irr::scene::ISceneNode*> m_nodes;
58 std::set<scene::ISceneNode*> m_nodes_set;
60 std::string m_group_name;
66 std::unique_ptr<int> m_current_level;
71 bool m_update_box_every_frame;
74 LODNode(std::string group_name, scene::ISceneNode* parent, scene::ISceneManager* mgr, s32
id=-1);
82 void updateVisibility(
bool* shown = NULL);
101 void add(
int level, scene::ISceneNode* node,
bool reparent);
113 if (m_nodes.size() > 0)
return m_nodes[0];
117 std::vector<scene::ISceneNode*>& getAllNodes() {
return m_nodes; }
124 virtual void OnRegisterSceneNode();
125 virtual void render();
127 virtual scene::ESCENE_NODE_TYPE getType()
const {
return (scene::ESCENE_NODE_TYPE)scene::ESNT_LOD_NODE; }
129 const std::string& getGroupName()
const {
return m_group_name; }
manages level-of-detail
Definition: lod_node.hpp:50
virtual const core::aabbox3d< f32 > & getBoundingBox() const
returns the axis aligned bounding box of this node
Definition: lod_node.hpp:78
int getLevel()
Returns the level to use, or -1 if the object is too far away.
Definition: lod_node.cpp:73
void autoComputeLevel(float scale)
This method can be used to automatically compute LoD level.
Definition: lod_node.cpp:198
scene::ISceneNode * getFirstNode()
Get the highest level of detail node.
Definition: lod_node.hpp:111
int m_forced_lod
The normal level of detail can be overwritten.
Definition: lod_node.hpp:64
virtual void OnAnimate(u32 timeMs)
OnAnimate() is called just before rendering the whole scene.
Definition: lod_node.cpp:109
void add(int level, scene::ISceneNode *node, bool reparent)
Adds a node associated with a level of detail.
Definition: lod_node.cpp:238
void forceLevelOfDetail(int n)
Forces the level of detail to be n.
Definition: lod_node.cpp:103