Ver Fonte

Moving to CMake

Panagiotis Christopoulos Charitos há 14 anos atrás
pai
commit
44fadd443e
83 ficheiros alterados com 304 adições e 251 exclusões
  1. 11 0
      CMakeLists.txt
  2. 10 1
      src/CMakeLists.txt
  3. 6 6
      src/Core/App.cpp
  4. 4 0
      src/Core/CMakeLists.txt
  5. 1 1
      src/GfxApi/CMakeLists.txt
  6. 35 37
      src/Main.cpp
  7. 4 0
      src/Misc/CMakeLists.txt
  8. 2 2
      src/Misc/map.cpp
  9. 5 5
      src/Misc/skybox.cpp
  10. 4 0
      src/Physics/CMakeLists.txt
  11. 1 1
      src/Physics/PhysMotionState.h
  12. 1 1
      src/Physics/PhysRigidBody.cpp
  13. 5 6
      src/Renderer/Bs.cpp
  14. 4 0
      src/Renderer/CMakeLists.txt
  15. 9 9
      src/Renderer/Dbg.cpp
  16. 5 5
      src/Renderer/Drawers/CollisionDbgDrawer.cpp
  17. 5 3
      src/Renderer/Drawers/CollisionDbgDrawer.h
  18. 2 2
      src/Renderer/Drawers/PhyDbgDrawer.cpp
  19. 7 7
      src/Renderer/Drawers/SceneDbgDrawer.cpp
  20. 7 7
      src/Renderer/Drawers/SceneDrawer.cpp
  21. 2 2
      src/Renderer/Ez.cpp
  22. 45 34
      src/Renderer/Is.cpp
  23. 1 1
      src/Renderer/MainRenderer.cpp
  24. 2 2
      src/Renderer/Ms.cpp
  25. 1 2
      src/Renderer/Renderer.cpp
  26. 2 2
      src/Renderer/SkinsDeformer.cpp
  27. 6 6
      src/Renderer/Sm.cpp
  28. 11 10
      src/Renderer/Smo.cpp
  29. 2 2
      src/Renderer/Ssao.cpp
  30. 1 1
      src/Resources/Material.cpp
  31. 1 1
      src/Resources/Mesh.cpp
  32. 1 1
      src/Resources/Model.cpp
  33. 1 1
      src/Resources/ModelPatch.cpp
  34. 1 1
      src/Resources/ResourceManager.cpp
  35. 1 1
      src/Resources/RsrcAsyncLoadingReqsHandler.cpp
  36. 2 2
      src/Resources/ShaderPrePreprocessor.cpp
  37. 2 2
      src/Resources/ShaderProg.cpp
  38. 1 1
      src/Resources/Skeleton.cpp
  39. 4 0
      src/Scene/CMakeLists.txt
  40. 2 2
      src/Scene/Camera.cpp
  41. 1 1
      src/Scene/Controller.cpp
  42. 1 1
      src/Scene/Light.cpp
  43. 1 1
      src/Scene/Light.h
  44. 1 1
      src/Scene/MaterialRuntime.cpp
  45. 1 1
      src/Scene/MaterialRuntime.h
  46. 1 1
      src/Scene/MaterialRuntimeUserDefinedVar.h
  47. 2 2
      src/Scene/ModelNode.cpp
  48. 3 3
      src/Scene/ModelNode.h
  49. 3 3
      src/Scene/ModelPatchNode.cpp
  50. 3 3
      src/Scene/ModelPatchNode.h
  51. 6 6
      src/Scene/OrthographicCamera.cpp
  52. 1 1
      src/Scene/Particle.cpp
  53. 3 4
      src/Scene/ParticleEmitter.cpp
  54. 1 1
      src/Scene/ParticleEmitter.h
  55. 1 1
      src/Scene/PatchNode.cpp
  56. 2 2
      src/Scene/PatchNode.h
  57. 6 6
      src/Scene/PerspectiveCamera.cpp
  58. 1 1
      src/Scene/Scene.cpp
  59. 5 5
      src/Scene/SkelAnimModelNodeCtrl.cpp
  60. 2 2
      src/Scene/SkinNode.cpp
  61. 2 2
      src/Scene/SkinNode.h
  62. 1 1
      src/Scene/SkinPatchNode.cpp
  63. 4 4
      src/Scene/VisibilityTester.cpp
  64. 6 0
      src/Scripting/CMakeLists.txt
  65. 1 1
      src/Scripting/Core/App.bpi.cpp
  66. 4 4
      src/Scripting/Core/Globals.bpi.cpp
  67. 1 1
      src/Scripting/Input/Input.bpi.cpp
  68. 1 1
      src/Scripting/Renderer/Bl.bpi.cpp
  69. 1 1
      src/Scripting/Renderer/Dbg.bpi.cpp
  70. 1 1
      src/Scripting/Renderer/Hdr.bpi.cpp
  71. 2 2
      src/Scripting/Renderer/MainRenderer.bpi.cpp
  72. 3 3
      src/Scripting/Renderer/Pps.bpi.cpp
  73. 1 1
      src/Scripting/Renderer/Renderer.bpi.cpp
  74. 1 1
      src/Scripting/Scene/Camera.bpi.cpp
  75. 1 1
      src/Scripting/Scene/MaterialRuntime.bpi.cpp
  76. 1 1
      src/Scripting/Scene/ModelNode.bpi.cpp
  77. 1 1
      src/Scripting/Scene/ModelPatchNode.bpi.cpp
  78. 1 1
      src/Scripting/Scene/PatchNode.bpi.cpp
  79. 3 3
      src/Scripting/Scene/Scene.bpi.cpp
  80. 1 1
      src/Scripting/Scene/SceneNode.bpi.cpp
  81. 1 1
      src/Scripting/Util/HighRezTimer.bpi.cpp
  82. 3 5
      src/Util/CMakeLists.txt
  83. 1 1
      unit-tests/Resources/Material.ut.cpp

+ 11 - 0
CMakeLists.txt

@@ -2,6 +2,17 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 
 INCLUDE_DIRECTORIES("extern/include")
 INCLUDE_DIRECTORIES("extern/include/bullet")
+INCLUDE_DIRECTORIES("/usr/include/python2.6")
+INCLUDE_DIRECTORIES("/usr/include/freetype2")
+
+LINK_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/extern/lib-x86-64-linux)
+
+IF(${CMAKE_SYSTEM_NAME} STREQUAL Linux)
+	ADD_DEFINITIONS("-DPLATFORM_LINUX")
+ELSEIF(${CMAKE_SYSTEM_NAME} STREQUAL Windows)
+	ADD_DEFINITIONS("-DPLATFORM_WINDOWS")
+ENDIF(${CMAKE_SYSTEM_NAME} STREQUAL Linux)
+	
 
 ADD_SUBDIRECTORY(src)
 

+ 10 - 1
src/CMakeLists.txt

@@ -2,4 +2,13 @@ PROJECT(ANKI_PROJ)
 
 INCLUDE_DIRECTORIES(${ANKI_PROJ_SOURCE_DIR})
 
-SUBDIRS(Util Math Collision GfxApi Events Input Resources)
+SET(ANKI_LIBS Core GfxApi Misc Renderer Scene Ui Collision Events Input Math 
+	Physics Resources Scripting Util)
+
+SUBDIRS(${ANKI_LIBS})
+
+ADD_EXECUTABLE(anki Main.cpp)
+
+TARGET_LINK_LIBRARIES(anki ${ANKI_LIBS} BulletSoftBody BulletDynamics 
+	BulletCollision LinearMath GLEW GLU GL jpeg SDL png python2.6
+	boost_system boost_python boost_filesystem boost_thread freetype) 

+ 6 - 6
src/Core/App.cpp

@@ -6,16 +6,16 @@
 #include <boost/filesystem.hpp>
 #include <boost/algorithm/string.hpp>
 #include "App.h"
-#include "RendererInitializer.h"
-#include "MainRenderer.h"
-#include "ScriptingEngine.h"
+#include "Renderer/RendererInitializer.h"
+#include "Renderer/MainRenderer.h"
+#include "Scripting/ScriptingEngine.h"
 #include "StdinListener.h"
-#include "Input.h"
+#include "Input/Input.h"
 #include "Logger.h"
 #include "Core/Globals.h"
 #include "JobManager.h"
-#include "PhyDbgDrawer.h"
-#include "Scene.h"
+#include "Renderer/Drawers/PhyDbgDrawer.h"
+#include "Scene/Scene.h"
 
 
 //==============================================================================

+ 4 - 0
src/Core/CMakeLists.txt

@@ -0,0 +1,4 @@
+FILE(GLOB CORE_SOURCES *.cpp)
+FILE(GLOB CORE_HEADERS *.h)
+
+ADD_LIBRARY(Core ${CORE_SOURCES} ${CORE_HEADERS})

+ 1 - 1
src/GfxApi/CMakeLists.txt

@@ -1,6 +1,6 @@
 FILE(GLOB_RECURSE GFX_API_SOURCES *.cpp)
 FILE(GLOB_RECURSE GFX_API_HEADERS *.h)
 
-INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/BufferObjects")
+#INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/BufferObjects")
 
 ADD_LIBRARY(GfxApi ${GFX_API_SOURCES} ${GFX_API_HEADERS})

+ 35 - 37
src/Main.cpp

@@ -2,46 +2,44 @@
 #include <iostream>
 #include <fstream>
 
-#include "Input.h"
-#include "PerspectiveCamera.h"
-#include "OrthographicCamera.h"
+#include "Input/Input.h"
+#include "Scene/PerspectiveCamera.h"
+#include "Scene/OrthographicCamera.h"
 #include "Math/Math.h"
-#include "Renderer.h"
-#include "UiPainter.h"
-#include "App.h"
-#include "Mesh.h"
-#include "Light.h"
-#include "PointLight.h"
-#include "SpotLight.h"
-#include "Material.h"
-#include "Scene.h"
-#include "Scanner.h"
-#include "skybox.h"
-#include "map.h"
-#include "SkelAnim.h"
-#include "LightRsrc.h"
-#include "Parser.h"
-#include "ParticleEmitter.h"
-#include "PhysCharacter.h"
-#include "Renderer.h"
-#include "RendererInitializer.h"
-#include "MainRenderer.h"
-#include "PhysCharacter.h"
-#include "PhysRigidBody.h"
-#include "ScriptingEngine.h"
-#include "StdinListener.h"
-#include "ModelNode.h"
-#include "SkelAnimModelNodeCtrl.h"
-#include "Model.h"
+#include "Renderer/Renderer.h"
+#include "Ui/Painter.h"
+#include "Core/App.h"
+#include "Resources/Mesh.h"
+#include "Scene/Light.h"
+#include "Scene/PointLight.h"
+#include "Scene/SpotLight.h"
+#include "Resources/Material.h"
+#include "Scene/Scene.h"
+#include "Util/Scanner/Scanner.h"
+#include "Resources/SkelAnim.h"
+#include "Resources/LightRsrc.h"
+#include "Misc/Parser.h"
+#include "Scene/ParticleEmitter.h"
+#include "Physics/PhysCharacter.h"
+#include "Renderer/Renderer.h"
+#include "Renderer/RendererInitializer.h"
+#include "Renderer/MainRenderer.h"
+#include "Physics/PhysCharacter.h"
+#include "Physics/PhysRigidBody.h"
+#include "Scripting/ScriptingEngine.h"
+#include "Core/StdinListener.h"
+#include "Scene/ModelNode.h"
+#include "Scene/SkelAnimModelNodeCtrl.h"
+#include "Resources/Model.h"
 #include "Core/Logger.h"
-#include "Util.h"
-#include "HighRezTimer.h"
-#include "SkinNode.h"
-#include "Skin.h"
-#include "MaterialRuntime.h"
+#include "Util/Util.h"
+#include "Util/HighRezTimer.h"
+#include "Scene/SkinNode.h"
+#include "Resources/Skin.h"
+#include "Scene/MaterialRuntime.h"
 #include "Core/Globals.h"
-#include "UiFtFontLoader.h"
-#include "UiFont.h"
+#include "Ui/FtFontLoader.h"
+#include "Ui/Font.h"
 #include "Events/Manager.h"
 #include "Events/SceneColor.h"
 #include "Events/MainRendererPpsHdr.h"

+ 4 - 0
src/Misc/CMakeLists.txt

@@ -0,0 +1,4 @@
+FILE(GLOB MISC_SOURCES *.cpp)
+FILE(GLOB MISC_HEADERS *.h)
+
+ADD_LIBRARY(Misc ${MISC_SOURCES} ${MISC_HEADERS})

+ 2 - 2
src/Misc/map.cpp

@@ -1,11 +1,11 @@
 /*
 #include <limits>
 #include "map.h"
-#include "Mesh.h"
+#include "Resources/Mesh.h"
 #include "Scanner.h"
 #include "Parser.h"
 #include "Resource.h"
-#include "Camera.h"
+#include "Scene/Camera.h"
 
 
 

+ 5 - 5
src/Misc/skybox.cpp

@@ -1,10 +1,10 @@
 #include "skybox.h"
-#include "Renderer.h"
+#include "Renderer/Renderer.h"
 #include "Math/Math.h"
-#include "Camera.h"
-#include "Scene.h"
-#include "App.h"
-#include "MainRenderer.h"
+#include "Scene/Camera.h"
+#include "Scene/Scene.h"
+#include "Core/App.h"
+#include "Renderer/MainRenderer.h"
 
 
 /*static float coords [][4][3] =

+ 4 - 0
src/Physics/CMakeLists.txt

@@ -0,0 +1,4 @@
+FILE(GLOB PHYSICS_SOURCES *.cpp)
+FILE(GLOB PHYSICS_HEADERS *.h)
+
+ADD_LIBRARY(Physics ${PHYSICS_SOURCES} ${PHYSICS_HEADERS})

+ 1 - 1
src/Physics/PhysMotionState.h

@@ -2,7 +2,7 @@
 #define PHYS_MOTION_STATE_H
 
 #include <LinearMath/btMotionState.h>
-#include "SceneNode.h"
+#include "Scene/SceneNode.h"
 
 
 namespace Phys {

+ 1 - 1
src/Physics/PhysRigidBody.cpp

@@ -1,6 +1,6 @@
 #include "PhysRigidBody.h"
 #include "PhysMasterContainer.h"
-#include "Scene.h"
+#include "Scene/Scene.h"
 #include "PhysMotionState.h"
 
 

+ 5 - 6
src/Renderer/Bs.cpp

@@ -1,13 +1,12 @@
 #include <boost/ptr_container/ptr_vector.hpp>
 #include "Bs.h"
 #include "Renderer.h"
-#include "App.h"
-#include "Scene.h"
+#include "Scene/Scene.h"
 #include "Resources/ShaderProg.h"
-#include "Model.h"
-#include "ModelNode.h"
-#include "Material.h"
-#include "Mesh.h"
+#include "Resources/Model.h"
+#include "Scene/ModelNode.h"
+#include "Resources/Material.h"
+#include "Resources/Mesh.h"
 
 
 //==============================================================================

+ 4 - 0
src/Renderer/CMakeLists.txt

@@ -0,0 +1,4 @@
+FILE(GLOB_RECURSE RENDERER_SOURCES *.cpp)
+FILE(GLOB_RECURSE RENDERER_HEADERS *.h)
+
+ADD_LIBRARY(Renderer ${RENDERER_SOURCES} ${RENDERER_HEADERS})

+ 9 - 9
src/Renderer/Dbg.cpp

@@ -1,15 +1,15 @@
-#include <boost/foreach.hpp>
 #include "Dbg.h"
 #include "Renderer.h"
-#include "Scene.h"
-#include "Camera.h"
-#include "Light.h"
+#include "Scene/RenderableNode.h"
+#include "Scene/Scene.h"
+#include "Scene/Camera.h"
+#include "Scene/Light.h"
+#include "Scene/ParticleEmitter.h"
 #include "RendererInitializer.h"
-#include "SceneDbgDrawer.h"
-#include "ParticleEmitter.h"
-#include "RenderableNode.h"
-#include "SkinNode.h"
-#include "SpotLight.h"
+#include "Drawers/SceneDbgDrawer.h"
+#include "Scene/SkinNode.h"
+#include "Scene/SpotLight.h"
+#include <boost/foreach.hpp>
 
 
 //==============================================================================

+ 5 - 5
src/Renderer/Drawers/CollisionDbgDrawer.cpp

@@ -1,12 +1,12 @@
 #include "CollisionDbgDrawer.h"
-#include "Dbg.h"
-#include "Collision.h"
+#include "../Dbg.h"
+#include "Collision/Collision.h"
 
 
 //==============================================================================
 // draw (Sphere)                                                               =
 //==============================================================================
-void CollisionDbgDrawer::draw(const Sphere& sphere)
+void CollisionDbgDrawer::draw(const Col::Sphere& sphere)
 {
 	dbg.setModelMat(Mat4(sphere.getCenter(), Mat3::getIdentity(), 1.0));
 	dbg.drawSphere(sphere.getRadius());
@@ -16,7 +16,7 @@ void CollisionDbgDrawer::draw(const Sphere& sphere)
 //==============================================================================
 // draw (Obb)                                                                  =
 //==============================================================================
-void CollisionDbgDrawer::draw(const Obb& obb)
+void CollisionDbgDrawer::draw(const Col::Obb& obb)
 {
 	Mat4 scale(Mat4::getIdentity());
 	scale(0, 0) = obb.getExtend().x();
@@ -48,7 +48,7 @@ void CollisionDbgDrawer::draw(const Obb& obb)
 //==============================================================================
 // draw (Plane)                                                                =
 //==============================================================================
-void CollisionDbgDrawer::draw(const Plane& plane)
+void CollisionDbgDrawer::draw(const Col::Plane& plane)
 {
 	const Vec3& n = plane.getNormal();
 	const float& o = plane.getOffset();

+ 5 - 3
src/Renderer/Drawers/CollisionDbgDrawer.h

@@ -3,9 +3,11 @@
 
 
 class Dbg;
+namespace Col {
 class Sphere;
 class Obb;
 class Plane;
+}
 
 
 /// Contains methods to render the collision shapes
@@ -16,13 +18,13 @@ class CollisionDbgDrawer
 		CollisionDbgDrawer(Dbg& dbg_): dbg(dbg_) {}
 
 		/// Draw Sphere
-		virtual void draw(const Sphere& sphere);
+		virtual void draw(const Col::Sphere& sphere);
 
 		/// Draw Obb
-		virtual void draw(const Obb& obb);
+		virtual void draw(const Col::Obb& obb);
 
 		/// Draw Plane
-		virtual void draw(const Plane& plane);
+		virtual void draw(const Col::Plane& plane);
 
 	private:
 		Dbg& dbg; ///< The debug stage

+ 2 - 2
src/Renderer/Drawers/PhyDbgDrawer.cpp

@@ -1,6 +1,6 @@
 #include "PhyDbgDrawer.h"
-#include "MainRenderer.h"
-#include "PhysConvertors.h"
+#include "../MainRenderer.h"
+#include "Physics/PhysConvertors.h"
 #include "Core/Logger.h"
 #include "Core/Globals.h"
 

+ 7 - 7
src/Renderer/Drawers/SceneDbgDrawer.cpp

@@ -1,11 +1,11 @@
 #include "SceneDbgDrawer.h"
-#include "Dbg.h"
-#include "Camera.h"
-#include "Light.h"
-#include "ParticleEmitter.h"
-#include "SkinNode.h"
-#include "PerspectiveCamera.h"
-#include "OrthographicCamera.h"
+#include "../Dbg.h"
+#include "Scene/Camera.h"
+#include "Scene/Light.h"
+#include "Scene/ParticleEmitter.h"
+#include "Scene/SkinNode.h"
+#include "Scene/PerspectiveCamera.h"
+#include "Scene/OrthographicCamera.h"
 
 
 //==============================================================================

+ 7 - 7
src/Renderer/Drawers/SceneDrawer.cpp

@@ -1,12 +1,12 @@
 #include "SceneDrawer.h"
 #include "Math/Math.h"
-#include "Material.h"
-#include "RenderableNode.h"
-#include "Camera.h"
-#include "Renderer.h"
-#include "App.h"
-#include "Scene.h"
-#include "MaterialRuntime.h"
+#include "Resources/Material.h"
+#include "Scene/RenderableNode.h"
+#include "Scene/Camera.h"
+#include "../Renderer.h"
+#include "Core/App.h"
+#include "Scene/Scene.h"
+#include "Scene/MaterialRuntime.h"
 #include "GfxApi/GlStateMachine.h"
 
 

+ 2 - 2
src/Renderer/Ez.cpp

@@ -1,7 +1,7 @@
 #include "Ez.h"
 #include "Renderer.h"
-#include "App.h"
-#include "Scene.h"
+#include "Core/App.h"
+#include "Scene/Scene.h"
 #include "RendererInitializer.h"
 
 

+ 45 - 34
src/Renderer/Is.cpp

@@ -4,16 +4,16 @@
 
 #include "Is.h"
 #include "Renderer.h"
-#include "Camera.h"
-#include "Light.h"
-#include "PointLight.h"
-#include "SpotLight.h"
-#include "LightRsrc.h"
-#include "App.h"
-#include "LightRsrc.h"
+#include "Scene/Camera.h"
+#include "Scene/Light.h"
+#include "Scene/PointLight.h"
+#include "Scene/SpotLight.h"
+#include "Resources/LightRsrc.h"
+#include "Core/App.h"
+#include "Resources/LightRsrc.h"
 #include "Sm.h"
 #include "Smo.h"
-#include "Scene.h"
+#include "Scene/Scene.h"
 
 
 //==============================================================================
@@ -41,12 +41,14 @@ void Is::initFbo()
 		fbo.setNumOfColorAttachements(1);
 
 		// create the FAI
-		Renderer::createFai(r.getWidth(), r.getHeight(), GL_RGB, GL_RGB, GL_FLOAT, fai);
+		Renderer::createFai(r.getWidth(), r.getHeight(), GL_RGB, GL_RGB,
+			GL_FLOAT, fai);
 
 		// attach
-		glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, fai.getGlId(), 0);
-		glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D,
-		                       copyMsDepthFai.getGlId(), 0);
+		glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
+			GL_TEXTURE_2D, fai.getGlId(), 0);
+		glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT,
+			GL_TEXTURE_2D, copyMsDepthFai.getGlId(), 0);
 
 		// test if success
 		fbo.checkIfGood();
@@ -56,7 +58,8 @@ void Is::initFbo()
 	}
 	catch(std::exception& e)
 	{
-		throw EXCEPTION("Cannot create deferred shading illumination stage FBO: " + e.what());
+		throw EXCEPTION("Cannot create deferred shading illumination "
+			"stage FBO: " + e.what());
 	}
 }
 
@@ -72,24 +75,25 @@ void Is::initCopy()
 		readFbo.create();
 		readFbo.bind();
 		readFbo.setNumOfColorAttachements(0);
-		glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D,
-		                       r.getMs().getDepthFai().getGlId(), 0);
+		glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT,
+			GL_TEXTURE_2D, r.getMs().getDepthFai().getGlId(), 0);
 		readFbo.unbind();
 
 		// Write
-		Renderer::createFai(r.getWidth(), r.getHeight(), GL_DEPTH24_STENCIL8, GL_DEPTH_STENCIL,
-		                    GL_UNSIGNED_INT_24_8, copyMsDepthFai);
+		Renderer::createFai(r.getWidth(), r.getHeight(), GL_DEPTH24_STENCIL8,
+			GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, copyMsDepthFai);
 
 		writeFbo.create();
 		writeFbo.bind();
 		writeFbo.setNumOfColorAttachements(0);
-		glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D,
-		                       copyMsDepthFai.getGlId(), 0);
+		glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT,
+			GL_TEXTURE_2D, copyMsDepthFai.getGlId(), 0);
 		writeFbo.unbind();
 	}
 	catch(std::exception& e)
 	{
-		throw EXCEPTION("Cannot create deferred shading illumination stage additional FBO: " + e.what());
+		throw EXCEPTION("Cannot create deferred shading illumination stage "
+			"additional FBO: " + e.what());
 	}
 }
 
@@ -107,12 +111,12 @@ void Is::init(const RendererInitializer& initializer)
 	ambientPassSProg.loadRsrc("shaders/IsAp.glsl");
 
 	// point light
-	pointLightSProg.loadRsrc(ShaderProg::createSrcCodeToCache("shaders/IsLpGeneric.glsl",
-	                                                          "#define POINT_LIGHT_ENABLED\n").c_str());
+	pointLightSProg.loadRsrc(ShaderProg::createSrcCodeToCache(
+		"shaders/IsLpGeneric.glsl", "#define POINT_LIGHT_ENABLED\n").c_str());
 
 	// spot light no shadow
-	spotLightNoShadowSProg.loadRsrc(ShaderProg::createSrcCodeToCache("shaders/IsLpGeneric.glsl",
-	                                                                 "#define SPOT_LIGHT_ENABLED\n").c_str());
+	spotLightNoShadowSProg.loadRsrc(ShaderProg::createSrcCodeToCache(
+		"shaders/IsLpGeneric.glsl", "#define SPOT_LIGHT_ENABLED\n").c_str());
 
 	// spot light w/t shadow
 	std::string pps = std::string("#define SPOT_LIGHT_ENABLED\n"
@@ -121,7 +125,8 @@ void Is::init(const RendererInitializer& initializer)
 	{
 		pps += "#define PCF_ENABLED\n";
 	}
-	spotLightShadowSProg.loadRsrc(ShaderProg::createSrcCodeToCache("shaders/IsLpGeneric.glsl", pps.c_str()).c_str());
+	spotLightShadowSProg.loadRsrc(ShaderProg::createSrcCodeToCache(
+		"shaders/IsLpGeneric.glsl", pps.c_str()).c_str());
 
 	// init the rest
 	initCopy();
@@ -141,7 +146,8 @@ void Is::ambientPass(const Vec3& color)
 
 	// set the uniforms
 	ambientPassSProg->findUniVar("ambientCol")->set(&color);
-	ambientPassSProg->findUniVar("sceneColMap")->set(r.getMs().getDiffuseFai(), 0);
+	ambientPassSProg->findUniVar("sceneColMap")->set(r.getMs().getDiffuseFai(),
+		0);
 
 	// Draw quad
 	r.drawQuad();
@@ -172,7 +178,8 @@ void Is::pointLightPass(const PointLight& light)
 	shader.findUniVar("limitsOfNearPlane2")->set(&r.getLimitsOfNearPlane2());
 	float zNear = cam.getZNear();
 	shader.findUniVar("zNear")->set(&zNear);
-	Vec3 lightPosEyeSpace = light.getWorldTransform().getOrigin().getTransformed(cam.getViewMatrix());
+	const Vec3& origin = light.getWorldTransform().getOrigin();
+	Vec3 lightPosEyeSpace = origin.getTransformed(cam.getViewMatrix());
 	shader.findUniVar("lightPos")->set(&lightPosEyeSpace);
 	shader.findUniVar("lightRadius")->set(&light.getRadius());
 	shader.findUniVar("lightDiffuseCol")->set(&light.getDiffuseCol());
@@ -194,10 +201,10 @@ void Is::spotLightPass(const SpotLight& light)
 	if(light.castsShadow() && sm.isEnabled())
 	{
 		Vec3 zAxis = light.getWorldTransform().getRotation().getColumn(2);
-		LineSegment seg(light.getWorldTransform().getOrigin(),
-		                -zAxis * light.getCamera().getZFar());
+		Col::LineSegment seg(light.getWorldTransform().getOrigin(),
+			-zAxis * light.getCamera().getZFar());
 
-		const Plane& plane = cam.getWSpaceFrustumPlane(Camera::FP_NEAR);
+		const Col::Plane& plane = cam.getWSpaceFrustumPlane(Camera::FP_NEAR);
 
 		float dist = seg.testPlane(plane);
 
@@ -248,7 +255,8 @@ void Is::spotLightPass(const SpotLight& light)
 	shdr->findUniVar("zNear")->set(&zNear);
 
 	// the light params
-	Vec3 lightPosEyeSpace = light.getWorldTransform().getOrigin().getTransformed(cam.getViewMatrix());
+	const Vec3& origin = light.getWorldTransform().getOrigin();
+	Vec3 lightPosEyeSpace = origin.getTransformed(cam.getViewMatrix());
 	shdr->findUniVar("lightPos")->set(&lightPosEyeSpace);
 	float tmp = light.getDistance();
 	shdr->findUniVar("lightRadius")->set(&tmp);
@@ -258,10 +266,12 @@ void Is::spotLightPass(const SpotLight& light)
 
 	// set texture matrix for texture & shadowmap projection
 	// Bias * P_light * V_light * inv(V_cam)
-	static Mat4 biasMat4(0.5, 0.0, 0.0, 0.5, 0.0, 0.5, 0.0, 0.5, 0.0, 0.0, 0.5, 0.5, 0.0, 0.0, 0.0, 1.0);
+	static Mat4 biasMat4(0.5, 0.0, 0.0, 0.5, 0.0, 0.5, 0.0, 0.5, 0.0, 0.0, 0.5,
+		0.5, 0.0, 0.0, 0.0, 1.0);
 	Mat4 texProjectionMat;
 	texProjectionMat = biasMat4 * light.getCamera().getProjectionMatrix() *
-	                   Mat4::combineTransformations(light.getCamera().getViewMatrix(), Mat4(cam.getWorldTransform()));
+		Mat4::combineTransformations(light.getCamera().getViewMatrix(),
+		Mat4(cam.getWorldTransform()));
 	shdr->findUniVar("texProjectionMat")->set(&texProjectionMat);
 
 	// the shadowmap
@@ -318,7 +328,8 @@ void Is::run()
 	GlStateMachineSingleton::getInstance().enable(GL_STENCIL_TEST);
 
 	// for all lights
-	BOOST_FOREACH(const PointLight* light, r.getCamera().getVisiblePointLights())
+	BOOST_FOREACH(const PointLight* light,
+		r.getCamera().getVisiblePointLights())
 	{
 		pointLightPass(*light);
 	}

+ 1 - 1
src/Renderer/MainRenderer.cpp

@@ -6,7 +6,7 @@
 #include <boost/algorithm/string.hpp>
 #include "GfxApi/GlException.h"
 #include "MainRenderer.h"
-#include "App.h"
+#include "Core/App.h"
 #include "RendererInitializer.h"
 #include "Ssao.h"
 #include "Core/Logger.h"

+ 2 - 2
src/Renderer/Ms.cpp

@@ -1,9 +1,9 @@
 #include <boost/foreach.hpp>
 #include "Ms.h"
 #include "Renderer.h"
-#include "Camera.h"
+#include "Scene/Camera.h"
 #include "Ez.h"
-#include "RenderableNode.h"
+#include "Scene/RenderableNode.h"
 
 
 //==============================================================================

+ 1 - 2
src/Renderer/Renderer.cpp

@@ -1,8 +1,7 @@
 #include "Renderer.h"
-#include "Camera.h"
 #include "RendererInitializer.h"
 #include "Util/Exception.h"
-#include "PerspectiveCamera.h"
+#include "Scene/PerspectiveCamera.h"
 
 
 //==============================================================================

+ 2 - 2
src/Renderer/SkinsDeformer.cpp

@@ -1,7 +1,7 @@
 #include "SkinsDeformer.h"
 #include "Resources/ShaderProg.h"
-#include "SkinPatchNode.h"
-#include "SkinNode.h"
+#include "Scene/SkinPatchNode.h"
+#include "Scene/SkinNode.h"
 
 
 //==============================================================================

+ 6 - 6
src/Renderer/Sm.cpp

@@ -1,12 +1,12 @@
 #include <boost/foreach.hpp>
 #include "Sm.h"
 #include "Renderer.h"
-#include "App.h"
-#include "Scene.h"
-#include "LightRsrc.h"
-#include "Camera.h"
-#include "Light.h"
-#include "SpotLight.h"
+#include "Core/App.h"
+#include "Scene/Scene.h"
+#include "Resources/LightRsrc.h"
+#include "Scene/Camera.h"
+#include "Scene/Light.h"
+#include "Scene/SpotLight.h"
 #include "RendererInitializer.h"
 
 

+ 11 - 10
src/Renderer/Smo.cpp

@@ -1,15 +1,15 @@
 #include "Smo.h"
 #include "Renderer.h"
-#include "Light.h"
-#include "LightRsrc.h"
-#include "PointLight.h"
-#include "SpotLight.h"
-#include "Camera.h"
+#include "Scene/Light.h"
+#include "Resources/LightRsrc.h"
+#include "Scene/PointLight.h"
+#include "Scene/SpotLight.h"
+#include "Scene/Camera.h"
 #include "GfxApi/BufferObjects/Vao.h"
 #include "GfxApi/BufferObjects/Vbo.h"
-#include "PerspectiveCamera.h"
-#include "OrthographicCamera.h"
-#include "Mesh.h"
+#include "Scene/PerspectiveCamera.h"
+#include "Scene/OrthographicCamera.h"
+#include "Resources/Mesh.h"
 
 
 const float THRESHOLD = 0.2;
@@ -135,8 +135,9 @@ void Smo::run(const SpotLight& light)
 {
 	const Camera& lcam = light.getCamera();
 
-	bool inside =  lcam.insideFrustum(Sphere(r.getCamera().getWorldTransform().getOrigin(),
-	                                         r.getCamera().getZNear() + THRESHOLD));
+	const Vec3& origin = r.getCamera().getWorldTransform().getOrigin();
+	float radius = r.getCamera().getZNear() + THRESHOLD;
+	bool inside =  lcam.insideFrustum(Col::Sphere(origin, radius));
 
 	// set GL state
 	setUpGl(inside);

+ 2 - 2
src/Renderer/Ssao.cpp

@@ -1,9 +1,9 @@
 #include <boost/lexical_cast.hpp>
 #include "Ssao.h"
 #include "Renderer.h"
-#include "Camera.h"
+#include "Scene/Camera.h"
 #include "RendererInitializer.h"
-#include "PerspectiveCamera.h"
+#include "Scene/PerspectiveCamera.h"
 
 
 //==============================================================================

+ 1 - 1
src/Resources/Material.cpp

@@ -3,7 +3,7 @@
 #include <boost/property_tree/xml_parser.hpp>
 #include <boost/foreach.hpp>
 #include <boost/lexical_cast.hpp>
-#include "Material.h"
+#include "Resources/Material.h"
 #include "Resources/Texture.h"
 #include "Resources/ShaderProg.h"
 #include "Misc/PropertyTree.h"

+ 1 - 1
src/Resources/Mesh.cpp

@@ -1,7 +1,7 @@
 #include <fstream>
 #include <boost/lexical_cast.hpp>
 #include "Mesh.h"
-#include "Material.h"
+#include "Resources/Material.h"
 #include "MeshData.h"
 #include "GfxApi/BufferObjects/Vbo.h"
 

+ 1 - 1
src/Resources/Model.cpp

@@ -5,7 +5,7 @@
 #include <boost/assign.hpp>
 #include <boost/range/iterator_range.hpp>
 #include "Model.h"
-#include "Material.h"
+#include "Resources/Material.h"
 #include "Mesh.h"
 #include "SkelAnim.h"
 #include "MeshData.h"

+ 1 - 1
src/Resources/ModelPatch.cpp

@@ -1,6 +1,6 @@
 #include "ModelPatch.h"
 #include "Mesh.h"
-#include "Material.h"
+#include "Resources/Material.h"
 
 
 //==============================================================================

+ 1 - 1
src/Resources/ResourceManager.cpp

@@ -1,7 +1,7 @@
 #include "ResourceManager.h"
 
 #include "Resources/Texture.h"
-#include "Material.h"
+#include "Resources/Material.h"
 #include "Resources/ShaderProg.h"
 #include "Mesh.h"
 #include "Skeleton.h"

+ 1 - 1
src/Resources/RsrcAsyncLoadingReqsHandler.cpp

@@ -1,7 +1,7 @@
 #include "RsrcAsyncLoadingReqsHandler.h"
 #include "Resources/Texture.h"
 #include "Core/Logger.h"
-#include "HighRezTimer.h"
+#include "Util/HighRezTimer.h"
 #include "Util/Assert.h"
 #include "Core/Globals.h"
 

+ 2 - 2
src/Resources/ShaderPrePreprocessor.cpp

@@ -4,8 +4,8 @@
 #include <boost/lexical_cast.hpp>
 #include <boost/foreach.hpp>
 #include "ShaderPrePreprocessor.h"
-#include "Parser.h"
-#include "Util.h"
+#include "Misc/Parser.h"
+#include "Util/Util.h"
 #include "Util/Exception.h"
 
 

+ 2 - 2
src/Resources/ShaderProg.cpp

@@ -6,10 +6,10 @@
 #include <sstream>
 #include "Resources/ShaderProg.h"
 #include "ShaderPrePreprocessor.h"
-#include "App.h" // To get cache dir
+#include "Core/App.h" // To get cache dir
 #include "GfxApi/GlException.h"
 #include "Core/Logger.h"
-#include "Util.h"
+#include "Util/Util.h"
 #include "Core/Globals.h"
 
 

+ 1 - 1
src/Resources/Skeleton.cpp

@@ -1,7 +1,7 @@
 #include <cstring>
 #include <fstream>
 #include "Skeleton.h"
-#include "BinaryStream.h"
+#include "Util/BinaryStream.h"
 
 
 //==============================================================================

+ 4 - 0
src/Scene/CMakeLists.txt

@@ -0,0 +1,4 @@
+FILE(GLOB_RECURSE SCENE_SOURCES *.cpp)
+FILE(GLOB_RECURSE SCENE_HEADERS *.h)
+
+ADD_LIBRARY(Scene ${SCENE_SOURCES} ${SCENE_HEADERS})

+ 2 - 2
src/Scene/Camera.cpp

@@ -30,9 +30,9 @@ void Camera::updateWSpaceFrustumPlanes()
 //==============================================================================
 // insideFrustum                                                               =
 //==============================================================================
-bool Camera::insideFrustum(const CollisionShape& bvol) const
+bool Camera::insideFrustum(const Col::CollisionShape& bvol) const
 {
-	BOOST_FOREACH(const Plane& plane, wspaceFrustumPlanes)
+	BOOST_FOREACH(const Col::Plane& plane, wspaceFrustumPlanes)
 	{
 		if(bvol.testPlane(plane) < 0.0)
 		{

+ 1 - 1
src/Scene/Controller.cpp

@@ -1,6 +1,6 @@
 #include "Controller.h"
 #include "Scene.h"
-#include "App.h"
+#include "Core/App.h"
 #include "Core/Globals.h"
 
 

+ 1 - 1
src/Scene/Light.cpp

@@ -1,5 +1,5 @@
 #include "Light.h"
-#include "LightRsrc.h"
+#include "Resources/LightRsrc.h"
 
 
 //==============================================================================

+ 1 - 1
src/Scene/Light.h

@@ -4,7 +4,7 @@
 #include "Resources/Texture.h"
 #include "SceneNode.h"
 #include "Resources/RsrcPtr.h"
-#include "LightRsrc.h"
+#include "Resources/LightRsrc.h"
 #include "VisibilityInfo.h"
 
 

+ 1 - 1
src/Scene/MaterialRuntime.cpp

@@ -1,6 +1,6 @@
 #include <boost/foreach.hpp>
 #include "MaterialRuntime.h"
-#include "Material.h"
+#include "Resources/Material.h"
 #include "Util/Exception.h"
 
 

+ 1 - 1
src/Scene/MaterialRuntime.h

@@ -5,7 +5,7 @@
 #include "MaterialRuntimeUserDefinedVar.h"
 #include "Util/Accessors.h"
 #include "Util/CharPtrHashMap.h"
-#include "Material.h"
+#include "Resources/Material.h"
 
 
 

+ 1 - 1
src/Scene/MaterialRuntimeUserDefinedVar.h

@@ -1,7 +1,7 @@
 #ifndef MATERIAL_RUNTIME_USER_DEFINED_VAR_H
 #define MATERIAL_RUNTIME_USER_DEFINED_VAR_H
 
-#include "MtlUserDefinedVar.h"
+#include "Resources/MtlUserDefinedVar.h"
 
 
 /// This holds a copy of the MtlUserDefinedVar's data in order to be changed inside the main loop

+ 2 - 2
src/Scene/ModelNode.cpp

@@ -1,7 +1,7 @@
 #include <boost/foreach.hpp>
 #include "ModelNode.h"
-#include "Model.h"
-#include "Skeleton.h"
+#include "Resources/Model.h"
+#include "Resources/Skeleton.h"
 
 
 //==============================================================================

+ 3 - 3
src/Scene/ModelNode.h

@@ -7,7 +7,7 @@
 #include "Util/Accessors.h"
 #include "ModelPatchNode.h"
 #include "Util/Vec.h"
-#include "Obb.h"
+#include "Collision/Obb.h"
 
 
 class Model;
@@ -24,7 +24,7 @@ class ModelNode: public SceneNode
 		/// @{
 		GETTER_RW(Vec<ModelPatchNode*>, patches, getModelPatchNodes)
 		const Model& getModel() const {return *model;}
-		const Obb& getVisibilityShapeWSpace() const {return visibilityShapeWSpace;}
+		const Col::Obb& getVisibilityShapeWSpace() const {return visibilityShapeWSpace;}
 		/// @}
 
 		/// Initialize the node
@@ -39,7 +39,7 @@ class ModelNode: public SceneNode
 	private:
 		RsrcPtr<Model> model;
 		Vec<ModelPatchNode*> patches;
-		Obb visibilityShapeWSpace;
+		Col::Obb visibilityShapeWSpace;
 };
 
 

+ 3 - 3
src/Scene/ModelPatchNode.cpp

@@ -1,8 +1,8 @@
 #include <boost/array.hpp>
 #include "ModelPatchNode.h"
-#include "Material.h"
-#include "MeshData.h"
-#include "ModelPatch.h"
+#include "Resources/Material.h"
+#include "Resources/MeshData.h"
+#include "Resources/ModelPatch.h"
 #include "ModelNode.h"
 #include "ModelNode.h"
 

+ 3 - 3
src/Scene/ModelPatchNode.h

@@ -2,7 +2,7 @@
 #define MODEL_PATCH_NODE_H
 
 #include "PatchNode.h"
-#include "Obb.h"
+#include "Collision/Obb.h"
 
 
 class ModelNode;
@@ -14,14 +14,14 @@ class ModelPatchNode: public PatchNode
 	public:
 		ModelPatchNode(const ModelPatch& modelPatch, ModelNode* parent);
 
-		const Obb& getVisibilityShapeWSpace() const {return visibilityShapeWSpace;}
+		const Col::Obb& getVisibilityShapeWSpace() const {return visibilityShapeWSpace;}
 
 		virtual void moveUpdate(); ///< Update the visibility shape
 		virtual void frameUpdate(float /*prevUpdateTime*/, float /*crntTime*/) {}
 
 	private:
 		const ModelPatch& modelPatch;
-		Obb visibilityShapeWSpace;
+		Col::Obb visibilityShapeWSpace;
 };
 
 

+ 6 - 6
src/Scene/OrthographicCamera.cpp

@@ -22,12 +22,12 @@ void OrthographicCamera::setAll(float left_, float right_, float top_, float bot
 //==============================================================================
 void OrthographicCamera::calcLSpaceFrustumPlanes()
 {
-	lspaceFrustumPlanes[FP_LEFT] = Plane(Vec3(1.0, 0.0, 0.0), left);
-	lspaceFrustumPlanes[FP_RIGHT] = Plane(Vec3(-1.0, 0.0, 0.0), -right);
-	lspaceFrustumPlanes[FP_NEAR] = Plane(Vec3(0.0, 0.0, -1.0), zNear);
-	lspaceFrustumPlanes[FP_FAR] = Plane(Vec3(0.0, 0.0, 1.0), -zFar);
-	lspaceFrustumPlanes[FP_TOP] = Plane(Vec3(0.0, -1.0, 0.0), -top);
-	lspaceFrustumPlanes[FP_BOTTOM] = Plane(Vec3(0.0, 1.0, 0.0), bottom);
+	lspaceFrustumPlanes[FP_LEFT] = Col::Plane(Vec3(1.0, 0.0, 0.0), left);
+	lspaceFrustumPlanes[FP_RIGHT] = Col::Plane(Vec3(-1.0, 0.0, 0.0), -right);
+	lspaceFrustumPlanes[FP_NEAR] = Col::Plane(Vec3(0.0, 0.0, -1.0), zNear);
+	lspaceFrustumPlanes[FP_FAR] = Col::Plane(Vec3(0.0, 0.0, 1.0), -zFar);
+	lspaceFrustumPlanes[FP_TOP] = Col::Plane(Vec3(0.0, -1.0, 0.0), -top);
+	lspaceFrustumPlanes[FP_BOTTOM] = Col::Plane(Vec3(0.0, 1.0, 0.0), bottom);
 }
 
 

+ 1 - 1
src/Scene/Particle.cpp

@@ -1,5 +1,5 @@
 #include "Particle.h"
-#include "PhysRigidBody.h"
+#include "Physics/PhysRigidBody.h"
 
 
 //==============================================================================

+ 3 - 4
src/Scene/ParticleEmitter.cpp

@@ -3,11 +3,10 @@
 #include <btBulletDynamicsCommon.h>
 #include "ParticleEmitter.h"
 #include "Particle.h"
-#include "PhysRigidBody.h"
-#include "MainRenderer.h"
-#include "App.h"
+#include "Physics/PhysRigidBody.h"
+#include "Core/App.h"
 #include "Scene.h"
-#include "Util.h"
+#include "Util/Util.h"
 
 
 btTransform ParticleEmitter::startingTrf(toBt(Mat3::getIdentity()), btVector3(10000000.0, 10000000.0, 10000000.0));

+ 1 - 1
src/Scene/ParticleEmitter.h

@@ -5,7 +5,7 @@
 #include <boost/scoped_ptr.hpp>
 #include <btBulletCollisionCommon.h>
 #include "SceneNode.h"
-#include "ParticleEmitterRsrc.h"
+#include "Resources/ParticleEmitterRsrc.h"
 #include "Resources/RsrcPtr.h"
 
 

+ 1 - 1
src/Scene/PatchNode.cpp

@@ -1,5 +1,5 @@
 #include "PatchNode.h"
-#include "Material.h"
+#include "Resources/Material.h"
 #include "MaterialRuntime.h"
 
 

+ 2 - 2
src/Scene/PatchNode.h

@@ -4,9 +4,9 @@
 #include <boost/scoped_ptr.hpp>
 #include "GfxApi/BufferObjects/Vao.h"
 #include "GfxApi/BufferObjects/Vbo.h"
-#include "Mesh.h" // For the Vbos enum
+#include "Resources/Mesh.h" // For the Vbos enum
 #include "Resources/RsrcPtr.h"
-#include "ModelPatch.h"
+#include "Resources/ModelPatch.h"
 #include "RenderableNode.h"
 #include "MaterialRuntime.h"
 

+ 6 - 6
src/Scene/PerspectiveCamera.cpp

@@ -52,20 +52,20 @@ void PerspectiveCamera::calcLSpaceFrustumPlanes()
 
 	sinCos(PI + fovX / 2, s, c);
 	// right
-	lspaceFrustumPlanes[FP_RIGHT] = Plane(Vec3(c, 0.0, s), 0.0);
+	lspaceFrustumPlanes[FP_RIGHT] = Col::Plane(Vec3(c, 0.0, s), 0.0);
 	// left
-	lspaceFrustumPlanes[FP_LEFT] = Plane(Vec3(-c, 0.0, s), 0.0);
+	lspaceFrustumPlanes[FP_LEFT] = Col::Plane(Vec3(-c, 0.0, s), 0.0);
 
 	sinCos((3 * PI - fovY) * 0.5, s, c);
 	// top
-	lspaceFrustumPlanes[FP_TOP] = Plane(Vec3(0.0, s, c), 0.0);
+	lspaceFrustumPlanes[FP_TOP] = Col::Plane(Vec3(0.0, s, c), 0.0);
 	// bottom
-	lspaceFrustumPlanes[FP_BOTTOM] = Plane(Vec3(0.0, -s, c), 0.0);
+	lspaceFrustumPlanes[FP_BOTTOM] = Col::Plane(Vec3(0.0, -s, c), 0.0);
 
 	// near
-	lspaceFrustumPlanes[FP_NEAR] = Plane(Vec3(0.0, 0.0, -1.0), zNear);
+	lspaceFrustumPlanes[FP_NEAR] = Col::Plane(Vec3(0.0, 0.0, -1.0), zNear);
 	// far
-	lspaceFrustumPlanes[FP_FAR] = Plane(Vec3(0.0, 0.0, 1.0), -zFar);
+	lspaceFrustumPlanes[FP_FAR] = Col::Plane(Vec3(0.0, 0.0, 1.0), -zFar);
 }
 
 

+ 1 - 1
src/Scene/Scene.cpp

@@ -7,7 +7,7 @@
 #include "Camera.h"
 #include "Light.h"
 #include "Controller.h"
-#include "Material.h"
+#include "Resources/Material.h"
 #include "ParticleEmitter.h"
 #include "ModelNode.h"
 #include "SkinNode.h"

+ 5 - 5
src/Scene/SkelAnimModelNodeCtrl.cpp

@@ -1,12 +1,12 @@
 #include <boost/foreach.hpp>
 #include "SkelAnimModelNodeCtrl.h"
-#include "SkelAnim.h"
-#include "Skeleton.h"
 #include "SkinNode.h"
-#include "Model.h"
-#include "MainRenderer.h"
-#include "Skin.h"
+#include "Resources/SkelAnim.h"
+#include "Resources/Skeleton.h"
+#include "Resources/Model.h"
+#include "Resources/Skin.h"
 #include "Core/Globals.h"
+#include "Renderer/MainRenderer.h"
 
 
 //==============================================================================

+ 2 - 2
src/Scene/SkinNode.cpp

@@ -1,8 +1,8 @@
 #include <boost/foreach.hpp>
 #include "SkinNode.h"
-#include "Skin.h"
+#include "Resources/Skin.h"
 #include "SkinPatchNode.h"
-#include "Skeleton.h"
+#include "Resources/Skeleton.h"
 
 
 //==============================================================================

+ 2 - 2
src/Scene/SkinNode.h

@@ -27,7 +27,7 @@ class SkinNode: public SceneNode
 		GETTER_RW(Vec<Mat3>, boneRotations, getBoneRotations)
 		GETTER_RW(Vec<Vec3>, boneTranslations, getBoneTranslations)
 		GETTER_R(Skin, *skin, getSkin)
-		GETTER_R(Obb, visibilityShapeWSpace, getVisibilityShapeWSpace)
+		GETTER_R(Col::Obb, visibilityShapeWSpace, getVisibilityShapeWSpace)
 		GETTER_R(Vec<SkinPatchNode*>, patches, getPatcheNodes)
 		/// @}
 
@@ -42,7 +42,7 @@ class SkinNode: public SceneNode
 	private:
 		RsrcPtr<Skin> skin; ///< The resource
 		Vec<SkinPatchNode*> patches;
-		Obb visibilityShapeWSpace;
+		Col::Obb visibilityShapeWSpace;
 
 		/// @name Bone data
 		/// @{

+ 1 - 1
src/Scene/SkinPatchNode.cpp

@@ -1,6 +1,6 @@
 #include "SkinPatchNode.h"
 #include "SkinNode.h"
-#include "SkinsDeformer.h"
+#include "Renderer/SkinsDeformer.h"
 
 
 #define BUFFER_OFFSET(i) ((char *)NULL + (i))

+ 4 - 4
src/Scene/VisibilityTester.cpp

@@ -4,11 +4,11 @@
 #include "ModelNode.h"
 #include "SkinNode.h"
 #include "ModelPatchNode.h"
-#include "Material.h"
-#include "Sphere.h"
+#include "Resources/Material.h"
+#include "Collision/Sphere.h"
 #include "PointLight.h"
 #include "SpotLight.h"
-#include "JobManager.h"
+#include "Core/JobManager.h"
 #include "Core/Logger.h"
 
 
@@ -58,7 +58,7 @@ void VisibilityTester::test(Camera& cam)
 			{
 				PointLight* pointl = static_cast<PointLight*>(light);
 
-				Sphere sphere(pointl->getWorldTransform().getOrigin(), pointl->getRadius());
+				Col::Sphere sphere(pointl->getWorldTransform().getOrigin(), pointl->getRadius());
 				if(cam.insideFrustum(sphere))
 				{
 					cam.getVisiblePointLights().push_back(pointl);

+ 6 - 0
src/Scripting/CMakeLists.txt

@@ -0,0 +1,6 @@
+FILE(GLOB_RECURSE SCRIPTING_SOURCES *.cpp)
+FILE(GLOB_RECURSE SCRIPTING_HEADERS *.h)
+
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
+
+ADD_LIBRARY(Scripting ${SCRIPTING_SOURCES} ${SCRIPTING_HEADERS})

+ 1 - 1
src/Scripting/Core/App.bpi.cpp

@@ -1,5 +1,5 @@
 #include "ScriptingCommon.h"
-#include "App.h"
+#include "Core/App.h"
 
 
 WRAP(App)

+ 4 - 4
src/Scripting/Core/Globals.bpi.cpp

@@ -1,10 +1,10 @@
 #include "ScriptingCommon.h"
 #include "Core/Globals.h"
 #include "Core/Logger.h"
-#include "MainRenderer.h"
-#include "Input.h"
-#include "Scene.h"
-#include "App.h"
+#include "Renderer/MainRenderer.h"
+#include "Input/Input.h"
+#include "Scene/Scene.h"
+#include "Core/App.h"
 #include "Events/Manager.h"
 
 

+ 1 - 1
src/Scripting/Input/Input.bpi.cpp

@@ -1,5 +1,5 @@
 #include "ScriptingCommon.h"
-#include "Input.h"
+#include "Input/Input.h"
 
 
 WRAP(Input)

+ 1 - 1
src/Scripting/Renderer/Bl.bpi.cpp

@@ -1,5 +1,5 @@
 #include "ScriptingCommon.h"
-#include "Bl.h"
+#include "Renderer/Bl.h"
 
 
 WRAP(Bl)

+ 1 - 1
src/Scripting/Renderer/Dbg.bpi.cpp

@@ -1,5 +1,5 @@
 #include "ScriptingCommon.h"
-#include "Dbg.h"
+#include "Renderer/Dbg.h"
 
 
 WRAP(Dbg)

+ 1 - 1
src/Scripting/Renderer/Hdr.bpi.cpp

@@ -1,5 +1,5 @@
 #include "ScriptingCommon.h"
-#include "Hdr.h"
+#include "Renderer/Hdr.h"
 
 
 WRAP(Hdr)

+ 2 - 2
src/Scripting/Renderer/MainRenderer.bpi.cpp

@@ -1,6 +1,6 @@
 #include "ScriptingCommon.h"
-#include "MainRenderer.h"
-#include "Dbg.h"
+#include "Renderer/MainRenderer.h"
+#include "Renderer/Dbg.h"
 
 
 WRAP(MainRenderer)

+ 3 - 3
src/Scripting/Renderer/Pps.bpi.cpp

@@ -1,7 +1,7 @@
 #include "ScriptingCommon.h"
-#include "Pps.h"
-#include "Hdr.h"
-#include "Bl.h"
+#include "Renderer/Pps.h"
+#include "Renderer/Hdr.h"
+#include "Renderer/Bl.h"
 
 
 WRAP(Pps)

+ 1 - 1
src/Scripting/Renderer/Renderer.bpi.cpp

@@ -1,5 +1,5 @@
 #include "ScriptingCommon.h"
-#include "Renderer.h"
+#include "Renderer/Renderer.h"
 
 
 WRAP(Renderer)

+ 1 - 1
src/Scripting/Scene/Camera.bpi.cpp

@@ -1,5 +1,5 @@
 #include "ScriptingCommon.h"
-#include "Camera.h"
+#include "Scene/Camera.h"
 
 
 WRAP(Camera)

+ 1 - 1
src/Scripting/Scene/MaterialRuntime/MaterialRuntime.bpi.cpp → src/Scripting/Scene/MaterialRuntime.bpi.cpp

@@ -1,5 +1,5 @@
 #include "ScriptingCommon.h"
-#include "MaterialRuntime.h"
+#include "Scene/MaterialRuntime.h"
 
 
 WRAP(MaterialRuntime)

+ 1 - 1
src/Scripting/Scene/ModelNode.bpi.cpp

@@ -1,5 +1,5 @@
 #include "ScriptingCommon.h"
-#include "ModelNode.h"
+#include "Scene/ModelNode.h"
 
 
 WRAP(ModelNode)

+ 1 - 1
src/Scripting/Scene/ModelPatchNode.bpi.cpp

@@ -1,5 +1,5 @@
 #include "ScriptingCommon.h"
-#include "ModelPatchNode.h"
+#include "Scene/ModelPatchNode.h"
 
 
 WRAP(ModelPatchNode)

+ 1 - 1
src/Scripting/Scene/PatchNode.bpi.cpp

@@ -1,5 +1,5 @@
 #include "ScriptingCommon.h"
-#include "PatchNode.h"
+#include "Scene/PatchNode.h"
 
 
 WRAP(PatchNode)

+ 3 - 3
src/Scripting/Scene/Scene.bpi.cpp

@@ -1,7 +1,7 @@
 #include "ScriptingCommon.h"
-#include "Scene.h"
-#include "Camera.h"
-#include "ModelNode.h"
+#include "Scene/Scene.h"
+#include "Scene/Camera.h"
+#include "Scene/ModelNode.h"
 
 
 WRAP(Scene)

+ 1 - 1
src/Scripting/Scene/SceneNode.bpi.cpp

@@ -1,5 +1,5 @@
 #include "ScriptingCommon.h"
-#include "SceneNode.h"
+#include "Scene/SceneNode.h"
 
 
 WRAP(SceneNode)

+ 1 - 1
src/Scripting/Util/HighRezTimer.bpi.cpp

@@ -1,5 +1,5 @@
 #include "ScriptingCommon.h"
-#include "HighRezTimer.h"
+#include "Util/HighRezTimer.h"
 
 
 WRAP(HighRezTimer)

+ 3 - 5
src/Util/CMakeLists.txt

@@ -1,6 +1,4 @@
-FILE(GLOB UTIL_SOURCES *.cpp)
-FILE(GLOB UTIL_HEADERS *.h)
+FILE(GLOB_RECURSE UTIL_SOURCES *.cpp)
+FILE(GLOB_RECURSE UTIL_HEADERS *.h)
 
-SUBDIRS(Scanner)
-
-ADD_LIBRARY(Util ${UTIL_SOURCES} ${UTIL_HEADERS} Scanner)
+ADD_LIBRARY(Util ${UTIL_SOURCES} ${UTIL_HEADERS})

+ 1 - 1
unit-tests/Resources/Material.ut.cpp

@@ -1,5 +1,5 @@
 #include <gtest/gtest.h>
-#include "Material.h"
+#include "Resources/Material.h"aterial.h"
 #include "Resources/RsrcPtr.h"