Daniele Bartolini 10 vuotta sitten
vanhempi
sitoutus
ec77034c8e
2 muutettua tiedostoa jossa 16 lisäystä ja 18 poistoa
  1. 13 0
      src/world/scene_graph.cpp
  2. 3 18
      src/world/scene_graph.h

+ 13 - 0
src/world/scene_graph.cpp

@@ -284,4 +284,17 @@ void SceneGraph::grow()
 	allocate(_data.capacity * 2 + 1);
 }
 
+SceneGraph::Pose& SceneGraph::Pose::operator=(const Matrix4x4& m)
+{
+	Matrix3x3 rotm = to_matrix3x3(m);
+	normalize(rotm.x);
+	normalize(rotm.y);
+	normalize(rotm.z);
+
+	position = translation(m);
+	rotation = rotm;
+	scale = crown::scale(m);
+	return *this;
+}
+
 } // namespace crown

+ 3 - 18
src/world/scene_graph.h

@@ -5,15 +5,11 @@
 
 #pragma once
 
-#include "types.h"
+#include "container_types.h"
 #include "math_types.h"
-#include "matrix4x4.h"
 #include "memory_types.h"
+#include "types.h"
 #include "world_types.h"
-#include "container_types.h"
-#include "matrix3x3.h"
-#include "matrix4x4.h"
-#include "vector3.h"
 
 namespace crown
 {
@@ -97,18 +93,7 @@ public:
 
 	struct Pose
 	{
-		Pose& operator=(const Matrix4x4& m)
-		{
-			Matrix3x3 rotm = to_matrix3x3(m);
-			normalize(rotm.x);
-			normalize(rotm.y);
-			normalize(rotm.z);
-
-			position = translation(m);
-			rotation = rotm;
-			scale = crown::scale(m);
-			return *this;
-		}
+		Pose& operator=(const Matrix4x4& m);
 
 		Vector3 position;
 		Matrix3x3 rotation;