diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-05-08 21:09:36 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-05-09 17:59:13 -0400 |
commit | 5c82f052c26303318e81ddd76475c1d188cc74f4 (patch) | |
tree | 3204ef94f2861224a380aa566728c02b4acd1fd9 /src/components/transformable.h | |
parent | 96e6f3231aed9919d660a06944f1d96dc8241f8e (diff) | |
download | therapy-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.h | 13 |
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 | ||
6 | class TransformableComponent : public Component { | 7 | class TransformableComponent : public Component { |
7 | public: | 8 | public: |
@@ -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 */ |