summaryrefslogtreecommitdiff
path: root/src/acceleration.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/acceleration.cpp')
-rw-r--r--src/acceleration.cpp32
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();
+}