16 std::vector<std::string>
split(
const std::string &input,
const std::string& separator);
21 using NodeType = uint64_t;
22 const NodeType NodeTypeALL = 0;
48 throw std::invalid_argument(
"Node parent is not in the current scene!");
59 child->parent->_remove_child(child);
63 children.push_back(child);
80 throw std::invalid_argument(
"Node parent is not in the current scene!");
83 if (new_parent == parent)
266 std::vector<NodePtr> children;
281 void _remove_child(
const NodePtr& child)
noexcept
284 auto it = find(children.begin(), children.end(), child);
286 if (it != children.end())
291 child->forceDirty(
true);
294 mutable glm::mat4 _model_matrix = glm::mat4(1.0f);
296 mutable glm::mat4 _absolute_model_matrix = glm::mat4(1.0f);
299 const std::vector<std::string>::iterator& begin,
300 const std::vector<std::string>::iterator& end
306 bool _has_dirty_parents()
const;
311 NodePtr _fetch_dirty_parent()
const;
Axis-aligned bounding box.
Definition aabb.h:13
Scene node.
Definition node.h:30
NodePtr searchFromThisNode(const std::string &path, const std::string &separator) noexcept
search starting from this node
void setChild(const NodePtr &child)
Change the parent of a node to be this one.
Definition node.h:44
bool is_active
Toggle to check if the Node is active.
Definition node.h:253
std::string name
Name, used as identifier for search.
Definition node.h:256
NodePtr search(const std::string path, const std::string separator="/")
Search for a node among children using a name path.
Definition node.h:138
const AABB getEnglobingBoundingBox() const
Compute englobing bounding box including all children ones.
void setParent(const NodePtr &new_parent)
Change the parent of this node to "parent".
Definition node.h:76
void moveToRoot() noexcept
Detach the node from parent to make it a root node.
Definition node.h:105
void * user_data
Custom user data, you can use it to store flags / pointer / physics / etc... related to this node.
Definition node.h:246
Transform getAbsoluteTransform() const
Get Node transform relative from world origin.
Definition node.h:179
const glm::mat4 & getAbsoluteModelMatrix() const
Get absolute model matrix (by taking the parents into account)
void generateModel(const bool recursive=true) const
Force regeneration of Models Matrices.
AABB aabb
Computed AABB (taking node transform into account)
Definition node.h:279
NodePtr scene_data
Scene pointer to this node.
Definition node.h:239
glm::vec3 getAbsolutePosition() const
Get Node position from world origin.
Definition node.h:187
AABB raw_aabb
Raw bounding box (ie. without taking node transform)
Definition node.h:262
const AABB & getBoundingBox() const
Recompute and return bounding box from raw AABB.
const glm::mat4 getAbsoluteInverseModelMatrix() const
Get absolute inverse model matrix (by taking the parents into account)
Definition node.h:204
const std::string getAbsoluteName(const std::string &separator="/") const noexcept
Get absolute name (from the hierarchy)
Definition node.h:127
Scene related management (Render-agnostic Geometry, Manger, etc...)
Definition debug.h:19
std::vector< std::string > split(const std::string &input, const std::string &separator)
Wrapper to a node reference to use pointers to node even if the actual node moves in memory.
Definition node_ptr.h:19
SceneType * scene
Scene containing the Node.
Definition node_ptr.h:59