summary refs log tree commit diff stats
path: root/src/components/transformable.h
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2018-05-08 21:09:36 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2018-05-09 17:59:13 -0400
commit5c82f052c26303318e81ddd76475c1d188cc74f4 (patch)
tree3204ef94f2861224a380aa566728c02b4acd1fd9 /src/components/transformable.h
parent96e6f3231aed9919d660a06944f1d96dc8241f8e (diff)
downloadtherapy-5c82f052c26303318e81ddd76475c1d188cc74f4.tar.gz
therapy-5c82f052c26303318e81ddd76475c1d188cc74f4.tar.bz2
therapy-5c82f052c26303318e81ddd76475c1d188cc74f4.zip
Simplified positions/sizes with vectors
Positions and sizes are now stored as vectors (of doubles and ints, respectively). This allows for at least minor code simplification in many places, and cleans up the CollisionParams code in PonderingSystem quite a bit.
Diffstat (limited to 'src/components/transformable.h')
-rw-r--r--src/components/transformable.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/components/transformable.h b/src/components/transformable.h index 6f3c2ef..bb21996 100644 --- a/src/components/transformable.h +++ b/src/components/transformable.h
@@ -2,6 +2,7 @@
2#define LOCATABLE_H_39E526CA 2#define LOCATABLE_H_39E526CA
3 3
4#include "component.h" 4#include "component.h"
5#include "vector.h"
5 6
6class TransformableComponent : public Component { 7class TransformableComponent : public Component {
7public: 8public:
@@ -15,24 +16,20 @@ public:
15 * so, use PonderingSystem::unferry on the body to ensure that it is not 16 * so, use PonderingSystem::unferry on the body to ensure that it is not
16 * ferried. 17 * ferried.
17 */ 18 */
18 double x; 19 vec2d pos;
19 double y;
20 20
21 /** 21 /**
22 * The size of the entity. 22 * The size of the entity.
23 */ 23 */
24 int w; 24 vec2i size;
25 int h;
26 25
27 /** 26 /**
28 * For prototypes, the original coordinates and size of the entity. 27 * For prototypes, the original coordinates and size of the entity.
29 * 28 *
30 * @managed_by RealizingSystem 29 * @managed_by RealizingSystem
31 */ 30 */
32 double origX; 31 vec2d origPos;
33 double origY; 32 vec2i origSize;
34 int origW;
35 int origH;
36}; 33};
37 34
38#endif /* end of include guard: LOCATABLE_H_39E526CA */ 35#endif /* end of include guard: LOCATABLE_H_39E526CA */