aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Transform.cpp
blob: 32b44e1ecaf8d191a6b76bb79522937fb1aca5d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "../util/dbg.h"

#include "Transform.h"

using namespace crepe;
using namespace std;

Transform::Transform(game_object_id_t id, const vec2 & point, double rotation, double scale)
	: Component(id),
	  position(point),
	  rotation(rotation),
	  scale(scale) {
	dbg_trace();
}

unique_ptr<Component> Transform::save() const {
	return unique_ptr<Component>{new Transform(*this)};
}

void Transform::restore(const Component & snapshot) {
	*this = static_cast<const Transform &>(snapshot);
}