diff options
author | Simponic <loganthebean222@gmail.com> | 2020-11-06 11:48:27 -0700 |
---|---|---|
committer | Simponic <loganthebean222@gmail.com> | 2020-11-06 11:48:27 -0700 |
commit | f4e392912a3812b602f787c6db30296cea14962e (patch) | |
tree | 0207b67ab6bb4bca46f56b2fa51d23b5433bb2f4 /src/acceleration.cpp | |
download | tozy-f4e392912a3812b602f787c6db30296cea14962e.tar.gz tozy-f4e392912a3812b602f787c6db30296cea14962e.zip |
Added files
Diffstat (limited to 'src/acceleration.cpp')
-rw-r--r-- | src/acceleration.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/acceleration.cpp b/src/acceleration.cpp new file mode 100644 index 0000000..92dd2ac --- /dev/null +++ b/src/acceleration.cpp @@ -0,0 +1,32 @@ +#include "acceleration.h" + +Acceleration :: Acceleration() { + setD2x(0.0f); + setD2y(0.0f); +} + +Acceleration :: Acceleration(const float d2x, const float d2y) { + setD2x(d2x); + setD2y(d2y); +} + +void Acceleration :: setD2x(const float d2x) { + this->d2x = d2x; +} + +void Acceleration :: setD2y(const float d2y) { + this->d2y = d2y; +} + +float Acceleration :: getD2x() { + return this->d2x; +} + +float Acceleration :: getD2y() { + return this->d2y; +} + +void Acceleration :: addAcceleration(Acceleration &acc) { + this->d2x += acc.getD2x(); + this->d2y += acc.getD2y(); +} |