6#include <brenta/renderer/renderer.hpp>
7#include <brenta/node.hpp>
11void Node::update_world_matrix()
13 glm::mat4 parent_matrix = glm::mat4(1.0f);
15 if (
auto parent_ptr = parent->lock())
17 parent_matrix = parent_ptr->world_matrix;
20 this->world_matrix = parent_matrix * this->transform.get_model_matrix();
22 for (
auto& child : this->children)
23 child->update_world_matrix();
26void Node::update(
float delta_time)
28 Script::current_node =
this;
30 this->script->update(delta_time);
32 for (
auto& component : this->components)
33 component->update(delta_time);
35 for (
auto& child : this->children)
36 child->update(delta_time);
42 for (
auto& component : this->components)
43 component->draw(this->world_matrix);
45 for (
auto& child : this->children)