Skip to content

Commit

Permalink
Merge pull request #11 from AEspinosaDev/IBL
Browse files Browse the repository at this point in the history
Fixed bug in scene objects children transform
  • Loading branch information
AEspinosaDev authored Oct 16, 2024
2 parents c8d752f + 10682a7 commit d9981b9
Show file tree
Hide file tree
Showing 3 changed files with 259 additions and 156 deletions.
7 changes: 3 additions & 4 deletions include/engine/core/object3D.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ class Object3D

virtual Mat4 get_model_matrix()
{
// Dirty flag
if (isDirty)
{

Expand All @@ -215,10 +216,8 @@ class Object3D

isDirty = false;
}
// Dirty flag
m_transform.worldMatrix =
m_parent ? m_parent->get_model_matrix() * m_transform.worldMatrix : m_transform.worldMatrix;
return m_transform.worldMatrix;

return m_parent ? m_parent->get_model_matrix() * m_transform.worldMatrix : m_transform.worldMatrix;
}

virtual void add_child(Object3D *child)
Expand Down
Loading

0 comments on commit d9981b9

Please sign in to comment.