summaryrefslogtreecommitdiff
path: root/assetFactory/mutation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'assetFactory/mutation.cpp')
-rw-r--r--assetFactory/mutation.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/assetFactory/mutation.cpp b/assetFactory/mutation.cpp
index 21d2a24..9722dc3 100644
--- a/assetFactory/mutation.cpp
+++ b/assetFactory/mutation.cpp
@@ -1,4 +1,5 @@
#include "mutation.h"
+#include <algorithm>
#include <glm/gtx/transform.hpp>
#include <maths.h>
@@ -8,3 +9,21 @@ 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);
+}
+
+float
+Mutation::relativeLevelOfDetail() const
+{
+ return std::max({scale.x, scale.y, scale.z});
+}