فهرست منبع

Merge branch 'master' of github.com:taylor001/crown

Daniele Bartolini 10 سال پیش
والد
کامیت
94cfef5a24
6فایلهای تغییر یافته به همراه169 افزوده شده و 303 حذف شده
  1. 142 257
      genie/crown.lua
  2. 3 20
      genie/toolchain.lua
  3. 4 4
      src/resource/font_resource.cpp
  4. 4 4
      src/resource/font_resource.h
  5. 13 0
      src/world/scene_graph.cpp
  6. 3 18
      src/world/scene_graph.h

+ 142 - 257
genie/crown.lua

@@ -148,68 +148,16 @@ function crown_project(_name, _kind, _defines)
 				"NDEBUG"
 			}
 
-		configuration { "linux*" }
-			includedirs {
-				"$(PHYSX_SDK_LINUX)/Include",
-				"$(PHYSX_SDK_LINUX)/Include/common",
-				"$(PHYSX_SDK_LINUX)/Include/characterkinematic",
-				"$(PHYSX_SDK_LINUX)/Include/cloth",
-				"$(PHYSX_SDK_LINUX)/Include/common",
-				"$(PHYSX_SDK_LINUX)/Include/cooking",
-				"$(PHYSX_SDK_LINUX)/Include/extensions",
-				"$(PHYSX_SDK_LINUX)/Include/foundation",
-				"$(PHYSX_SDK_LINUX)/Include/geometry",
-				"$(PHYSX_SDK_LINUX)/Include/particles",
-				"$(PHYSX_SDK_LINUX)/Include/physxprofilesdk",
-				"$(PHYSX_SDK_LINUX)/Include/physxvisualdebuggersdk",
-				"$(PHYSX_SDK_LINUX)/Include/pvd",
-				"$(PHYSX_SDK_LINUX)/Include/pxtask",
-				"$(PHYSX_SDK_LINUX)/Include/RepX",
-				"$(PHYSX_SDK_LINUX)/Include/RepXUpgrader",
-				"$(PHYSX_SDK_LINUX)/Include/vehicle",
-			}
-
 		configuration { "android*" }
-			includedirs {
-				"$(PHYSX_SDK_ANDROID)/Include",
-				"$(PHYSX_SDK_ANDROID)/Include/common",
-				"$(PHYSX_SDK_ANDROID)/Include/characterkinematic",
-				"$(PHYSX_SDK_ANDROID)/Include/cloth",
-				"$(PHYSX_SDK_ANDROID)/Include/common",
-				"$(PHYSX_SDK_ANDROID)/Include/cooking",
-				"$(PHYSX_SDK_ANDROID)/Include/extensions",
-				"$(PHYSX_SDK_ANDROID)/Include/foundation",
-				"$(PHYSX_SDK_ANDROID)/Include/geometry",
-				"$(PHYSX_SDK_ANDROID)/Include/particles",
-				"$(PHYSX_SDK_ANDROID)/Include/physxprofilesdk",
-				"$(PHYSX_SDK_ANDROID)/Include/physxvisualdebuggersdk",
-				"$(PHYSX_SDK_ANDROID)/Include/pvd",
-				"$(PHYSX_SDK_ANDROID)/Include/pxtask",
-				"$(PHYSX_SDK_ANDROID)/Include/RepX",
-				"$(PHYSX_SDK_ANDROID)/Include/RepXUpgrader",
-				"$(PHYSX_SDK_ANDROID)/Include/vehicle",
+			kind "ConsoleApp"
+			targetextension ".so"
+			linkoptions {
+				"-shared"
 			}
-
-		configuration { "vs*" }
-			includedirs {
-				"$(PHYSX_SDK_WINDOWS)/Include",
-				"$(PHYSX_SDK_WINDOWS)/Include/common",
-				"$(PHYSX_SDK_WINDOWS)/Include/characterkinematic",
-				"$(PHYSX_SDK_WINDOWS)/Include/cloth",
-				"$(PHYSX_SDK_WINDOWS)/Include/common",
-				"$(PHYSX_SDK_WINDOWS)/Include/cooking",
-				"$(PHYSX_SDK_WINDOWS)/Include/extensions",
-				"$(PHYSX_SDK_WINDOWS)/Include/foundation",
-				"$(PHYSX_SDK_WINDOWS)/Include/geometry",
-				"$(PHYSX_SDK_WINDOWS)/Include/particles",
-				"$(PHYSX_SDK_WINDOWS)/Include/physxprofilesdk",
-				"$(PHYSX_SDK_WINDOWS)/Include/physxvisualdebuggersdk",
-				"$(PHYSX_SDK_WINDOWS)/Include/pvd",
-				"$(PHYSX_SDK_WINDOWS)/Include/pxtask",
-				"$(PHYSX_SDK_WINDOWS)/Include/RepX",
-				"$(PHYSX_SDK_WINDOWS)/Include/RepXUpgrader",
-				"$(PHYSX_SDK_WINDOWS)/Include/vehicle",
-				"$(DXSDK_DIR)/Include",
+			links {
+				"EGL",
+				"GLESv2",
+				"OpenSLES",
 			}
 
 		configuration { "linux-*" }
@@ -221,234 +169,171 @@ function crown_project(_name, _kind, _defines)
 				"dl",
 			}
 
-		configuration { "x32", "debug", "linux-*" }
-			linkoptions {
-				"-rdynamic",
-				"-Wl,--start-group $(addprefix -l," ..
-				"	PhysX3CHECKED_x86" ..
-				"	PhysX3CommonCHECKED_x86" ..
-				"	PhysX3CookingCHECKED_x86" ..
-				"	PhysX3CharacterKinematicCHECKED_x86" ..
-				"	PhysX3ExtensionsCHECKED" ..
-				"	PhysX3VehicleCHECKED" ..
-				"	PhysXProfileSDKCHECKED" ..
-				"	PhysXVisualDebuggerSDKCHECKED" ..
-				"	PxTaskCHECKED" ..
-				") -Wl,--end-group"
+		configuration { "vs*" }
+			links {
+				"OpenGL32",
+				"dbghelp",
+				"xinput",
 			}
 
-		configuration { "x64", "debug", "linux-*" }
-			linkoptions {
-				"-rdynamic",
-				"-Wl,--start-group $(addprefix -l," ..
-				"	PhysX3CHECKED_x64" ..
-				"	PhysX3CommonCHECKED_x64" ..
-				"	PhysX3CookingCHECKED_x64" ..
-				"	PhysX3CharacterKinematicCHECKED_x64" ..
-				"	PhysX3ExtensionsCHECKED" ..
-				"	PhysX3VehicleCHECKED" ..
-				"	PhysXProfileSDKCHECKED" ..
-				"	PhysXVisualDebuggerSDKCHECKED" ..
-				"	PxTaskCHECKED" ..
-				") -Wl,--end-group"
+		-- PhysX
+		local function includedirs_physx(prefix)
+			includedirs {
+				prefix .. "Include",
+				prefix .. "Include/common",
+				prefix .. "Include/characterkinematic",
+				prefix .. "Include/cloth",
+				prefix .. "Include/common",
+				prefix .. "Include/cooking",
+				prefix .. "Include/extensions",
+				prefix .. "Include/foundation",
+				prefix .. "Include/geometry",
+				prefix .. "Include/particles",
+				prefix .. "Include/physxprofilesdk",
+				prefix .. "Include/physxvisualdebuggersdk",
+				prefix .. "Include/pvd",
+				prefix .. "Include/pxtask",
+				prefix .. "Include/RepX",
+				prefix .. "Include/RepXUpgrader",
+				prefix .. "Include/vehicle",
 			}
+		end
 
-		configuration { "x32", "development", "linux-*" }
-			linkoptions
-			{
-				"-rdynamic",
-				"-Wl,--start-group $(addprefix -l," ..
-				"	PhysX3PROFILE_x86" ..
-				"	PhysX3CommonPROFILE_x86" ..
-				"	PhysX3CookingPROFILE_x86" ..
-				"	PhysX3CharacterKinematicPROFILE_x86" ..
-				"	PhysX3ExtensionsPROFILE" ..
-				"	PhysX3VehiclePROFILE" ..
-				"	PhysXProfileSDKPROFILE" ..
-				"	PhysXVisualDebuggerSDKPROFILE" ..
-				"	PxTaskPROFILE" ..
-				") -Wl,--end-group"
-			}
+		local function links_physx(config, os, platform)
+			if os == "linux" then
+				if config == "CHECKED" or config == "PROFILE" then
+					linkoptions {
+						"-rdynamic",
+					}
+				end
+
+				linkoptions {
+					"-Wl,--start-group $(addprefix -l," ..
+					"	PhysX3"                   .. config .. "_" .. platform ..
+					"	PhysX3Common"             .. config .. "_" .. platform ..
+					"	PhysX3Cooking"            .. config .. "_" .. platform ..
+					"	PhysX3CharacterKinematic" .. config .. "_" .. platform ..
+					"	PhysX3Extensions"         .. config ..
+					"	PhysX3Vehicle"            .. config ..
+					"	PhysXProfileSDK"          .. config ..
+					"	PhysXVisualDebuggerSDK"   .. config ..
+					"	PxTask"                   .. config ..
+					") -Wl,--end-group"
+				}
+			end
+
+			if os == "android" then
+				linkoptions {
+					"-Wl,--start-group $(addprefix -l," ..
+					"	LowLevelCloth"            .. config ..
+					"	PhysX3 "                  .. config ..
+					"	PhysX3Common"             .. config ..
+					"	PxTask"                   .. config ..
+					"	LowLevel"                 .. config ..
+					"	PhysX3CharacterKinematic" .. config ..
+					"	PhysX3Cooking"            .. config ..
+					"	PhysX3Extensions"         .. config ..
+					"	PhysX3Vehicle"            .. config ..
+					"	PhysXProfileSDK"          .. config ..
+					"	PhysXVisualDebuggerSDK"   .. config ..
+					"	PvdRuntime"               .. config ..
+					"	SceneQuery"               .. config ..
+					"	SimulationController"     .. config ..
+					") -Wl,--end-group"
+				}
+			end
 
-		configuration { "x64", "development", "linux-*" }
-			linkoptions
-			{
-				"-rdynamic",
-				"-Wl,--start-group $(addprefix -l," ..
-				"	PhysX3PROFILE_x64" ..
-				"	PhysX3CommonPROFILE_x64" ..
-				"	PhysX3CookingPROFILE_x64" ..
-				"	PhysX3CharacterKinematicPROFILE_x64" ..
-				"	PhysX3ExtensionsPROFILE" ..
-				"	PhysX3VehiclePROFILE" ..
-				"	PhysXProfileSDKPROFILE" ..
-				"	PhysXVisualDebuggerSDKPROFILE" ..
-				"	PxTaskPROFILE" ..
-				") -Wl,--end-group"
+			if os == "windows" then
+				links {
+					"PhysX3CharacterKinematic" .. config .. "_" .. platform,
+					"PhysX3"                   .. config .. "_" .. platform,
+					"PhysX3Common"             .. config .. "_" .. platform,
+					"PhysX3Cooking"            .. config .. "_" .. platform,
+					"PhysX3Extensions",
+				}
+			end
+		end
+
+		configuration { "android*" }
+			includedirs_physx("$(PHYSX_SDK_ANDROID)/")
+
+		configuration { "linux*" }
+			includedirs_physx("$(PHYSX_SDK_LINUX)/")
+
+		configuration { "vs*" }
+			includedirs_physx("$(PHYSX_SDK_WINDOWS)/")
+
+		configuration { "android-arm" }
+			libdirs {
+				"$(PHYSX_SDK_ANDROID)/Lib/android9_neon",
 			}
 
-		configuration { "x32", "release", "linux-*" }
-			linkoptions {
-				"-Wl,--start-group $(addprefix -l," ..
-				"	PhysX3_x86" ..
-				"	PhysX3Common_x86" ..
-				"	PhysX3Cooking_x86" ..
-				"	PhysX3CharacterKinematic_x86" ..
-				"	PhysX3Extensions" ..
-				"	PhysX3Vehicle" ..
-				"	PhysXProfileSDK" ..
-				"	PhysXVisualDebuggerSDK" ..
-				"	PxTask" ..
-				") -Wl,--end-group"
+		configuration { "x32", "linux-*" }
+			libdirs {
+				"$(PHYSX_SDK_LINUX)/Lib/linux32",
+				"$(PHYSX_SDK_LINUX)/Bin/linux32",
 			}
 
-		configuration { "x64", "release", "linux-*" }
-			linkoptions {
-				"-Wl,--start-group $(addprefix -l," ..
-				"	PhysX3_x64" ..
-				"	PhysX3Common_x64" ..
-				"	PhysX3Cooking_x64" ..
-				"	PhysX3CharacterKinematic_x64" ..
-				"	PhysX3Extensions" ..
-				"	PhysX3Vehicle" ..
-				"	PhysXProfileSDK" ..
-				"	PhysXVisualDebuggerSDK" ..
-				"	PxTask" ..
-				") -Wl,--end-group"
+		configuration { "x64", "linux-*" }
+			libdirs {
+				"$(PHYSX_SDK_LINUX)/Lib/linux64",
+				"$(PHYSX_SDK_LINUX)/Bin/linux64",
 			}
 
-		configuration { "android*" }
-			kind "ConsoleApp"
-			targetextension ".so"
-			linkoptions {
-				"-shared"
+		configuration { "x32", "vs*" }
+			libdirs {
+				"$(PHYSX_SDK_WINDOWS)/Lib/win32",
 			}
-			links {
-				"EGL",
-				"GLESv2",
-				"OpenSLES",
+
+		configuration { "x64", "vs*" }
+			libdirs {
+				"$(PHYSX_SDK_WINDOWS)/Lib/win64",
 			}
 
+		configuration { "x32", "debug", "linux-*" }
+			links_physx("CHECKED", "linux", "x86")
+
+		configuration { "x64", "debug", "linux-*" }
+			links_physx("CHECKED", "linux", "x64")
+
+		configuration { "x32", "development", "linux-*" }
+			links_physx("PROFILE", "linux", "x86")
+
+		configuration { "x64", "development", "linux-*" }
+			links_physx("PROFILE", "linux", "x64")
+
+		configuration { "x32", "release", "linux-*" }
+			links_physx("", "linux", "x86")
+
+		configuration { "x64", "release", "linux-*" }
+			links_physx("", "linux", "x64")
+
 		configuration { "debug", "android-arm" }
-			linkoptions {
-				"-Wl,--start-group $(addprefix -l," ..
-				"	LowLevelCloth" ..
-				"	PhysX3 " ..
-				"	PhysX3Common" ..
-				"	PxTask" ..
-				"	LowLevel" ..
-				"	PhysX3CharacterKinematic" ..
-				"	PhysX3Cooking" ..
-				"	PhysX3Extensions" ..
-				"	PhysX3Vehicle" ..
-				"	PhysXProfileSDK" ..
-				"	PhysXVisualDebuggerSDK" ..
-				"	PvdRuntime" ..
-				"	SceneQuery" ..
-				"	SimulationController" ..
-				") -Wl,--end-group"
-			}
+			links_physx("CHECKED", "android", "")
 
 		configuration { "development", "android-arm" }
-			linkoptions {
-				"-Wl,--start-group $(addprefix -l," ..
-				"	LowLevelCloth" ..
-				"	PhysX3 " ..
-				"	PhysX3Common" ..
-				"	PxTask" ..
-				"	LowLevel" ..
-				"	PhysX3CharacterKinematic" ..
-				"	PhysX3Cooking" ..
-				"	PhysX3Extensions" ..
-				"	PhysX3Vehicle" ..
-				"	PhysXProfileSDK" ..
-				"	PhysXVisualDebuggerSDK" ..
-				"	PvdRuntime" ..
-				"	SceneQuery" ..
-				"	SimulationController" ..
-				") -Wl,--end-group"
-			}
+			links_physx("PROFILE", "android", "")
 
 		configuration { "release", "android-arm" }
-			linkoptions {
-				"-Wl,--start-group $(addprefix -l," ..
-				"	LowLevelCloth" ..
-				"	PhysX3 " ..
-				"	PhysX3Common" ..
-				"	PxTask" ..
-				"	LowLevel" ..
-				"	PhysX3CharacterKinematic" ..
-				"	PhysX3Cooking" ..
-				"	PhysX3Extensions" ..
-				"	PhysX3Vehicle" ..
-				"	PhysXProfileSDK" ..
-				"	PhysXVisualDebuggerSDK" ..
-				"	PvdRuntime" ..
-				"	SceneQuery" ..
-				"	SimulationController" ..
-				") -Wl,--end-group"
-			}
-
-		configuration { "vs*" }
-			links {
-				"OpenGL32",
-				"dbghelp",
-				"xinput",
-			}
+			links_physx("", "android", "")
 
 		configuration { "debug", "x32", "vs*"}
-			links {
-				"PhysX3CharacterKinematicCHECKED_x86",
-				"PhysX3CHECKED_x86",
-				"PhysX3CommonCHECKED_x86",
-				"PhysX3CookingCHECKED_x86",
-				"PhysX3ExtensionsCHECKED",
-			}
+			links_physx("CHECKED", "windows", "x86")
 
 		configuration { "debug", "x64", "vs*" }
-			links {
-				"PhysX3CharacterKinematicCHECKED_x64",
-				"PhysX3CHECKED_x64",
-				"PhysX3CommonCHECKED_x64",
-				"PhysX3CookingCHECKED_x64",
-				"PhysX3ExtensionsCHECKED",
-			}
+			links_physx("CHECKED", "windows", "x64")
 
 		configuration { "development", "x32", "vs*" }
-			links {
-				"PhysX3CharacterKinematicPROFILE_x86",
-				"PhysX3PROFILE_x86",
-				"PhysX3CommonPROFILE_x86",
-				"PhysX3CookingPROFILE_x86",
-				"PhysX3ExtensionsPROFILE",
-			}
+			links_physx("PROFILE", "windows", "x86")
 
 		configuration { "development", "x64", "vs*" }
-			links {
-				"PhysX3CharacterKinematicPROFILE_x64",
-				"PhysX3PROFILE_x64",
-				"PhysX3CommonPROFILE_x64",
-				"PhysX3CookingPROFILE_x64",
-				"PhysX3ExtensionsPROFILE",
-			}
+			links_physx("PROFILE", "windows", "x64")
 
 		configuration { "release", "x32", "vs*" }
-			links {
-				"PhysX3CharacterKinematic_x86",
-				"PhysX3_x86",
-				"PhysX3Common_x86",
-				"PhysX3Cooking_x86",
-				"PhysX3Extensions",
-			}
+			links_physx("", "windows", "x86")
 
 		configuration { "release", "x64", "vs*" }
-			links {
-				"PhysX3CharacterKinematic_x64",
-				"PhysX3_x64",
-				"PhysX3Common_x64",
-				"PhysX3Cooking_x64",
-				"PhysX3Extensions",
-			}
+			links_physx("", "windows", "x64")
 
 		configuration {}
 

+ 3 - 20
genie/toolchain.lua

@@ -12,8 +12,8 @@ function toolchain(build_dir, lib_dir)
 		description = "Choose compiler",
 		allowed =
 		{
-			{ "android-arm", "Android - ARM"          },
-			{ "linux-gcc",   "Linux (GCC compiler)"   }
+			{ "android-arm", "Android - ARM"        },
+			{ "linux-gcc",   "Linux (GCC compiler)" }
 		}
 	}
 
@@ -36,10 +36,6 @@ function toolchain(build_dir, lib_dir)
 
 			if not os.is("linux") then print("Action not valid in current OS.") end
 
-			if not os.getenv("PHYSX_SDK_LINUX") then
-				print("Set PHYSX_SDK_LINUX environment variable.")
-			end
-
 			location(build_dir .. "projects/" .. "linux")
 		end
 
@@ -48,12 +44,10 @@ function toolchain(build_dir, lib_dir)
 			if not os.getenv("ANDROID_NDK_ROOT") then
 				print("Set ANDROID_NDK_ROOT environment variable.")
 			end
+
 			if not os.getenv("ANDROID_NDK_ARM") then
 				print("Set ANDROID_NDK_ARM environment variables.")
 			end
-			if not os.getenv("PHYSX_SDK_ANDROID") then
-				print("Set PHYSX_SDK_ANDROID environment variable.")
-			end
 
 			premake.gcc.cc = "$(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-gcc"
 			premake.gcc.cxx = "$(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-g++"
@@ -66,9 +60,6 @@ function toolchain(build_dir, lib_dir)
 
 		if not os.is("windows") then print("Action not valid in current OS.") end
 
-		if not os.getenv("PHYSX_SDK_WINDOWS") then
-			print("Set PHYSX_SDK_WINDOWS environment variable.")
-		end
 		if not os.getenv("DXSDK_DIR") then
 			print("Set DXSDK_DIR environment variable.")
 		end
@@ -125,8 +116,6 @@ function toolchain(build_dir, lib_dir)
 		objdir (build_dir .. "linux32" .. "/obj")
 		libdirs {
 			lib_dir .. "../.build/linux32/bin",
-			"$(PHYSX_SDK_LINUX)/Lib/linux32",
-			"$(PHYSX_SDK_LINUX)/Bin/linux32",
 		}
 		buildoptions {
 			"-m32",
@@ -138,8 +127,6 @@ function toolchain(build_dir, lib_dir)
 		objdir (build_dir .. "linux64" .. "/obj")
 		libdirs {
 			lib_dir .. "../.build/linux64/bin",
-			"$(PHYSX_SDK_LINUX)/Lib/linux64",
-			"$(PHYSX_SDK_LINUX)/Bin/linux64",
 		}
 		buildoptions {
 			"-m64",
@@ -211,7 +198,6 @@ function toolchain(build_dir, lib_dir)
 		libdirs {
 			lib_dir .. "../.build/android-arm/bin",
 			"$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a",
-			"$(PHYSX_SDK_ANDROID)/Lib/android9_neon",
 		}
 		includedirs {
 			"$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/include",
@@ -223,7 +209,6 @@ function toolchain(build_dir, lib_dir)
 			"-mfloat-abi=softfp",
 			"-mfpu=neon",
 			"-Wunused-value",
-			-- "-Wundef", -- note: avoids PhysX warnings
 		}
 		linkoptions {
 			"--sysroot=$(ANDROID_NDK_ROOT)/platforms/android-14/arch-arm",
@@ -261,7 +246,6 @@ function toolchain(build_dir, lib_dir)
 		targetdir (build_dir .. "win32" .. "/bin")
 		objdir (build_dir .. "win32" .. "/obj")
 		libdirs {
-			"$(PHYSX_SDK_WINDOWS)/Lib/win32",
 			"$(DXSDK_DIR)/Lib/x86",
 		}
 
@@ -269,7 +253,6 @@ function toolchain(build_dir, lib_dir)
 		targetdir (build_dir .. "win64" .. "/bin")
 		objdir (build_dir .. "win64" .. "/obj")
 		libdirs {
-			"$(PHYSX_SDK_WINDOWS)/Lib/win64",
 			"$(DXSDK_DIR)/Lib/x64",
 		}
 

+ 4 - 4
src/resource/font_resource.cpp

@@ -22,10 +22,10 @@ namespace font_resource
 		sjson::parse(json, obj);
 
 		glyph.id        = sjson::parse_int(obj["id"]);
-		glyph.x         = sjson::parse_int(obj["x"]);
-		glyph.y         = sjson::parse_int(obj["y"]);
-		glyph.width     = sjson::parse_int(obj["width"]);
-		glyph.height    = sjson::parse_int(obj["height"]);
+		glyph.x         = sjson::parse_float(obj["x"]);
+		glyph.y         = sjson::parse_float(obj["y"]);
+		glyph.width     = sjson::parse_float(obj["width"]);
+		glyph.height    = sjson::parse_float(obj["height"]);
 		glyph.x_offset  = sjson::parse_float(obj["x_offset"]);
 		glyph.y_offset  = sjson::parse_float(obj["y_offset"]);
 		glyph.x_advance = sjson::parse_float(obj["x_advance"]);

+ 4 - 4
src/resource/font_resource.h

@@ -26,10 +26,10 @@ struct FontResource
 struct FontGlyphData
 {
 	uint32_t id;
-	uint32_t x;
-	uint32_t y;
-	uint32_t width;
-	uint32_t height;
+	float x;
+	float y;
+	float width;
+	float height;
 	float x_offset;
 	float y_offset;
 	float x_advance;

+ 13 - 0
src/world/scene_graph.cpp

@@ -288,4 +288,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
 {
@@ -101,18 +97,7 @@ private:
 
 	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;