Transform (component)#
Component defining the position of an Entity on screen. Other components may depend on this one for getting the position of the entity on the screen.
Warning
Velocity/Speed members should later be changed to depend on real time instead of tick (for example pixels/ms instead of pixels/tick). That way, the FPS can be fine-tuned without messing these up.
Typedefs
-
using vec = Eigen::Vector2f
-
struct Transform : public Component#
- #include <Transform.hpp>
Component defining the position of an Entity on screen. Other components such as the Sprite and the ::KeyboardPlayerr may depend on this Component.
Public Functions
-
inline Transform()#
Default constructor (no arguments). Initializes position and velocity to zero, but speed to 10.
-
inline Transform(float x, float y)#
Setting position (calls Transform::set_position)
-
virtual void update() override#
Defined in Transform.cpp (conciseness)
-
inline void set_position(float x, float y)#
-
inline void set_velocity(float x, float y)#
-
inline Transform()#