summary refs log tree commit diff stats
path: root/src/components
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2018-12-20 18:57:23 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2018-12-20 18:57:23 -0500
commit62069b31c7d23055f999c70a58ccf7d58acd333f (patch)
tree7ea4c57e74d978a297d34cf61d9c85db846e8900 /src/components
parent90aadf3844386824140a20d7fbb847bc16009a94 (diff)
downloadtherapy-master.tar.gz
therapy-master.tar.bz2
therapy-master.zip
Added target velocity HEAD master
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.h5
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.