VEGO-Engine
0.1
Loading...
Searching...
No Matches
TransformComponent.h
1
#pragma once
2
3
#include "Component.h"
4
#include "Vector2D.h"
5
#include "Constants.h"
6
#include "DataComponent.h"
7
9
class
TransformComponent
:
public
Component
10
{
11
public
:
12
Vector2D position;
// TODO: change to int to save CPU time -> possibly subpixel coordinates
13
18
Vector2D
direction
;
19
20
int
height = 32;
21
int
width = 32;
22
float
scale = 1;
23
25
27
explicit
TransformComponent
(
float
scale = 1);
28
32
TransformComponent
(
float
x,
float
y,
float
scale = 1);
33
39
TransformComponent
(
float
x,
float
y,
int
w,
int
h,
float
scale = 1);
40
41
void
init()
override
;
42
void
update(uint_fast16_t diffTime)
override
;
43
void
setPositionAfterCollision(Vector2D& positionChange);
44
int
getSpeed();
45
46
};
TransformComponent::direction
Vector2D direction
The direction in which the entity is moving. (0, 0) is the default and signifies no movement.
Definition
TransformComponent.h:18
TransformComponent::TransformComponent
TransformComponent(float scale=1)
Definition
TransformComponent.cpp:16
include
TransformComponent.h
Generated by
1.13.2