|
Building Game Engines
|
#include <TransformComponent.hpp>


Public Member Functions | |
| TransformComponent () | |
| ~TransformComponent () | |
| virtual void | Update () |
| virtual void | Render (SDL_Renderer *renderer) |
| std::pair< double, double > | GetPosition () |
| std::pair< double, double > | GetVelocity () |
| std::pair< int, int > | GetDimensions () |
| void | SetPosition (double x, double y) |
| void | SetVelocity (double x, double y) |
| void | SetVelocityX (double x) |
| void | SetVelocityY (double y) |
| void | SetWidth (int w) |
| void | SetHeight (int h) |
Public Member Functions inherited from Component | |
| Component () | |
| virtual | ~Component ()=0 |
Static Public Attributes | |
| static const int | hash = 10 |
A component to give a game object the ability to transform
| TransformComponent::TransformComponent | ( | ) |
Constructor
| TransformComponent::~TransformComponent | ( | ) |
Destructor
| std::pair< int, int > TransformComponent::GetDimensions | ( | ) |
Gets the dimensions of the game object this component is attached to
| std::pair< double, double > TransformComponent::GetPosition | ( | ) |
Gets the position of the game object this component is attached to
| std::pair< double, double > TransformComponent::GetVelocity | ( | ) |
Gets the velocity of the game object this component is attached to
|
virtual |
Does nothing
Implements Component.
| void TransformComponent::SetHeight | ( | int | h | ) |
Sets the height of the game object this component is attached to
| void TransformComponent::SetPosition | ( | double | x, |
| double | y | ||
| ) |
Sets the position of the game object this component is attached to
| void TransformComponent::SetVelocity | ( | double | x, |
| double | y | ||
| ) |
Sets the velocity of the game object this component is attached to
| void TransformComponent::SetVelocityX | ( | double | x | ) |
Sets the x velocity of the game object this component is attached to
| void TransformComponent::SetVelocityY | ( | double | y | ) |
Sets the y velocity of the game object this component is attached to
| void TransformComponent::SetWidth | ( | int | w | ) |
Sets the width of the game object this component is attached to
|
virtual |
Updates the position and velocity of the game object this component is attached to
Implements Component.
|
static |
1.8.13