SDLPP: Allow changing coliders' position

Requires `updateSizeAndPosition` to be run on the parent container
This commit is contained in:
2021-05-25 22:05:00 +02:00
parent 79d5f348c4
commit 0c4f2482c7
2 changed files with 10 additions and 0 deletions
+8
View File
@@ -30,6 +30,14 @@ void CollisionPolygon::updateCollision( int x, int y, int w, int h,
position = Vec2D< int >( original.getX() * w + x, original.getY() * h + y );
}
void CollisionPolygon::setPos(const Vec2D<double> &pos) {
original = pos;
}
void CollisionPolygon::setPos(double x, double y) {
setPos({x, y});
}
int CollisionPolygon::getX() const {
return position.getX();
}