diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-12-20 18:57:23 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-12-20 18:57:23 -0500 |
commit | 62069b31c7d23055f999c70a58ccf7d58acd333f (patch) | |
tree | 7ea4c57e74d978a297d34cf61d9c85db846e8900 /src/components | |
parent | 90aadf3844386824140a20d7fbb847bc16009a94 (diff) | |
download | therapy-62069b31c7d23055f999c70a58ccf7d58acd333f.tar.gz therapy-62069b31c7d23055f999c70a58ccf7d58acd333f.tar.bz2 therapy-62069b31c7d23055f999c70a58ccf7d58acd333f.zip |
The acceleration of a Ponderable entity is now only really a magnitude. The direction of acceleration is such that the velocity goes toward the target velocity. If accelerating would cause the velocity to pass the target velocity, it is instead set to the target. This is currently being used to 1) generalize terminal velocity due to gravity, and 2) allow an Orientable entity to accelerate quickly to a walking speed (and to a halt) rather than instantly achieve it.
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/ponderable.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/components/ponderable.h b/src/components/ponderable.h index 221d267..cc42048 100644 --- a/src/components/ponderable.h +++ b/src/components/ponderable.h | |||
@@ -56,6 +56,11 @@ public: | |||
56 | vec2d accel = { 0.0, 0.0 }; | 56 | vec2d accel = { 0.0, 0.0 }; |
57 | 57 | ||
58 | /** | 58 | /** |
59 | * The target velocity of the body. | ||
60 | */ | ||
61 | vec2d targetVel = { 0.0, 0.0 }; | ||
62 | |||
63 | /** | ||
59 | * The type of physical body that the entity is meant to assume. The body will | 64 | * The type of physical body that the entity is meant to assume. The body will |
60 | * be acted upon differently based on this. See the enumeration above for more | 65 | * be acted upon differently based on this. See the enumeration above for more |
61 | * details. | 66 | * details. |