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/ponderable.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/ponderable.h')
-rw-r--r-- | src/components/ponderable.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/components/ponderable.h b/src/components/ponderable.h index eff20e9..c0312b4 100644 --- a/src/components/ponderable.h +++ b/src/components/ponderable.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <set> | 4 | #include <set> |
5 | #include "component.h" | 5 | #include "component.h" |
6 | #include "entity_manager.h" | 6 | #include "entity_manager.h" |
7 | #include "vector.h" | ||
7 | 8 | ||
8 | class PonderableComponent : public Component { | 9 | class PonderableComponent : public Component { |
9 | public: | 10 | public: |
@@ -45,14 +46,12 @@ public: | |||
45 | /** | 46 | /** |
46 | * The velocity of the body. | 47 | * The velocity of the body. |
47 | */ | 48 | */ |
48 | double velX = 0.0; | 49 | vec2d vel = { 0.0, 0.0 }; |
49 | double velY = 0.0; | ||
50 | 50 | ||
51 | /** | 51 | /** |
52 | * The acceleration of the body. | 52 | * The acceleration of the body. |
53 | */ | 53 | */ |
54 | double accelX = 0.0; | 54 | vec2d accel = { 0.0, 0.0 }; |
55 | double accelY = 0.0; | ||
56 | 55 | ||
57 | /** | 56 | /** |
58 | * The type of physical body that the entity is meant to assume. The body will | 57 | * The type of physical body that the entity is meant to assume. The body will |
@@ -89,8 +88,7 @@ public: | |||
89 | * | 88 | * |
90 | * @managed_by PonderingSystem | 89 | * @managed_by PonderingSystem |
91 | */ | 90 | */ |
92 | double relX; | 91 | vec2d rel = { 0.0, 0.0 }; |
93 | double relY; | ||
94 | 92 | ||
95 | /** | 93 | /** |
96 | * The bodies that are being ferried by this body. | 94 | * The bodies that are being ferried by this body. |