dcarlus / hARMful

Libraries for programming video games and interactive 2D/3D applications.
https://dcarlus.github.io/hARMful/
GNU General Public License v3.0
0 stars 0 forks source link

Operations order on CameraComponent gives different results #5

Closed dcarlus closed 4 years ago

dcarlus commented 5 years ago

Create a CameraComponent and its Entity. Setting the lookAt() of the CameraComponent before/after adding it to the Entity gives different results...

So...

m_cameraEntity -> addComponent(m_cameraComponent) ;
m_cameraComponent -> lookAt(Mind::Vector3f(0.f, 0.f, 0.f)) ;

is different from

m_cameraComponent -> lookAt(Mind::Vector3f(0.f, 0.f, 0.f)) ;
m_cameraEntity -> addComponent(m_cameraComponent) ;

The camera does not move the same way and do not look a fixed point in the second case (everything is right with the first code).

dcarlus commented 4 years ago

Fixed! 👍