summaryrefslogtreecommitdiff
path: root/assetFactory/mutation.cpp
blob: 6695dff79ece93aed6524c5262c840b30ab89f39 (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
#include "mutation.h"
#include <algorithm>
#include <glm/gtx/transform.hpp>
#include <maths.h>

Mutation::Matrix
Mutation::getMatrix() const
{
	return glm::translate(glm::identity<Matrix>(), position) * rotate_ypr(rotation)
			* glm::scale(glm::identity<Matrix>(), scale);
}

Mutation::Matrix
Mutation::getDeformationMatrix() const
{
	return glm::scale(glm::identity<Matrix>(), scale);
}

Mutation::Matrix
Mutation::getLocationMatrix() const
{
	return glm::translate(glm::identity<Matrix>(), position) * rotate_ypr(rotation);
}

bool
Mutation::persist(Persistence::PersistenceStore & store)
{
	return STORE_MEMBER(scale) && STORE_MEMBER(position) && STORE_MEMBER(rotation);
}