summaryrefslogtreecommitdiff
path: root/src/acceleration.cpp
blob: 92dd2acd61eeaf67ee1d0cd1a128bbd90b413769 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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();
}