Index: code/branches/FICN/CMakeLists.txt
===================================================================
--- code/branches/FICN/CMakeLists.txt	(revision 336)
+++ code/branches/FICN/CMakeLists.txt	(revision 337)
@@ -5,4 +5,7 @@
 #Create some verbose output
 SET(CMAKE_VERBOSE_MAKEFILE TRUE)
+
+# set eNet search path
+SET(Boost_INCLUDE_DIR "/usr/include/boost/")
 
 #force-set the compile on tardis machines, as default points to g++-3.3
@@ -23,5 +26,5 @@
 	MESSAGE("ERROR: uname terminated unclean.")
   ENDIF (NOT "${UNAME_RV}" STREQUAL "0")
-  # check wheter we are on a tardis machine
+# check wheter we are on a tardis INCLUDEmachine
   IF ("${UNAME_OV}" MATCHES "tardis")
     SET (IS_TARDIS "tardis")
@@ -29,6 +32,8 @@
   # if on tardis change compiler
   IF (IS_TARDIS)
-  MESSAGE("System is a TARDIS: Setting Compiler to g++-3.4.3")
-  SET(CMAKE_CXX_COMPILER "g++-3.4.3")
+  MESSAGE("System is a TARDIS: Setting Compiler to g++-4.1.1")
+  SET(CMAKE_CXX_COMPILER "g++-4.1.1")
+# reset eNet serach path
+  SET(Boost_INCLUDE_DIR "/usr/pack/boost-1.34.1-sd/i686-debian-linux3.1/include/boost-1_34_1")
   ENDIF(IS_TARDIS)
 ENDIF (UNIX)
@@ -37,4 +42,7 @@
 #This sets where to look for "Find*.cmake" files
 SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
+# SET(BOOST_LIBDIR /usr/pack/boost-1.33.1-mo/i686-debian-linux3.1/lib/)
+# SET(BOOST_INCDIR /usr/pack/boost-1.33.1-mo/i686-debian-linux3.1/include/)
+
 #Performs the search and sets the variables
 FIND_PACKAGE(OGRE)
@@ -42,13 +50,15 @@
 FIND_PACKAGE(CEGUI)
 FIND_PACKAGE(CEGUI_OGRE)
+FIND_PACKAGE(ENet)
+FIND_PACKAGE(Boost)
 
 #Sets the search paths for the linking
-LINK_DIRECTORIES(${OGRE_LIB_DIR} ${OIS_LIB_DIR} ${CEGUI_LIB_DIR} ${CEGUI_OGRE_LIB_DIR})
+LINK_DIRECTORIES(${OGRE_LIB_DIR} ${OIS_LIB_DIR} ${CEGUI_LIB_DIR} ${CEGUI_OGRE_LIB_DIR} ${ENet_LIBRARY} ${Boost_LIBRARY_DIRS} core objects loader network weapon classHierarchy)
+
 #Sets the search path for include files
-#INCLUDE_DIRECTORIES(${OGRE_INCLUDE_DIR} ${OIS_INCLUDE_DIR} ${CEGUI_INCLUDE_DIR} ${CEGUI_OGRE_INCLUDE_DIR} -I/usr/include/enet)
-INCLUDE_DIRECTORIES(${OGRE_INCLUDE_DIR} ${OIS_INCLUDE_DIR} ${CEGUI_INCLUDE_DIR} ${CEGUI_OGRE_INCLUDE_DIR})
+INCLUDE_DIRECTORIES(${OGRE_INCLUDE_DIR} ${OIS_INCLUDE_DIR} ${CEGUI_INCLUDE_DIR} ${CEGUI_OGRE_INCLUDE_DIR} ${ENet_INCLUDE_DIR} ${Boost_INCLUDE_DIRS})
+
 
 #add main source dir
 ADD_SUBDIRECTORY(src)
 
-
Index: code/branches/FICN/INSTALL
===================================================================
--- code/branches/FICN/INSTALL	(revision 336)
+++ code/branches/FICN/INSTALL	(revision 337)
@@ -5,7 +5,8 @@
 ois-1.0
 cegui-0.5.0b
-enet-1.0
-
-cmake (used version 2.4.7)
+enet-1.1
+boost-1.34.1
+cmake-2.4.7
+(all named version were tested. lower version requirement may be possible)
 
 
Index: code/branches/FICN/Media/materials/scripts/Example.material
===================================================================
--- code/branches/FICN/Media/materials/scripts/Example.material	(revision 337)
+++ code/branches/FICN/Media/materials/scripts/Example.material	(revision 337)
@@ -0,0 +1,1044 @@
+
+material Examples/EnvMappedRustySteel
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture RustySteel.jpg
+			}
+
+			texture_unit
+			{
+				texture spheremap.png
+				colour_op_ex add src_texture src_current
+				colour_op_multipass_fallback one one
+				env_map spherical
+			}
+		}
+	}
+}
+material Examples/OgreLogo
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.8 0.8 0.8
+
+			texture_unit
+			{
+				texture ogrelogo.png
+			}
+		}
+	}
+}
+material Examples/DarkMaterial
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.1 0.1 0.1
+
+			texture_unit
+			{
+				texture BeachStones.jpg
+			}
+		}
+	}
+}
+material Examples/SpaceSkyBox
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_write off
+
+			texture_unit
+			{
+				cubic_texture stevecube.jpg separateUV
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+material Examples/SceneSkyBox1
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_write off
+
+			texture_unit
+			{
+				cubic_texture cubemap_fr.jpg cubemap_bk.jpg cubemap_lf.jpg cubemap_rt.jpg cubemap_up.jpg cubemap_dn.jpg separateUV
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+material Examples/SceneCubeMap1
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+
+			texture_unit
+			{
+				cubic_texture cubemap.jpg combinedUVW
+				tex_address_mode clamp
+				env_map cubic_reflection
+			}
+		}
+	}
+}
+material Examples/SceneSkyBox2
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_write off
+
+			texture_unit
+			{
+				cubic_texture cubescene_fr.jpg cubescene_bk.jpg cubescene_lf.jpg cubescene_rt.jpg cubescene_up.jpg cubescene_dn.jpg separateUV
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+material Examples/SceneCubeMap2
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+
+			texture_unit
+			{
+				cubic_texture cubescene.jpg combinedUVW
+				tex_address_mode clamp
+				env_map cubic_reflection
+			}
+		}
+	}
+}
+
+material Examples/CloudyNoonSkyBox
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_write off
+
+			texture_unit
+			{
+				cubic_texture cloudy_noon.jpg separateUV
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+
+material Examples/StormySkyBox
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_write off
+
+			texture_unit
+			{
+				cubic_texture stormy.jpg separateUV
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+
+
+fragment_program Examples/MorningSkyBoxHDRfp cg
+{
+	source hdr.cg
+	entry_point morningskybox_fp
+	profiles ps_2_0 arbfp1
+
+}
+material Examples/MorningSkyBox
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_write off
+
+			texture_unit
+			{
+				cubic_texture morning.jpg separateUV
+				tex_address_mode clamp
+			}
+		}
+	}
+
+	// HDR technique (fake)
+	technique
+	{
+		scheme HDR
+
+		pass
+		{
+			lighting off
+			depth_write off
+
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named ambient float4 1 1 1 1
+			}
+			fragment_program_ref Examples/MorningSkyBoxHDRfp
+			{
+			}
+
+			texture_unit
+			{
+				cubic_texture morning.jpg separateUV
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+fragment_program Examples/MorningCubeMapHDRfp cg
+{
+	source hdr.cg
+	entry_point morningcubemap_fp
+	profiles ps_2_0 arbfp1
+
+}
+material Examples/MorningCubeMap
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+
+			texture_unit
+			{
+				cubic_texture morning.jpg combinedUVW
+				tex_address_mode clamp
+				env_map cubic_reflection
+			}
+		}
+	}
+	// HDR technique (fake)
+	technique
+	{
+		scheme HDR
+
+		pass
+		{
+			lighting off
+
+			fragment_program_ref Examples/MorningCubeMapHDRfp
+			{
+			}
+			texture_unit
+			{
+				cubic_texture morning.jpg combinedUVW
+				tex_address_mode clamp
+				env_map cubic_reflection
+			}
+		}
+	}
+}
+
+
+material Examples/EveningSkyBox
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_write off
+
+			texture_unit
+			{
+				cubic_texture evening.jpg separateUV
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+
+material Examples/CloudySky
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_write off
+
+			texture_unit
+			{
+				texture clouds.jpg
+				scroll_anim 0.15 0
+			}
+		}
+	}
+}
+material Examples/RustySteel
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture RustySteel.jpg
+			}
+		}
+	}
+}
+material Examples/Chrome
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture Chrome.jpg
+				env_map spherical
+			}
+		}
+	}
+}
+material Examples/SpaceSkyPlane
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_write off
+			fog_override true none
+
+			texture_unit
+			{
+				texture spacesky.jpg
+			}
+		}
+	}
+}
+material Examples/TextureEffect1
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.75 0.75 0.75
+			cull_hardware none
+			cull_software none
+
+			texture_unit
+			{
+				texture BumpyMetal.jpg
+				rotate_anim 0.2
+				wave_xform scale_x sine 1 0.1 0 5
+				wave_xform scale_y sine 0.5 0.2 0.5 3
+			}
+		}
+	}
+}
+material Examples/TextureEffect2
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture Water02.jpg
+				scroll_anim 0.5 0
+			}
+		}
+	}
+}
+material Examples/TextureEffect3
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.7 0.7 0.7
+			cull_hardware none
+			cull_software none
+
+			texture_unit
+			{
+				texture Water01.jpg
+				scroll_anim -0.25 0.1
+			}
+
+			texture_unit
+			{
+				texture Water01.jpg
+				colour_op_ex add src_texture src_current
+				colour_op_multipass_fallback one one
+				scroll_anim -0.1 0.25
+			}
+		}
+	}
+}
+material Examples/TextureEffect4
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.3 0.3 0.3
+			scene_blend colour_blend
+			cull_hardware none
+			cull_software none
+
+			texture_unit
+			{
+				texture Water02.jpg
+				scroll_anim 0.01 0.01
+			}
+		}
+	}
+}
+material Examples/BumpyMetal
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.75 0.75 0.75
+			cull_hardware none
+			cull_software none
+
+			texture_unit
+			{
+				texture BumpyMetal.jpg
+			}
+		}
+	}
+}
+material Examples/TransparentTest
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.2 0.2 0.2
+			scene_blend add
+			depth_write off
+
+			texture_unit
+			{
+				texture Water01.jpg
+				scroll_anim 0.25 0
+			}
+
+			texture_unit
+			{
+				texture Water01.jpg
+				wave_xform scroll_y sine 0 0.1 0 0.5
+			}
+		}
+	}
+}
+material Examples/Flare
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend add
+			depth_write off
+
+			texture_unit
+			{
+				texture flare.png
+			}
+		}
+	}
+}
+material Examples/Flare2
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend add
+			depth_write off
+
+			texture_unit
+			{
+				texture flaretrail.png
+			}
+		}
+	}
+}
+material Examples/FlarePointSprite
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend add
+			depth_write off
+
+			point_sprites on
+			point_size 2
+			point_size_attenuation on
+
+			texture_unit
+			{
+				texture flare.png
+			}
+		}
+	}
+}
+
+material Examples/Droplet
+{
+	technique
+	{
+		pass
+		{
+			scene_blend colour_blend
+			depth_write off
+
+			texture_unit
+			{
+				texture basic_droplet.png
+			}
+		}
+	}
+}
+material Examples/Hilite/Yellow
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture dkyellow.png
+			}
+		}
+	}
+}
+material Examples/Rocky
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.2 0.2 0.2
+
+			texture_unit
+			{
+				texture egyptrockyfull.jpg
+			}
+		}
+	}
+}
+material Examples/10PointBlock
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture 10points.png
+			}
+		}
+	}
+}
+material Material__25
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture texmap2.jpg
+			}
+		}
+	}
+}
+material 2 - Default
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture MtlPlat2.jpg
+			}
+		}
+	}
+}
+material Material #8
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture BODY.jpg
+			}
+		}
+	}
+}
+material Material #3
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture HEAD4.jpg
+			}
+		}
+	}
+}
+material Material #9
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture LEGS.jpg
+			}
+		}
+	}
+}
+
+material Examples/Fish
+{
+	technique
+	{
+		pass
+		{
+			texture_unit
+			{
+				texture steelhead.png
+			}
+		}
+	}
+}
+material Examples/Ninja
+{
+	technique
+	{
+		pass
+		{
+		
+			texture_unit
+			{
+				texture nskingr.jpg
+			}
+		}
+	}
+}
+
+material Examples/Robot
+{
+	// Hardware skinning techniique
+	technique
+	{
+		pass
+		{
+			vertex_program_ref Ogre/HardwareSkinningOneWeight
+			{
+				param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+				param_named_auto viewProjectionMatrix viewproj_matrix
+				param_named_auto lightPos[0] light_position 0
+				param_named_auto lightPos[1] light_position 1
+				param_named_auto lightDiffuseColour[0] light_diffuse_colour 0
+				param_named_auto lightDiffuseColour[1] light_diffuse_colour 1
+				param_named_auto ambient ambient_light_colour
+			
+			}
+			// alternate shadow caster program
+			shadow_caster_vertex_program_ref Ogre/HardwareSkinningOneWeightShadowCaster
+			{
+				param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+				param_named_auto viewProjectionMatrix viewproj_matrix
+				param_named_auto ambient ambient_light_colour
+			
+			}
+
+			texture_unit
+			{
+				texture r2skin.jpg
+			}
+		}
+	}
+
+	// Software blending technique
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture r2skin.jpg
+			}
+		}
+	}
+}
+
+material Examples/GrassFloor
+{
+	technique
+	{
+		pass
+		{
+			texture_unit
+			{
+				texture grass_1024.jpg
+			}
+		}
+	}
+}
+
+vertex_program Examples/GrassWaverVp cg
+{
+	source Grass.cg
+	entry_point grass_vp
+	profiles vs_1_1 arbvp1
+}
+
+material Examples/GrassBlades
+{
+	// Vertex program waving grass
+    technique
+    {
+        pass
+        {
+			vertex_program_ref Examples/GrassWaverVp
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named_auto ambient ambient_light_colour
+				param_named_auto objSpaceLight light_position_object_space 0
+				param_named_auto lightColour light_diffuse_colour 0
+				param_named_auto offset custom 999
+			}
+			alpha_rejection greater 150 
+			scene_blend alpha_blend
+		    cull_hardware none
+            cull_software none
+            texture_unit
+            {
+                texture gras_02.png 
+            }
+        }
+    }
+
+	// Non-vertex program technique (no waving)
+	technique
+    {
+        pass
+        {
+			alpha_rejection greater 150 
+			scene_blend alpha_blend
+		    cull_hardware none
+            cull_software none
+            texture_unit
+            {
+                texture gras_02.png 
+            }
+        }
+    }
+}
+
+material Examples/Rockwall
+{
+	technique
+	{
+		pass
+		{
+			texture_unit
+			{
+				texture rockwall.tga
+			}
+		}
+	}
+}
+
+material Examples/Aureola
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_write off
+			cull_hardware none
+
+			texture_unit
+			{
+				texture aureola.png PF_BYTE_LA
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+
+// Test hardware morph animation
+material Examples/HardwareMorphAnimation
+{
+	technique
+	{
+		pass
+		{
+			
+			vertex_program_ref Ogre/HardwareMorphAnimation
+			{
+				// all default
+			}
+
+			texture_unit
+			{
+				tex_coord_set 0
+				colour_op_ex source1 src_current src_current
+			}
+			// need to define these texture units otherwise GL won't use the uv sets			
+			texture_unit
+			{
+				tex_coord_set 1
+				// also need to set blending to ignore texture which is GL warning texture
+				colour_op_ex source1 src_current src_current
+			}
+			texture_unit
+			{
+				tex_coord_set 2
+				colour_op_ex source1 src_current src_current
+			}
+		
+		}
+	}
+}
+
+// Test hardware pose animation
+material Examples/HardwarePoseAnimation
+{
+	technique
+	{
+		pass
+		{
+			
+			vertex_program_ref Ogre/HardwarePoseAnimation
+			{
+				// all default
+			}
+			texture_unit
+			{
+				tex_coord_set 0
+				colour_op_ex source1 src_current src_current
+			}
+			// need to define these texture units otherwise GL won't use the uv sets			
+			texture_unit
+			{
+				tex_coord_set 1
+				// also need to set blending to ignore texture which is GL warning texture
+				colour_op_ex source1 src_current src_current
+			}
+			texture_unit
+			{
+				tex_coord_set 2
+				colour_op_ex source1 src_current src_current
+			}
+
+		
+		}
+	}
+}
+
+material RustyBarrel
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.5 0.5 0.5 1.0
+			diffuse 1.0 1.0 1.0 1.0
+			specular 0.0 0.0 0.0 1.0 12.5
+			emissive 0.0 0.0 0.0 1.0
+			texture_unit
+			{
+				texture RustyBarrel.png
+				filtering trilinear
+			}
+		}
+	}
+}
+
+material WoodPallet
+{
+	receive_shadows on
+	technique
+	{
+		pass
+		{
+			ambient 0.5 0.5 0.5 1.0
+			diffuse 1.0 1.0 1.0 1.0
+			specular 0.0 0.0 0.0 1.0 12.5
+
+			texture_unit
+			{
+				texture WoodPallet.png
+				filtering trilinear
+			}
+		}
+	}
+}
+
+material Examples/LightRibbonTrail
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend add
+			depth_write off
+
+			texture_unit
+			{
+				texture ribbonband.png 1d
+				tex_address_mode clamp
+				filtering none
+			}
+		}
+	}
+}
+
+material Examples/TudorHouse
+{
+	technique
+	{
+		pass
+		{
+			texture_unit
+			{
+				texture fw12b.jpg
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+
+material jaiqua
+{
+	// Hardware skinning techniique
+	technique
+	{
+		pass
+		{
+			vertex_program_ref Ogre/HardwareSkinningTwoWeights
+			{
+			
+			}
+			// alternate shadow caster program
+			shadow_caster_vertex_program_ref Ogre/HardwareSkinningTwoWeightsShadowCaster
+			{
+				param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+				param_named_auto viewProjectionMatrix viewproj_matrix
+				param_named_auto ambient ambient_light_colour
+			
+			}
+
+			texture_unit
+			{
+				texture blue_jaiqua.jpg
+				tex_address_mode clamp
+			}
+		}
+	}
+
+	// Software blending technique
+	technique
+	{
+		pass
+		{
+			texture_unit
+			{
+				texture blue_jaiqua.jpg
+				tex_address_mode clamp
+			}
+		}
+	}
+	
+}
+
+
+material Examples/Plane/IntegratedShadows
+{
+	technique
+	{
+		pass
+		{
+			// Single-pass shadowing
+			texture_unit
+			{
+				texture MtlPlat2.jpg
+			}
+			texture_unit
+			{
+				// standard modulation blend
+				content_type shadow
+				tex_address_mode clamp
+			}
+		}
+	}
+	
+}
Index: code/branches/FICN/Media/materials/scripts/Examples.compositor
===================================================================
--- code/branches/FICN/Media/materials/scripts/Examples.compositor	(revision 337)
+++ code/branches/FICN/Media/materials/scripts/Examples.compositor	(revision 337)
@@ -0,0 +1,592 @@
+// Manuel's bloom
+// Needs a scene-sized rtt, but does only one render of the scene
+compositor Bloom
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 128 128 PF_A8R8G8B8
+        texture rt1 128 128 PF_A8R8G8B8
+
+        target rt1
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target rt0
+        {
+            // Start with clear texture
+            input none
+            // Vertical blur pass
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/Blur0
+                input 0 rt1
+            }
+        }
+
+        target rt1
+        {
+            // Start with clear texture
+            input none
+            // Horizontal blur pass
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/Blur1
+                input 0 rt0
+            }
+        }
+
+        target_output
+        {
+            // Start with clear output
+            input previous
+            // Draw a fullscreen quad
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/BloomBlend
+                input 0 rt1
+            }
+        }
+    }
+}
+
+compositor Glass
+{
+    technique
+    {
+        texture rt0 target_width target_height PF_R8G8B8
+
+        target rt0 { input previous }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+
+            pass render_quad
+            {
+                material Ogre/Compositor/GlassPass
+                input 0 rt0
+            }
+        }
+    }
+}
+
+compositor "Old TV"
+{
+    technique
+    {
+        texture rt0 target_width target_height PF_R8G8B8
+
+        // render scene to a texture
+        target rt0 { input previous }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+
+            pass render_quad
+            {
+                // convert the previous render target to a black and white image, add some noise, distort it,
+                // then render to scene aligned quad
+                material Ogre/Compositor/OldTV
+                input 0 rt0
+            }
+        }
+    }
+}
+
+
+// Black and white effect
+compositor B&W
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 target_width target_height PF_A8R8G8B8
+
+        target rt0
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+            // Draw a fullscreen quad with the black and white image
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/BlackAndWhite
+                input 0 rt0
+            }
+        }
+    }
+}
+
+//compositor DOF // based on Blur but final pass does depth of field
+//{
+//    technique
+//    {
+//        // Temporary textures
+//        texture rt0 target_width target_height PF_A8R8G8B8
+//        texture rt1 target_width target_height PF_A8R8G8B8
+//
+//        target rt1
+//        {
+//            // Render output from previous compositor (or original scene)
+//            input previous
+//        }
+//
+//        target rt0
+//        {
+//            // Start with clear texture
+//            input none
+//            // Vertical blur pass
+//            pass render_quad
+//            {
+//                // Renders a fullscreen quad with a material
+//                material Ogre/Compositor/DOF_Blur0
+//                input 0 rt1
+//            }
+//        }
+//
+//        target rt1
+//        {
+//            // Start with clear texture
+//            input none
+//            // Horizontal blur pass
+//            pass render_quad
+//            {
+//                // Renders a fullscreen quad with a material
+//                material Ogre/Compositor/DOF_Blur1
+//                input 0 rt0
+//            }
+//        }
+//
+//        target_output
+//        {
+//            // Start with clear output
+//            input none
+//            // Draw a fullscreen quad
+//            pass render_quad
+//            {
+//                // Renders a fullscreen quad with a material
+//                material Ogre/Compositor/DOF_Blend
+//                input 0 rt0
+//                input 1 rt1
+//            }
+//        }
+//    }
+//}
+
+// Embossed (fake bump) effect
+compositor Embossed
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 target_width target_height PF_A8R8G8B8
+
+        target rt0
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+            // Draw a fullscreen quad with the black and white image
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/Embossed
+                input 0 rt0
+            }
+        }
+    }
+}
+
+// SharpenEdges
+compositor Sharpen Edges
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 target_width target_height PF_A8R8G8B8
+
+        target rt0
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+            // Draw a fullscreen quad with the black and white image
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/SharpenEdges
+                input 0 rt0
+            }
+        }
+    }
+}
+
+// Invert
+compositor Invert
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 target_width target_height PF_A8R8G8B8
+
+        target rt0
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+            // Draw a fullscreen quad with the black and white image
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/Invert
+                input 0 rt0
+            }
+        }
+    }
+}
+
+// Posterize
+compositor Posterize
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 target_width target_height PF_A8R8G8B8
+
+        target rt0
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+            // Draw a fullscreen quad with the black and white image
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/Posterize
+                input 0 rt0
+            }
+        }
+    }
+}
+
+// Laplace
+compositor Laplace
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 target_width target_height PF_A8R8G8B8
+
+        target rt0
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+            // Draw a fullscreen quad with the black and white image
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/Laplace
+                input 0 rt0
+            }
+        }
+    }
+}
+
+// Tiling
+compositor Tiling
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 target_width target_height PF_A8R8G8B8
+
+        target rt0
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+            // Draw a fullscreen quad with the black and white image
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/Tiling
+                input 0 rt0
+            }
+        }
+    }
+}
+
+// Old Movie
+compositor Old Movie
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 target_width target_height PF_A8R8G8B8
+
+        target rt0
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+            // Draw a fullscreen quad with the black and white image
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/OldMovie
+                input 0 rt0
+            }
+        }
+    }
+}
+
+// HDR
+compositor HDR
+{
+	// floating point only for now
+	technique
+	{
+        // Temporary textures
+		// Fullsize HDR render target, used as tone mapping source
+        texture rt_full target_width target_height PF_FLOAT16_RGB
+		// Targets used for luminance evaluation (3x3 downsample, point filtering)
+		texture rt_lum0 1 1 PF_FLOAT16_RGB
+		texture rt_lum1 4 4 PF_FLOAT16_RGB
+		texture rt_lum2 16 16 PF_FLOAT16_RGB
+		texture rt_lum3 64 64 PF_FLOAT16_RGB
+		texture rt_lum4 128 128 PF_FLOAT16_RGB
+		// Bright-pass filtered target (tone mapped)
+		texture rt_brightpass 128 128 PF_R8G8B8
+		// Bloom filter targets
+		texture rt_bloom0 128 128 PF_R8G8B8
+		texture rt_bloom1 128 128 PF_R8G8B8
+
+
+		target rt_full
+		{
+			// No input, render differently
+			input none
+
+			// Use float target HDR material scheme (unclamped shaders)
+			material_scheme HDR
+
+			pass clear
+			{
+			}
+
+			pass render_scene
+			{
+			}
+
+		}
+
+		// Downsample the original HDR scene to extract luminence value
+		target rt_lum4
+		{
+            input none
+            pass render_quad
+            {
+                // Downsample using a 2x2 filter and convert to greyscale
+                material Ogre/Compositor/HDR/Downsample2x2Luminence
+                input 0 rt_full
+                identifier 994
+            }
+		}
+		target rt_lum3
+		{
+            input none
+            pass render_quad
+            {
+				// Downsample using a 3x3 filter
+                material Ogre/Compositor/HDR/Downsample3x3
+                input 0 rt_lum4
+                identifier 993
+            }
+		}
+		target rt_lum2
+		{
+            input none
+            pass render_quad
+            {
+                // Downsample using a 3x3 filter
+                material Ogre/Compositor/HDR/Downsample3x3
+                input 0 rt_lum3
+                identifier 992
+            }
+		}
+		target rt_lum1
+		{
+            input none
+            pass render_quad
+            {
+                // Downsample using a 3x3 filter
+                material Ogre/Compositor/HDR/Downsample3x3
+                input 0 rt_lum2
+                identifier 991
+            }
+		}
+		target rt_lum0
+		{
+            input none
+            pass render_quad
+            {
+                // Downsample using a 3x3 filter
+                material Ogre/Compositor/HDR/Downsample3x3
+                input 0 rt_lum1
+                identifier 990
+            }
+		}
+
+
+		target rt_brightpass
+		{
+            input none
+            pass render_quad
+            {
+                // Downsample using a 3x3 filter, hi-pass and tone map
+                material Ogre/Compositor/HDR/Downsample3x3Brightpass
+                input 0 rt_full
+		        input 1 rt_lum0
+				identifier 800
+            }
+		}
+
+		target rt_bloom1
+		{
+			input none
+			pass render_quad
+			{
+				// Blur horizontally
+				material Ogre/Compositor/HDR/GaussianBloom
+				input 0 rt_brightpass
+				identifier 701
+			}
+		}
+		target rt_bloom0
+		{
+			input none
+			pass render_quad
+			{
+				// Blur horizontally
+				material Ogre/Compositor/HDR/GaussianBloom
+				input 0 rt_bloom1
+				identifier 700
+			}
+		}
+
+
+		// Final output combines tone mapping of the original scene, with an
+		// exposure setting passed in as a GPU parameter, and an additive bloom
+		// effect
+		target_output
+		{
+			input none
+			pass render_quad
+			{
+				material Ogre/Compositor/HDR/ToneMapping
+				input 0 rt_full
+				input 1 rt_bloom0
+				input 2 rt_lum0
+			}
+		}
+
+
+	}
+
+}
+
+
+// Gaussian blur effect
+compositor Gaussian Blur
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 target_width target_height PF_A8R8G8B8
+        texture rt1 target_width target_height PF_A8R8G8B8
+
+        target rt0
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target rt1
+        {
+            // Blur horizontally
+            input none
+			pass render_quad
+			{
+				material Ogre/Compositor/HDR/GaussianBloom
+				input 0 rt0
+				identifier 700
+			}
+        }
+
+		target_output
+        {
+            // Start with clear output
+            input none
+            // Blur vertically
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+				material Ogre/Compositor/HDR/GaussianBloom
+                input 0 rt1
+				identifier 701
+            }
+        }
+    }
+}
+
Index: code/branches/FICN/Media/materials/scripts/Examples.program
===================================================================
--- code/branches/FICN/Media/materials/scripts/Examples.program	(revision 337)
+++ code/branches/FICN/Media/materials/scripts/Examples.program	(revision 337)
@@ -0,0 +1,158 @@
+//---------------------------------------------------
+// This file includes a number of basic GPU programs
+// for use in many materials. 
+//---------------------------------------------------
+
+
+// A really basic ambient pass program, support for one texture coodinate set
+vertex_program Ogre/BasicVertexPrograms/AmbientOneTexture cg
+{
+	source Example_Basic.cg
+	entry_point ambientOneTexture_vp
+	profiles vs_1_1 arbvp1
+
+	default_params
+	{
+		param_named_auto worldViewProj worldviewproj_matrix
+		param_named_auto ambient ambient_light_colour
+	}
+	
+}
+// A really basic ambient pass program, support for one texture coodinate set
+vertex_program Ogre/BasicVertexPrograms/AmbientOneTextureHLSL hlsl
+{
+	source Example_Basic.hlsl
+	entry_point ambientOneTexture_vp
+	target vs_1_1
+
+	default_params
+	{
+		param_named_auto worldViewProj worldviewproj_matrix
+		param_named_auto ambient ambient_light_colour
+	}
+}
+// A really basic ambient pass program, support for one texture coodinate set
+vertex_program Ogre/BasicVertexPrograms/AmbientOneTextureGLSL glsl
+{
+	source AmbientOneTexture.glsl
+
+	default_params
+	{
+		param_named_auto ambient ambient_light_colour
+	}
+}
+
+vertex_program Ogre/BasicVertexPrograms/AmbientOneTextureUnified unified
+{
+	delegate Ogre/BasicVertexPrograms/AmbientOneTextureGLSL
+	delegate Ogre/BasicVertexPrograms/AmbientOneTextureHLSL
+}
+
+
+// Same as below, but for use when rendering texture shadows
+vertex_program Ogre/HardwareSkinningOneWeightShadowCaster cg
+{
+	source Example_Basic.cg
+	entry_point hardwareSkinningOneWeightCaster_vp
+	profiles vs_1_1 arbvp1
+	includes_skeletal_animation true
+}
+// Basic hardware skinning using one indexed weight per vertex
+vertex_program Ogre/HardwareSkinningOneWeight cg
+{
+   source Example_Basic.cg
+   entry_point hardwareSkinningOneWeight_vp
+   profiles vs_1_1 arbvp1
+   includes_skeletal_animation true   
+}
+// Same as below, but for use when rendering texture shadows
+vertex_program Ogre/HardwareSkinningTwoWeightsShadowCasterCg cg
+{
+	source Example_Basic.cg
+	entry_point hardwareSkinningTwoWeightsCaster_vp
+	profiles vs_1_1 arbvp1
+	includes_skeletal_animation true
+}
+
+vertex_program Ogre/HardwareSkinningTwoWeightsShadowCasterGLSL glsl
+{
+	source skinningTwoWeightsShadowCasterVp.glsl
+	includes_skeletal_animation true
+}
+
+vertex_program Ogre/HardwareSkinningTwoWeightsShadowCaster unified
+{
+	delegate Ogre/HardwareSkinningTwoWeightsShadowCasterGLSL
+	delegate Ogre/HardwareSkinningTwoWeightsShadowCasterCg
+}
+
+// Basic hardware skinning using two indexed weights per vertex
+vertex_program Ogre/HardwareSkinningTwoWeightsCg cg
+{
+   source Example_Basic.cg
+   entry_point hardwareSkinningTwoWeights_vp
+   profiles vs_1_1 arbvp1
+   includes_skeletal_animation true
+}
+
+vertex_program Ogre/HardwareSkinningTwoWeightsGLSL glsl
+{
+   source skinningTwoWeightsVp.glsl
+   includes_skeletal_animation true
+}
+
+vertex_program Ogre/HardwareSkinningTwoWeights unified
+{
+	delegate Ogre/HardwareSkinningTwoWeightsGLSL
+	delegate Ogre/HardwareSkinningTwoWeightsCg
+	
+   default_params
+   {
+   		param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+		param_named_auto viewProjectionMatrix viewproj_matrix
+		param_named_auto lightPos[0] light_position 0
+		param_named_auto lightPos[1] light_position 1
+		param_named_auto lightDiffuseColour[0] light_diffuse_colour 0
+		param_named_auto lightDiffuseColour[1] light_diffuse_colour 1
+   }
+}
+
+// Basic hardware skinning using four indexed weights per vertex
+vertex_program Ogre/HardwareSkinningFourWeights cg
+{
+   source Example_Basic.cg
+   entry_point hardwareSkinningFourWeights_vp
+   profiles vs_1_1 arbvp1
+   includes_skeletal_animation true
+
+}
+// Basic hardware morph animation 
+vertex_program Ogre/HardwareMorphAnimation cg
+{
+	source Example_Basic.cg
+	entry_point hardwareMorphAnimation
+	profiles vs_1_1 arbvp1
+
+	includes_morph_animation true
+	default_params
+	{
+		param_named_auto worldViewProj worldviewproj_matrix
+		param_named_auto anim_t animation_parametric
+	}
+}
+// Basic hardware pose animation supporting 2 active poses
+vertex_program Ogre/HardwarePoseAnimation cg
+{
+	source Example_Basic.cg
+	entry_point hardwarePoseAnimation
+	profiles vs_1_1 arbvp1
+
+	includes_pose_animation 2
+	default_params
+	{
+		param_named_auto worldViewProj worldviewproj_matrix
+		param_named_auto anim_t animation_parametric
+	}
+}
+
+
Index: code/branches/FICN/Media/materials/scripts/Ogre.material
===================================================================
--- code/branches/FICN/Media/materials/scripts/Ogre.material	(revision 337)
+++ code/branches/FICN/Media/materials/scripts/Ogre.material	(revision 337)
@@ -0,0 +1,542 @@
+
+material Ogre/Earring
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.5 0.5 0
+			diffuse 1 1 0
+
+			texture_unit
+			{
+				texture spheremap.png
+				colour_op_ex add src_texture src_current
+				colour_op_multipass_fallback one one
+				env_map spherical
+			}
+		}
+	}
+}
+material Ogre/Skin
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.7 0.7 0.7
+			cull_hardware none
+
+			texture_unit
+			{
+				texture GreenSkin.jpg
+				tex_address_mode mirror
+			}
+		}
+	}
+}
+material Ogre/Tusks
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.5 0.5 0.4
+			diffuse 1 1 0.8
+
+			texture_unit
+			{
+				texture dirt01.jpg
+				colour_op_ex add src_texture src_current
+				colour_op_multipass_fallback one one
+			}
+		}
+	}
+}
+material Ogre/Eyes
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture WeirdEye.png
+			}
+		}
+	}
+}
+material Cursor/default
+{
+	technique
+	{
+		pass
+		{
+			scene_blend alpha_blend
+
+			texture_unit
+			{
+				texture cursor.png
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+material Core/StatsBlockBorder/Down
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture ogreborder.png
+			}
+		}
+	}
+}
+material Core/StatsBlockBorder/Up
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture ogreborderUp.png
+			}
+		}
+	}
+}
+
+
+
+material Orxonox/SuperEgg
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture superegg.png
+			}
+		}
+	}
+}
+
+material Orxonox/Shot
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture shot.png
+			}
+		}
+	}
+}
+
+
+material Orxonox/Red
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_check off
+			scene_blend 0.5 0.5
+			ambient 0 0 0 0.5
+
+			texture_unit
+			{
+				texture OrxonoxRED.png
+			}
+		}
+	}
+}
+
+
+material Orxonox/Black
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_check off
+			scene_blend 0.5 0.5
+			ambient 0 0 0 0.5
+
+			texture_unit
+			{
+				texture OrxonoxBlack.png
+			}
+		}
+	}
+}
+
+
+material Orxonox/BackGround
+{
+	technique
+	{
+		pass
+		{
+
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+			texture_unit
+			{
+				texture backGround.png
+			}
+		}
+	}
+}
+
+material Orxonox/EnergyBackground
+{
+	technique
+	{
+		pass
+		{
+
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+			texture_unit
+			{
+				texture EnergyBackground.png
+			}
+		}
+	}
+}
+
+material Orxonox/Clock
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture clock.png
+			}
+		}
+	}
+}
+
+material Orxonox/Gun
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture gun.png
+			}
+		}
+	}
+}
+
+material Orxonox/Man
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture man.png
+			}
+		}
+	}
+}
+
+material Orxonox/MapBackGround
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture MapBackGround.png
+			}
+		}
+	}
+}
+
+material Orxonox/MyShip
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture MyShip.png
+			}
+		}
+	}
+}
+
+material Orxonox/RacketBackground
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture RacketBackground.png
+			}
+		}
+	}
+}
+
+
+material Orxonox/TargetBackground
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture TargetBackground.png
+			}
+		}
+	}
+}
+
+material Orxonox/PrimarBackground
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture PrimarBackground.png
+			}
+		}
+	}
+}
+
+material Orxonox/PrimarSample
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture PrimarSample.png
+			}
+		}
+	}
+}
+
+material Orxonox/PrimarChoice
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture PrimarChoice.png
+			}
+		}
+	}
+}
+
+material Orxonox/RedPoint
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture RedPoint.png
+			}
+		}
+	}
+}
+
+material Orxonox/EnergyDistrBackground
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture EnergyDistrBackground.png
+			}
+		}
+	}
+}
+
+material Orxonox/ShildLeftTop
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture ShildLeftTop.png
+			}
+		}
+	}
+}
+
+material Orxonox/ShildRightTop
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture ShildRightTop.png
+			}
+		}
+	}
+}
+
+material Orxonox/ShildLeftBottom
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture ShildLeftBottom.png
+			}
+		}
+	}
+}
+
+material Orxonox/ShildRightBottom
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture ShildRightBottom.png
+			}
+		}
+	}
+}
+
+material Orxonox/TimeBackground
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture TimeBackground.png
+			}
+		}
+	}
+}
+
Index: code/branches/FICN/Media/overlay/OrxonoxHUD.overlay
===================================================================
--- code/branches/FICN/Media/overlay/OrxonoxHUD.overlay	(revision 337)
+++ code/branches/FICN/Media/overlay/OrxonoxHUD.overlay	(revision 337)
@@ -0,0 +1,142 @@
+Orxonox/HUD
+{
+	zorder 500
+	// Stats block
+	container BorderPanel(Orxonox/Panel)
+	{
+		metrics_mode pixels
+		vert_align top
+		left 5 
+		top 5
+		width 250
+		height 90
+		material Orxonox/Red
+        	border_size 1 1 1 1
+        	border_material Core/StatsBlockBorder
+        	border_topleft_uv     0.0000 1.0000 0.0039 0.9961
+	    	border_top_uv         0.0039 1.0000 0.9961 0.9961
+	    	border_topright_uv    0.9961 1.0000 1.0000 0.9961
+	    	border_left_uv        0.0000 0.9961 0.0039 0.0039
+	    	border_right_uv       0.9961 0.9961 1.0000 0.0039
+	    	border_bottomleft_uv  0.0000 0.0039 0.0039 0.0000
+        	border_bottom_uv      0.0039 0.0039 0.9961 0.0000
+	    	border_bottomright_uv 0.9961 0.0039 1.0000 0.0000
+
+		    
+
+
+		container BorderPanel(Orxonox/HUD1/SuperEggPanel)
+		{	
+    		    	border_size 1 1 1 1
+        		border_material Core/StatsBlockBorder
+        		border_topleft_uv     0.0000 1.0000 0.0039 0.9961
+	    		border_top_uv         0.0039 1.0000 0.9961 0.9961
+	    		border_topright_uv    0.9961 1.0000 1.0000 0.9961
+	    		border_left_uv        0.0000 0.9961 0.0039 0.0039
+	    		border_right_uv       0.9961 0.9961 1.0000 0.0039
+	    		border_bottomleft_uv  0.0000 0.0039 0.0039 0.0000
+        		border_bottom_uv      0.0039 0.0039 0.9961 0.0000
+	    		border_bottomright_uv 0.9961 0.0039 1.0000 0.0000
+			metrics_mode pixels
+			horz_align left
+			vert_align top
+			top 10
+			left 10
+			width 70
+			height 70
+			material Orxonox/SuperEgg
+		}
+
+		element TextArea(Orxonox/HUD1/HP)
+		{
+			metrics_mode pixels
+			left 100
+			top 15
+			width 50
+			height 25
+			font_name BlueHighway
+			char_height 25
+			caption HP:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+
+
+		container BorderPanel(Orxonox/HUD1/HPBar)
+		{	
+    		    	border_size 1 1 1 1
+        		border_material Core/StatsBlockBorder
+        		border_topleft_uv     0.0000 1.0000 0.0039 0.9961
+	    		border_top_uv         0.0039 1.0000 0.9961 0.9961
+	    		border_topright_uv    0.9961 1.0000 1.0000 0.9961
+	    		border_left_uv        0.0000 0.9961 0.0039 0.0039
+	    		border_right_uv       0.9961 0.9961 1.0000 0.0039
+	    		border_bottomleft_uv  0.0000 0.0039 0.0039 0.0000
+        		border_bottom_uv      0.0039 0.0039 0.9961 0.0000
+	    		border_bottomright_uv 0.9961 0.0039 1.0000 0.0000
+			metrics_mode pixels
+			horz_align left
+			vert_align top
+			top 25
+			left 140
+			width 100
+			height 15
+			material Orxonox/Red
+		}
+
+		element TextArea(Orxonox/HUD1/HPText)
+		{
+			metrics_mode pixels
+			horz_align left
+			left 140
+			top 10
+			width 100
+			height 15
+			font_name BlueHighway
+			char_height 15
+			caption 1000/1000
+			colour 1 1 1 
+		}
+
+		container Panel(Orxonox/HUD1/Shot1)
+		{	
+			metrics_mode pixels
+			horz_align left
+			vert_align top
+			top 55
+			left 110
+			width 30
+			height 25
+			material Orxonox/Shot
+		}
+
+		container Panel(Orxonox/HUD1/Shot2)
+		{	
+			metrics_mode pixels
+			horz_align left
+			vert_align top
+			top 55
+			left 160
+			width 30
+			height 25
+			material Orxonox/Shot
+		}
+		
+		container Panel(Orxonox/HUD1/Shot3)
+		{	
+			metrics_mode pixels
+			horz_align left
+			vert_align top
+			top 55
+			left 210
+			width 30
+			height 25
+			material Orxonox/Shot
+		}
+
+
+		
+
+	}
+}
Index: code/branches/FICN/Media/overlay/OrxonoxHUD1.1.overlay
===================================================================
--- code/branches/FICN/Media/overlay/OrxonoxHUD1.1.overlay	(revision 337)
+++ code/branches/FICN/Media/overlay/OrxonoxHUD1.1.overlay	(revision 337)
@@ -0,0 +1,153 @@
+Orxonox/HUD1.1
+{
+	zorder 500
+	// Stats block
+	container BorderPanel(Orxonox/HUD1.1/Time)
+	{
+		metrics_mode pixels
+		vert_align top
+		horz_align center
+		left -140
+		top 10
+		width 280
+		height 60
+		material Orxonox/BackGround
+        	border_size 1 1 1 1
+        	border_material Orxonox/Black
+        	border_topleft_uv     0.0000 1.0000 0.0039 0.9961
+	    	border_top_uv         0.0039 1.0000 0.9961 0.9961
+	    	border_topright_uv    0.9961 1.0000 1.0000 0.9961
+	    	border_left_uv        0.0000 0.9961 0.0039 0.0039
+	    	border_right_uv       0.9961 0.9961 1.0000 0.0039
+	    	border_bottomleft_uv  0.0000 0.0039 0.0039 0.0000
+        	border_bottom_uv      0.0039 0.0039 0.9961 0.0000
+	    	border_bottomright_uv 0.9961 0.0039 1.0000 0.0000
+	
+		element Panel(Orxonox/HUD1.1/TimeImg)
+		{
+			metrics_mode pixels
+			left 0
+			top 0
+			width 60
+			height 60
+			material Orxonox/Clock
+		}
+
+		element Panel(Orxonox/HUD1.1/TimeLine)
+		{
+			metrics_mode pixels
+			left 60
+			top 0
+			width 2
+			height 60
+			material Orxonox/Black
+		}		
+		
+
+	}
+
+	container BorderPanel(Orxonox/HUD1.1/Ammo)
+	{
+		metrics_mode pixels
+		vert_align bottom
+		horz_align left
+		left 10
+		top -70
+		width 180
+		height 60
+		material Orxonox/BackGround
+        	border_size 1 1 1 1
+        	border_material Orxonox/Black
+        	border_topleft_uv     0.0000 1.0000 0.0039 0.9961
+	    	border_top_uv         0.0039 1.0000 0.9961 0.9961
+	    	border_topright_uv    0.9961 1.0000 1.0000 0.9961
+	    	border_left_uv        0.0000 0.9961 0.0039 0.0039
+	    	border_right_uv       0.9961 0.9961 1.0000 0.0039
+	    	border_bottomleft_uv  0.0000 0.0039 0.0039 0.0000
+        	border_bottom_uv      0.0039 0.0039 0.9961 0.0000
+	    	border_bottomright_uv 0.9961 0.0039 1.0000 0.0000
+	
+		element Panel(Orxonox/HUD1.1/AmmoImg)
+		{
+			metrics_mode pixels
+			left 0
+			top 0
+			width 60
+			height 60
+			material Orxonox/Gun
+		}
+
+		element Panel(Orxonox/HUD1.1/AmmoLine)
+		{
+			metrics_mode pixels
+			left 60
+			top 0
+			width 2
+			height 60
+			material Orxonox/Black
+		}		
+		
+
+	}
+
+	container BorderPanel(Orxonox/HUD1.1/Life)
+	{
+		metrics_mode pixels
+		vert_align bottom
+		horz_align center
+		left -90
+		top -70
+		width 180
+		height 60
+		material Orxonox/BackGround
+        	border_size 1 1 1 1
+        	border_material Orxonox/Black
+        	border_topleft_uv     0.0000 1.0000 0.0039 0.9961
+	    	border_top_uv         0.0039 1.0000 0.9961 0.9961
+	    	border_topright_uv    0.9961 1.0000 1.0000 0.9961
+	    	border_left_uv        0.0000 0.9961 0.0039 0.0039
+	    	border_right_uv       0.9961 0.9961 1.0000 0.0039
+	    	border_bottomleft_uv  0.0000 0.0039 0.0039 0.0000
+        	border_bottom_uv      0.0039 0.0039 0.9961 0.0000
+	    	border_bottomright_uv 0.9961 0.0039 1.0000 0.0000
+	
+		element Panel(Orxonox/HUD1.1/LifeImg)
+		{
+			metrics_mode pixels
+			left 0
+			top 0
+			width 60
+			height 60
+			material Orxonox/Man
+		}
+
+		element Panel(Orxonox/HUD1.1/LifeLine)
+		{
+			metrics_mode pixels
+			left 60
+			top 0
+			width 2
+			height 60
+			material Orxonox/Black
+		}	
+		
+
+	}
+
+
+
+	container BorderPanel(Orxonox/HUD1.1/MapBackGround)
+	{
+		metrics_mode pixels
+		vert_align bottom
+		horz_align right
+		left -210
+		top -210
+		width 200
+		height 200
+		material Orxonox/MapBackGround
+		
+		
+
+	}
+}
Index: code/branches/FICN/Media/overlay/OrxonoxHUD1.2.overlay
===================================================================
--- code/branches/FICN/Media/overlay/OrxonoxHUD1.2.overlay	(revision 337)
+++ code/branches/FICN/Media/overlay/OrxonoxHUD1.2.overlay	(revision 337)
@@ -0,0 +1,456 @@
+Orxonox/HUD1.2
+{
+	zorder 500
+	// Stats block
+
+
+	
+
+
+
+	container Panel(Orxonox/HUD1.2/MapBackGround)
+	{
+		metrics_mode pixels
+		vert_align bottom
+		horz_align center
+		left -75
+		top -160
+		width 150
+		height 150
+		material Orxonox/MapBackGround
+	}
+
+	container Panel(Orxonox/HUD1.2/MyShip)
+	{
+		metrics_mode pixels
+		vert_align bottom
+		horz_align center
+		left 100
+		top -140
+		width 100
+		height 100
+		material Orxonox/MyShip
+		
+		container Panel(Orxonox/HUD1.2/ShildLeftTop)
+		{
+			metrics_mode pixels
+			left -5
+			top 0
+			width 30
+			height 30
+			material Orxonox/ShildLeftTop
+		}
+
+		container Panel(Orxonox/HUD1.2/ShildRightTop)
+		{
+			metrics_mode pixels
+			horz_align right
+			left -30
+			top 0
+			width 30
+			height 30
+			material Orxonox/ShildRightTop
+		}
+
+		container Panel(Orxonox/HUD1.2/ShildLeftBottom)
+		{
+			metrics_mode pixels
+			vert_align bottom
+			left -5
+			top -30
+			width 30
+			height 30
+			material Orxonox/ShildLeftBottom
+		}
+
+		container Panel(Orxonox/HUD1.2/ShildRightBottom)
+		{
+			metrics_mode pixels
+			vert_align bottom
+			horz_align right
+			left -30
+			top -30
+			width 30
+			height 30
+			material Orxonox/ShildRightBottom
+		}
+		
+	}
+
+
+	container Panel(Orxonox/HUD1.2/PrimarBackground)
+	{
+		metrics_mode pixels
+		vert_align bottom
+		horz_align right
+		left -180
+		top -180
+		width 150
+		height 50
+		material Orxonox/PrimarBackground
+
+		container Panel(Orxonox/HUD1.2/PrimarSample1)
+		{
+			metrics_mode pixels
+			left 0
+			top 0
+			width 50
+			height 50
+			material Orxonox/PrimarSample
+		}
+
+		container Panel(Orxonox/HUD1.2/PrimarSample2)
+		{
+			metrics_mode pixels
+			left 50
+			top 0
+			width 50
+			height 50
+			material Orxonox/PrimarSample
+		}
+
+		container Panel(Orxonox/HUD1.2/PrimarSample3)
+		{
+			metrics_mode pixels
+			left 100
+			top 0
+			width 50
+			height 50
+			material Orxonox/PrimarSample
+		}
+
+		container Panel(Orxonox/HUD1.2/PrimarChoice)
+		{
+			metrics_mode pixels
+			left 2
+			top 2
+			width 48
+			height 46
+			material Orxonox/PrimarChoice
+		}
+
+
+
+
+	}
+	
+	container Panel(Orxonox/HUD1.2/RacketBackground)
+	{
+		metrics_mode pixels
+		vert_align bottom
+		horz_align right
+		left -180
+		top -130
+		width 150
+		height 100
+		material Orxonox/RacketBackground
+
+		element TextArea(Orxonox/HUD1.2/Rocket1)
+		{
+			metrics_mode pixels
+			left 10
+			top 7
+			width 150
+			height 20
+			font_name BlueHighway
+			char_height 25
+			caption Rocket1
+			colour_top 0 1 0 
+		}	
+
+		element TextArea(Orxonox/HUD1.2/Rocket2)
+		{
+			metrics_mode pixels
+			left 10
+			top 29
+			width 150
+			height 20
+			font_name BlueHighway
+			char_height 25
+			caption Rocket2
+			colour_top 0 1 0 
+		}	
+
+		element TextArea(Orxonox/HUD1.2/Rocket3)
+		{
+			metrics_mode pixels
+			left 10
+			top 51
+			width 150
+			height 20
+			font_name BlueHighway
+			char_height 25
+			caption Rocket3
+			colour_top 0 1 0 
+		}
+	
+		element TextArea(Orxonox/HUD1.2/Rocket4)
+		{
+			metrics_mode pixels
+			left 10
+			top 74
+			width 150
+			height 20
+			font_name BlueHighway
+			char_height 25
+			caption Rocket4
+			colour_top 0 1 0 
+		}
+
+
+		element TextArea(Orxonox/HUD1.2/RocketNum1)
+		{
+			metrics_mode pixels
+			horz_align right
+			left -30
+			top 7
+			width 150
+			height 20
+			font_name BlueHighway
+			char_height 25
+			caption 20
+			colour_top 0 1 0 
+		}	
+
+		element TextArea(Orxonox/HUD1.2/RocketNum2)
+		{
+			metrics_mode pixels
+			horz_align right
+			left -30
+			top 29
+			width 150
+			height 20
+			font_name BlueHighway
+			char_height 25
+			caption 99
+			colour_top 0 1 0 
+		}	
+
+		element TextArea(Orxonox/HUD1.2/RocketNum3)
+		{
+			metrics_mode pixels
+			horz_align right
+			left -30
+			top 51
+			width 150
+			height 20
+			font_name BlueHighway
+			char_height 25
+			caption 01
+			colour_top 0 1 0 
+		}
+	
+		element TextArea(Orxonox/HUD1.2/RocketNum4)
+		{
+			metrics_mode pixels
+			horz_align right
+			left -30
+			top 74
+			width 150
+			height 20
+			font_name BlueHighway
+			char_height 25
+			caption 55
+			colour_top 0 1 0 
+		}	
+	
+		
+	
+
+
+	}
+
+
+	container Panel(Orxonox/HUD1.2/Energy)
+	{
+		metrics_mode pixels
+		vert_align top
+		horz_align center
+		left -100
+		top 20
+		width 200
+		height 20
+
+		container Panel(Orxonox/HUD1.2/EnergyBackground)
+		{
+			metrics_mode pixels
+			width 200
+			height 20
+			material Orxonox/EnergyBackground
+		}
+		
+		element TextArea(Orxonox/HUD1.2/EnergyText)
+		{
+			metrics_mode pixels
+			horz_align center
+			left -20
+			top 2
+			width 200
+			height 20
+			font_name BlueHighway
+			char_height 20
+			caption Energy
+			colour_top 1 1 0 
+		}
+	}
+
+	container Panel(Orxonox/HUD1.2/TargetWindow)
+	{
+		metrics_mode pixels
+		vert_align bottom
+		horz_align left
+		left 40
+		top -130
+		width 150
+		height 100
+		material Orxonox/TargetBackground
+
+		element TextArea(Orxonox/HUD1.2/TargetWindow/Name)
+		{
+			metrics_mode pixels
+			left 20
+			top 5
+			width 200
+			height 20
+			font_name BlueHighway
+			char_height 25
+			caption Moesonator
+			colour_top 0 1 0 
+		}
+
+		element TextArea(Orxonox/HUD1.2/TargetWindow/Distance)
+		{
+			metrics_mode pixels
+			left 9
+			top 35
+			width 150
+			height 20
+			font_name BlueHighway
+			char_height 20
+			caption Distance
+			colour_top 0 1 0 
+		}
+
+		element TextArea(Orxonox/HUD1.2/TargetWindow/Status)
+		{
+			metrics_mode pixels
+			left 7
+			top 55
+			width 150
+			height 20
+			font_name BlueHighway
+			char_height 20
+			caption Status
+			colour_top 0 1 0 
+		}
+
+		element TextArea(Orxonox/HUD1.2/TargetWindow/HitRating)
+		{
+			metrics_mode pixels
+			left 7
+			top 75
+			width 150
+			height 20
+			font_name BlueHighway
+			char_height 20
+			caption Hit Rating
+			colour_top 0 1 0 
+		}
+
+		element TextArea(Orxonox/HUD1.2/TargetWindow/DistanceText)
+		{
+			metrics_mode pixels
+			horz_align right
+			left -50
+			top 35
+			width 150
+			height 20
+			font_name BlueHighway
+			char_height 20
+			caption 50km
+			colour_top 0 1 0 
+		}
+
+		element TextArea(Orxonox/HUD1.2/TargetWindow/StatusText)
+		{
+			metrics_mode pixels
+			horz_align right
+			left -50
+			top 55
+			width 150
+			height 20
+			font_name BlueHighway
+			char_height 20
+			caption huhu
+			colour_top 0 1 0 
+		}
+
+		element TextArea(Orxonox/HUD1.2/TargetWindow/HitRatingText)
+		{
+			metrics_mode pixels
+			horz_align right
+			left -50
+			top 75
+			width 150
+			height 20
+			font_name BlueHighway
+			char_height 20
+			caption 50%
+			colour_top 0 1 0 
+		}
+
+
+
+	}
+
+
+
+
+	container Panel(Orxonox/HUD1.2/EnergyDistrWindow)
+	{
+		metrics_mode pixels
+		vert_align bottom
+		horz_align right
+		left -150
+		top -300
+		width 100
+		height 86
+		material Orxonox/EnergyDistrBackground
+
+		container Panel(Orxonox/HUD1.2/EnergyDistrPoint)
+		{
+			metrics_mode pixels
+			left 40
+			top 36
+			width 7
+			height 7
+			material Orxonox/RedPoint
+		}
+	}
+
+	container Panel(Orxonox/HUD1.2/Time)
+	{
+		metrics_mode pixels
+		vert_align top
+		horz_align left
+		left 30
+		top 10
+		width 60
+		height 30
+
+		
+		element TextArea(Orxonox/HUD1.2/Time/Text)
+		{
+			metrics_mode pixels
+			horz_align left
+			left 10
+			top 5
+			width 100
+			height 20
+			font_name BlueHighway
+			char_height 25
+			caption 99:99
+			colour_top 0 1 0 
+		}
+
+}
Index: code/branches/FICN/Media/particle/Example-Water.particle
===================================================================
--- code/branches/FICN/Media/particle/Example-Water.particle	(revision 337)
+++ code/branches/FICN/Media/particle/Example-Water.particle	(revision 337)
@@ -0,0 +1,35 @@
+Examples/Water/Rain
+{
+    material        Examples/Droplet
+    particle_width  100
+    particle_height 300
+    cull_each       true
+    quota           100
+    // Make common direction straight down (faster than self oriented)
+    billboard_type  oriented_common
+    common_direction 0 -1 0
+    
+    // Area emitter
+    emitter Box
+    {
+        angle           0
+        emission_rate   20
+        time_to_live    5
+        direction       0 -1 0
+        velocity    	1000
+        colour_range_start  0.3 1 0.3
+        colour_range_end    0.7 1 0.7
+        width           3000
+        height          3000
+        depth           0
+    }
+
+    // Gravity
+    affector LinearForce
+    {
+        force_vector      0 -1000 0
+        force_application add
+    }
+
+}
+
Index: code/branches/FICN/Media/particle/Example.particle
===================================================================
--- code/branches/FICN/Media/particle/Example.particle	(revision 337)
+++ code/branches/FICN/Media/particle/Example.particle	(revision 337)
@@ -0,0 +1,395 @@
+// Example particle systems
+
+// Exudes greeny particles which float upwards
+Examples/GreenyNimbus
+{
+    material        Examples/FlarePointSprite
+	point_rendering	true
+	// point rendering means size is controlled by material
+	// provide fallback sizes for hardware that doesn't support point sprite
+    particle_width  30
+    particle_height 30
+    cull_each       false
+	cull_each       false
+    quota           10000
+    billboard_type  point
+    
+    // Area emitter
+    emitter Box
+    {
+        angle           30
+        emission_rate   30
+        time_to_live    5
+        direction       0 1 0
+        velocity    	0
+        colour_range_start  1 1 0
+        colour_range_end    0.3 1 0.3
+        width           60
+        height          60
+        depth           60
+    }
+
+    // Make em float upwards
+    affector LinearForce
+    {
+        force_vector      0 100 0
+        force_application add
+    }
+
+    // Fader
+    affector ColourFader
+    {
+        red -0.25
+        green -0.25
+        blue -0.25
+    }
+
+
+}
+
+// A sparkly purple fountain
+Examples/PurpleFountain
+{
+    material        Examples/Flare2
+    particle_width  20
+    particle_height 40
+    cull_each       false
+    quota           10000
+    billboard_type  oriented_self
+    
+    // Area emitter
+    emitter Point
+    {
+        angle           15
+        emission_rate   75
+        time_to_live    3
+        direction       0 1 0
+        velocity_min    250
+        velocity_max    300
+        colour_range_start  0 0 0
+        colour_range_end    1 1 1
+    }
+
+    // Gravity
+    affector LinearForce
+    {
+        force_vector      0 -100 0
+        force_application add
+    }
+
+    // Fader
+    affector ColourFader
+    {
+        red -0.25
+        green -0.25
+        blue -0.25
+    }
+}
+
+
+// A downpour
+Examples/Rain
+{
+    material        Examples/Droplet
+    particle_width  20
+    particle_height 100
+    cull_each       true
+    quota           10000
+    // Make common direction straight down (faster than self oriented)
+    billboard_type  oriented_common
+    common_direction 0 -1 0
+    
+    // Area emitter
+    emitter Box
+    {
+        angle           0
+        emission_rate   100
+        time_to_live    5
+        direction       0 -1 0
+        velocity    	50
+        colour_range_start  0.3 1 0.3
+        colour_range_end    0.7 1 0.7
+        width           1000
+        height          1000
+        depth           0
+    }
+
+    // Gravity
+    affector LinearForce
+    {
+        force_vector      0 -200 0
+        force_application add
+    }
+
+}
+
+// A jet engine (of sorts)
+Examples/JetEngine1
+{
+	material 		Examples/Flare
+	particle_width 	25
+	particle_height	25
+	cull_each		false
+	quota			200
+	billboard_type	point
+
+	emitter Point
+	{
+		angle 5
+		emission_rate 100
+        time_to_live    1
+        direction       0 -1 0
+        velocity_min    250
+        velocity_max    300
+        colour_range_start  1 1 0.5
+        colour_range_end    1 0.8 0.3
+		
+	}
+	affector ColourFader
+	{
+		red -0.25
+		green -1
+		blue -1
+	}
+	
+}
+Examples/JetEngine2
+{
+	material 		Examples/Flare
+	particle_width 	15
+	particle_height	15
+	cull_each		false
+	quota			200
+	billboard_type	point
+
+	emitter Point
+	{
+		angle 3
+		emission_rate 100
+        time_to_live    1
+        direction       0 -1 0
+        velocity_min    350
+        velocity_max    400
+        colour_range_start  0.5 1 1
+        colour_range_end    0.3 0.8 1
+		
+	}
+	affector ColourFader
+	{
+		red -1
+		green -1
+		blue -0.5
+	}
+	
+}
+
+// Exudes aureola particles which around the model float upwards
+Examples/Aureola
+{
+    material        Examples/Aureola
+    particle_width  200
+    particle_height 200
+    cull_each       false
+    quota           100
+    billboard_type  perpendicular_common
+    common_direction 0 1 0
+    common_up_vector 0 0 1
+
+    // Area emitter
+    emitter Box
+    {
+        angle           30
+        emission_rate   4
+        time_to_live    5
+        position        0 -100 0
+        direction       0 1 0
+        velocity_min  	0
+        velocity_max  	30
+        colour_range_start  0.3 0.3 0.3 0.0
+        colour_range_end    0.8 0.8 0.8 0.0
+        width           10
+        height          10
+        depth           30
+    }
+
+    // Make em float upwards
+    affector LinearForce
+    {
+        force_vector      0 70 0
+        force_application add
+    }
+
+    // Fader
+    affector ColourFader2
+    {
+        red1 +0.4
+        green1 +0.4
+        blue1 +0.4
+        alpha1 +0.7
+
+        red2 -0.25
+        green2 -0.25
+        blue2 -0.25
+        alpha2 -0.3333
+
+        state_change 3.5
+    }
+
+    // Rotater
+    affector Rotator
+    {
+        rotation_range_start 0
+        rotation_range_end 360
+        rotation_speed_range_start 0
+        rotation_speed_range_end 180
+    }
+}
+
+
+Examples/Swarm
+{
+	quota	3000
+	material	Examples/Flare2
+	particle_width	12
+	particle_height	24
+	cull_each	true
+	renderer	billboard
+	sorted	true
+	local_space	false
+	billboard_type	oriented_self
+
+	emitter Box
+	{
+		angle	180
+		colour	1 1 1 1
+		colour_range_start	1 1 1 1
+		colour_range_end	1 1 1 1
+		direction	0 1 0
+		emission_rate	30
+		position	0 0 0
+		velocity	50
+		velocity_min	50
+		velocity_max	1
+		time_to_live	20
+		time_to_live_min	20
+		time_to_live_max	20
+		duration	0
+		duration_min	0
+		duration_max	0
+		repeat_delay	0
+		repeat_delay_min	0
+		repeat_delay_max	0
+		width	80
+		height	80
+		depth	80
+	}
+
+	affector ColourFader
+	{
+		red	-0.05
+		green	0
+		blue	0
+		alpha	0
+	}
+
+	affector DeflectorPlane
+	{
+		plane_point	0 -50 0
+		plane_normal	0 1 0
+		bounce	1
+	}
+
+	affector DeflectorPlane
+	{
+		plane_point	0 50 0
+		plane_normal	0 -1 0
+		bounce	1
+	}
+
+	affector DeflectorPlane
+	{
+		plane_point	50 0 0
+		plane_normal	-1 0 0
+		bounce	1
+	}
+
+	affector DeflectorPlane
+	{
+		plane_point	-50 0 0
+		plane_normal	1 0 0
+		bounce	1
+	}
+
+	affector DeflectorPlane
+	{
+		plane_point	0 0 50
+		plane_normal	0 0 -1
+		bounce	1
+	}
+
+	affector DeflectorPlane
+	{
+		plane_point	0 0 -50
+		plane_normal	0 0 1
+		bounce	1
+	}
+
+	affector DirectionRandomiser
+	{
+		randomness	60
+	}
+}
+
+
+Examples/Snow
+{
+	quota	2000
+	material	Examples/Flare
+	particle_width	4
+	particle_height	4
+	cull_each	true
+	renderer	billboard
+	sorted	true
+	local_space	false
+	billboard_type	point
+
+	emitter Box
+	{
+		angle	0
+		colour	1 1 1 1
+		colour_range_start	1 1 1 1
+		colour_range_end	1 1 1 1
+		direction	0 -1 0
+		emission_rate	100
+		position	0 200 0
+		velocity	20
+		velocity_min	20
+		velocity_max	20
+		time_to_live	20
+		time_to_live_min	20
+		time_to_live_max	20
+		duration	0
+		duration_min	0
+		duration_max	0
+		repeat_delay	0
+		repeat_delay_min	0
+		repeat_delay_max	0
+		width	200
+		height	200
+		depth	1
+	}
+
+	affector DeflectorPlane
+	{
+		plane_point	0 0 0
+		plane_normal	0 1 0
+		bounce	0
+	}
+
+	affector DirectionRandomiser
+	{
+		randomness	10
+	}
+}
+
+
Index: code/branches/FICN/Media/particle/emitted_emitter.particle
===================================================================
--- code/branches/FICN/Media/particle/emitted_emitter.particle	(revision 337)
+++ code/branches/FICN/Media/particle/emitted_emitter.particle	(revision 337)
@@ -0,0 +1,112 @@
+// Example emitted emitters
+
+Examples/Fireworks
+
+{
+
+    material Examples/Flare
+
+    point_rendering            false
+
+    particle_width             10
+
+    particle_height            10
+
+    cull_each                  false
+
+    quota                      1000
+
+    emit_emitter_quota         10
+
+    billboard_type             point
+
+    
+
+    // Emitter that emits multiple Point emitters with name 'explosion'
+
+    emitter Box
+
+    {
+
+        name                    mainEmitter
+
+        emit_emitter            explosion
+
+        angle                   30
+
+        emission_rate           1000
+
+        time_to_live            3
+
+        direction               0 1 0
+
+        velocity                200
+
+    }
+
+
+
+    // This Point emitter is emitted by the Box emitter and emits billboard particles itself
+
+    emitter Point
+
+    {
+
+        name                    explosion
+
+        angle                   360
+
+        emission_rate           1000
+
+        time_to_live            2
+
+        direction               0 1 0
+
+        velocity                80
+
+        duration                0.1
+
+        repeat_delay_min        2
+
+        repeat_delay_max        3
+
+    }
+
+
+
+    // Make em float downwards
+
+    affector LinearForce
+
+    {
+
+        force_vector            0 -100 0
+
+        force_application       add
+
+    }
+
+
+
+    // Give em some nice colours
+
+    affector ColourInterpolator
+
+    {
+
+        time0                   0
+
+        colour0                 1 1 0
+
+        time1                   0.5
+
+        colour1                 1 0 0
+
+        time2                   0.9
+
+        colour2                 0 0 1
+
+    }
+
+}
+
Index: code/branches/FICN/Media/particle/smoke.particle
===================================================================
--- code/branches/FICN/Media/particle/smoke.particle	(revision 337)
+++ code/branches/FICN/Media/particle/smoke.particle	(revision 337)
@@ -0,0 +1,43 @@
+// Example particle systems
+
+// smoke
+Examples/Smoke
+{
+    	material        	Examples/Smoke
+    	particle_width  	55
+    	particle_height 	55
+    	cull_each       	true
+    	quota           	500
+    	billboard_type  	point
+		sorted				true
+    
+    	// Area emitter
+    	emitter Point
+    	{
+		angle               		11
+        	emission_rate       		15
+        	time_to_live        		4
+        	direction           		0 1 0
+        	velocity_min        		150
+        	velocity_max        		240    	
+	}
+
+	affector ColourImage
+	{
+		image		smokecolors.png
+	}
+
+   	affector Rotator
+   	{
+        	rotation_range_start  		0
+        	rotation_range_end   	 	360
+        	rotation_speed_range_start  	-60
+        	rotation_speed_range_end    	200
+   	}
+
+   	affector Scaler
+   	{
+       	rate 	100
+   	}
+
+}
Index: code/branches/FICN/bin/CMakeCache.txt
===================================================================
--- code/branches/FICN/bin/CMakeCache.txt	(revision 337)
+++ code/branches/FICN/bin/CMakeCache.txt	(revision 337)
@@ -0,0 +1,375 @@
+# This is the CMakeCache file.
+# For build in directory: d:/orxonox/project_make/bin
+# It was generated by CMake: D:/orxonox/cmake-2.4.7-win32-x86/bin/cmake.exe
+# You can edit this file to change values found and used by cmake.
+# If you do not want to change any of the values, simply exit the editor.
+# If you do want to change a value, simply edit, save, and exit the editor.
+# The syntax for the file is as follows:
+# KEY:TYPE=VALUE
+# KEY is the name of a variable in the cache.
+# TYPE is a hint to GUI's for the type of VALUE, DO NOT EDIT TYPE!.
+# VALUE is the current value for the KEY.
+
+########################
+# EXTERNAL cache entries
+########################
+
+//Library is used for debug links only
+CEGUIBase_LINK_TYPE:STATIC=optimized
+
+//Library is used for debug links only
+CEGUIBase_d_LINK_TYPE:STATIC=debug
+
+//Missing description
+CEGUI_INCLUDE_DIR:PATH=../ogre/Dependencies/include/CEGUI
+
+//Missing description
+CEGUI_LIBRARIES:STRING=debug;CEGUIBase_d;optimized;CEGUIBase
+
+//Missing description
+CEGUI_LIB_DIR:PATH=D:/orxonox/project_make/../ogre/Samples/Common/bin/Release/lib
+
+//Missing description
+CEGUI_OGRE_INCLUDE_DIR:PATH=../ogre/Samples/Common/CEGUIRenderer/include
+
+//Missing description
+CEGUI_OGRE_LIBRARIES:STRING=debug;OgreGUIRenderer_d;optimized;OgreGUIRenderer
+
+//Missing description
+CEGUI_OGRE_LIB_DIR:PATH=D:/orxonox/project_make/../ogre/Samples/Common/bin/Release/lib
+
+//Path to a program.
+CMAKE_AR:FILEPATH=CMAKE_AR-NOTFOUND
+
+//For backwards compatibility, what version of CMake commands and
+// syntax should this version of CMake allow.
+CMAKE_BACKWARDS_COMPATIBILITY:STRING=2.4
+
+//Semicolon separated list of supported configuration types, only
+// supports Debug, Release, MinSizeRel, and RelWithDebInfo, anything
+// else will be ignored.
+CMAKE_CONFIGURATION_TYPES:STRING=Debug;Release;MinSizeRel;RelWithDebInfo
+
+//C++ compiler
+CMAKE_CXX_COMPILER:FILEPATH=cl
+
+//Flags used by the compiler during all build types.
+CMAKE_CXX_FLAGS:STRING= /DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR
+
+//Flags used by the compiler during debug builds.
+CMAKE_CXX_FLAGS_DEBUG:STRING=/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1
+
+//Flags used by the compiler during release minsize builds.
+CMAKE_CXX_FLAGS_MINSIZEREL:STRING=/MD /O1 /Ob1 /D NDEBUG
+
+//Flags used by the compiler during release builds (/MD /Ob1 /Oi
+// /Ot /Oy /Gs will produce slightly less optimized but smaller
+// files).
+CMAKE_CXX_FLAGS_RELEASE:STRING=/MD /O2 /Ob2 /D NDEBUG
+
+//Flags used by the compiler during Release with Debug Info builds.
+//
+CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=/MD /Zi /O2 /Ob1 /D NDEBUG
+
+//Size of stack for programs.
+CMAKE_CXX_STACK_SIZE:STRING=10000000
+
+//Libraries linked by defalut with all C++ applications.
+CMAKE_CXX_STANDARD_LIBRARIES:STRING='kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib '
+
+//Default compiler warning level for C++.
+CMAKE_CXX_WARNING_LEVEL:STRING=3
+
+//C compiler
+CMAKE_C_COMPILER:FILEPATH=cl
+
+//Flags for C compiler.
+CMAKE_C_FLAGS:STRING= /DWIN32 /D_WINDOWS /W3 /Zm1000
+
+//Flags used by the compiler during debug builds.
+CMAKE_C_FLAGS_DEBUG:STRING=/D_DEBUG /MDd /Zi  /Ob0 /Od /RTC1
+
+//Flags used by the compiler during release minsize builds.
+CMAKE_C_FLAGS_MINSIZEREL:STRING=/MD /O1 /Ob1 /D NDEBUG
+
+//Flags used by the compiler during release builds (/MD /Ob1 /Oi
+// /Ot /Oy /Gs will produce slightly less optimized but smaller
+// files).
+CMAKE_C_FLAGS_RELEASE:STRING=/MD /O2 /Ob2 /D NDEBUG
+
+//Flags used by the compiler during Release with Debug Info builds.
+//
+CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=/MD /Zi /O2 /Ob1 /D NDEBUG
+
+//Libraries linked by defalut with all C applications.
+CMAKE_C_STANDARD_LIBRARIES:STRING='kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib '
+
+//Flags used by the linker.
+CMAKE_EXE_LINKER_FLAGS:STRING= /MANIFEST /STACK:10000000 /machine:I386
+
+//Flags used by the linker during debug builds.
+CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL:YES
+
+//Flags used by the linker during release minsize builds.
+CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO
+
+//Flags used by the linker during release builds.
+CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO
+
+//Flags used by the linker during Release with Debug Info builds.
+//
+CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL:YES
+
+//Install path prefix, prepended onto install directories.
+CMAKE_INSTALL_PREFIX:PATH=C:/Program Files/Orxonox
+
+//make program
+CMAKE_MAKE_PROGRAM:FILEPATH=C:/PROGRA~1/MICROS~2/Common7/IDE/devenv.com
+
+//Flags used by the linker during the creation of modules.
+CMAKE_MODULE_LINKER_FLAGS:STRING= /MANIFEST /STACK:10000000 /machine:I386
+
+//Flags used by the linker during debug builds.
+CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL:YES
+
+//Flags used by the linker during release minsize builds.
+CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO
+
+//Flags used by the linker during release builds.
+CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO
+
+//Flags used by the linker during Release with Debug Info builds.
+//
+CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL:YES
+
+//RC compiler
+CMAKE_RC_COMPILER:FILEPATH=rc
+
+//Flags for Fortran compiler.
+CMAKE_RC_FLAGS:STRING=' '
+
+//Flags used by the linker during the creation of dll's.
+CMAKE_SHARED_LINKER_FLAGS:STRING= /MANIFEST /STACK:10000000 /machine:I386
+
+//Flags used by the linker during debug builds.
+CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL:YES
+
+//Flags used by the linker during release minsize builds.
+CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO
+
+//Flags used by the linker during release builds.
+CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO
+
+//Flags used by the linker during Release with Debug Info builds.
+//
+CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL:YES
+
+//If set, runtime paths are not added when using shared libraries.
+//
+CMAKE_SKIP_RPATH:BOOL=OFF
+
+//If true, cmake will use relative paths in makefiles and projects.
+//
+CMAKE_USE_RELATIVE_PATHS:BOOL=OFF
+
+//If this value is on, makefiles will be generated without the
+// .SILENT directive, and all commands will be echoed to the console
+// during the make.  This is useful for debugging only. With Visual
+// Studio IDE projects all commands are done without /nologo.
+CMAKE_VERBOSE_MAKEFILE:BOOL=OFF
+
+//Single output directory for building all executables.
+EXECUTABLE_OUTPUT_PATH:PATH=
+
+//Single output directory for building all libraries.
+LIBRARY_OUTPUT_PATH:PATH=
+
+//Missing description
+OGRE_INCLUDE_DIR:PATH=../ogre/OgreMain/include
+
+//Missing description
+OGRE_LIBRARIES:STRING=debug;OgreMain_d;optimized;OgreMain
+
+//Missing description
+OGRE_LIB_DIR:PATH=D:/orxonox/project_make/../ogre/Samples/Common/bin/Release
+
+//Missing description
+OIS_INCLUDE_DIR:PATH=../ogre/Dependencies/include
+
+//Missing description
+OIS_LIBRARIES:STRING=debug;OIS_d;optimized;OIS
+
+//Missing description
+OIS_LIB_DIR:PATH=D:/orxonox/project_make/../ogre/Samples/Common/bin/Release
+
+//Library is used for debug links only
+OIS_LINK_TYPE:STATIC=optimized
+
+//Library is used for debug links only
+OIS_d_LINK_TYPE:STATIC=debug
+
+//Library is used for debug links only
+OgreGUIRenderer_LINK_TYPE:STATIC=optimized
+
+//Library is used for debug links only
+OgreGUIRenderer_d_LINK_TYPE:STATIC=debug
+
+//Library is used for debug links only
+OgreMain_LINK_TYPE:STATIC=optimized
+
+//Library is used for debug links only
+OgreMain_d_LINK_TYPE:STATIC=debug
+
+//Value Computed by CMake
+Orxonox_BINARY_DIR:STATIC=D:/orxonox/project_make/bin/src
+
+//Value Computed by CMake
+Orxonox_SOURCE_DIR:STATIC=D:/orxonox/project_make/src
+
+
+########################
+# INTERNAL cache entries
+########################
+
+//Stored GUID
+../bin/main_GUID_CMAKE:INTERNAL=8F17E8DD-EF89-4C22-A0F2-167AD950D6E4
+//Stored GUID
+ALL_BUILD_GUID_CMAKE:INTERNAL=3F43A6B8-0CD9-4299-BC3F-0F8DBEC01146
+//Advanced flag for variable: CMAKE_AR
+CMAKE_AR-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_BUILD_TOOL
+CMAKE_BUILD_TOOL-ADVANCED:INTERNAL=1
+//What is the target build tool cmake is generating for.
+CMAKE_BUILD_TOOL:INTERNAL=C:/PROGRA~1/MICROS~2/Common7/IDE/devenv.com
+//This is the directory where this CMakeCahe.txt was created
+CMAKE_CACHEFILE_DIR:INTERNAL=d:/orxonox/project_make/bin
+//Major version of cmake used to create the current loaded cache
+//
+CMAKE_CACHE_MAJOR_VERSION:INTERNAL=2
+//Minor version of cmake used to create the current loaded cache
+//
+CMAKE_CACHE_MINOR_VERSION:INTERNAL=4
+//Major version of cmake used to create the current loaded cache
+//
+CMAKE_CACHE_RELEASE_VERSION:INTERNAL=patch 7
+//Path to CMake executable.
+CMAKE_COMMAND:INTERNAL=D:/orxonox/cmake-2.4.7-win32-x86/bin/cmake.exe
+//Advanced flag for variable: CMAKE_CONFIGURATION_TYPES
+CMAKE_CONFIGURATION_TYPES-ADVANCED:INTERNAL=1
+//Path to ctest program executable.
+CMAKE_CTEST_COMMAND:INTERNAL=D:/orxonox/cmake-2.4.7-win32-x86/bin/ctest.exe
+//Advanced flag for variable: CMAKE_CXX_COMPILER
+CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1
+CMAKE_CXX_COMPILER_WORKS:INTERNAL=1
+//Advanced flag for variable: CMAKE_CXX_FLAGS
+CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_CXX_FLAGS_DEBUG
+CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_CXX_FLAGS_MINSIZEREL
+CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_CXX_FLAGS_RELEASE
+CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO
+CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_CXX_STACK_SIZE
+CMAKE_CXX_STACK_SIZE-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_CXX_STANDARD_LIBRARIES
+CMAKE_CXX_STANDARD_LIBRARIES-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_CXX_WARNING_LEVEL
+CMAKE_CXX_WARNING_LEVEL-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_C_COMPILER
+CMAKE_C_COMPILER-ADVANCED:INTERNAL=1
+CMAKE_C_COMPILER_WORKS:INTERNAL=1
+//Advanced flag for variable: CMAKE_C_FLAGS
+CMAKE_C_FLAGS-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_C_FLAGS_DEBUG
+CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_C_FLAGS_MINSIZEREL
+CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_C_FLAGS_RELEASE
+CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_C_FLAGS_RELWITHDEBINFO
+CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_C_STANDARD_LIBRARIES
+CMAKE_C_STANDARD_LIBRARIES-ADVANCED:INTERNAL=1
+//Path to cache edit program executable.
+CMAKE_EDIT_COMMAND:INTERNAL=D:/orxonox/cmake-2.4.7-win32-x86/bin/CMakeSetup.exe
+//Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS
+CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG
+CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL
+//
+CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE
+CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
+//
+CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
+//Name of generator.
+CMAKE_GENERATOR:INTERNAL=Visual Studio 8 2005
+//Start directory with the top level CMakeLists.txt file for this
+// project
+CMAKE_HOME_DIRECTORY:INTERNAL=D:/orxonox/project_make
+//Advanced flag for variable: CMAKE_MAKE_PROGRAM
+CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS
+CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG
+CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL
+//
+CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE
+//
+CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
+//
+CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
+//number of local generators
+CMAKE_NUMBER_OF_LOCAL_GENERATORS:INTERNAL=2
+//noop for ranlib
+CMAKE_RANLIB:INTERNAL=:
+//Advanced flag for variable: CMAKE_RC_COMPILER
+CMAKE_RC_COMPILER-ADVANCED:INTERNAL=1
+CMAKE_RC_COMPILER_WORKS:INTERNAL=1
+//Advanced flag for variable: CMAKE_RC_FLAGS
+CMAKE_RC_FLAGS-ADVANCED:INTERNAL=1
+//Path to CMake installation.
+CMAKE_ROOT:INTERNAL=D:/orxonox/cmake-2.4.7-win32-x86/share/cmake-2.4
+//Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS
+CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG
+CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL
+//
+CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE
+//
+CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
+//
+CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
+//Result of TRY_RUN
+CMAKE_SIZEOF_VOID_P:INTERNAL=4
+//Advanced flag for variable: CMAKE_SKIP_RPATH
+CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_USE_RELATIVE_PATHS
+CMAKE_USE_RELATIVE_PATHS-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_VERBOSE_MAKEFILE
+CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1
+//Stored GUID
+EDIT_CACHE_GUID_CMAKE:INTERNAL=1DE5DAE6-289E-4E4A-B940-28E28BF11CD4
+//Result of TRY_COMPILE
+HAVE_CMAKE_SIZEOF_VOID_P:INTERNAL=TRUE
+//Stored GUID
+INSTALL_GUID_CMAKE:INTERNAL=0674E882-E93A-413B-868D-A7B23DF04DE3
+//Stored GUID
+PACKAGE_GUID_CMAKE:INTERNAL=62F1CD05-C002-4EE4-B5A6-4F63E00AFF45
+//Stored GUID
+REBUILD_CACHE_GUID_CMAKE:INTERNAL=77BD3F50-1E2D-4E04-8744-69AFB6D92B55
+//Stored GUID
+RUN_TESTS_GUID_CMAKE:INTERNAL=32FE96A7-4B32-4AD9-9D2C-D036887B28B7
+//Stored GUID
+ZERO_CHECK_GUID_CMAKE:INTERNAL=573F13E6-3D74-491E-909A-3C24E9303E85
+
Index: code/branches/FICN/bin/resources.cfg
===================================================================
--- code/branches/FICN/bin/resources.cfg	(revision 336)
+++ code/branches/FICN/bin/resources.cfg	(revision 337)
@@ -9,12 +9,11 @@
 FileSystem=../Media/fonts
 #FileSystem=../Media/materials/programs
-#FileSystem=../Media/materials/scripts
-#FileSystem=../Media/materials/textures
-#FileSystem=../Media/models
-#FileSystem=../Media/overlays
+FileSystem=../Media/materials/scripts
+FileSystem=../Media/materials/textures
+FileSystem=../Media/models
+FileSystem=../Media/overlay
 #FileSystem=../Media/particle
 FileSystem=../Media/gui
-#FileSystem=../Media/DeferredShadingMedia
-#Zip=../Media/packs/cubemap.zip
+Zip=../Media/packs/cubemap.zip
 #Zip=../Media/packs/cubemapsJS.zip
 #Zip=../Media/packs/dragon.zip
@@ -22,2 +21,26 @@
 #Zip=../Media/packs/ogretestmap.zip
 Zip=../Media/packs/skybox.zip
+
+# # Resource locations to be added to the 'boostrap' path
+# # This also contains the minimum you need to use the Ogre example framework
+# [Bootstrap]
+# Zip=../Media/packs/OgreCore.zip
+#
+# # Resource locations to be added to the default path
+# [General]
+# FileSystem=../Media
+# FileSystem=../Media/fonts
+# FileSystem=../Media/materials/programs
+# FileSystem=../Media/materials/scripts
+# FileSystem=../Media/materials/textures
+# FileSystem=../Media/models
+# FileSystem=../Media/overlays
+# FileSystem=../Media/particle
+# FileSystem=../Media/gui
+# FileSystem=../Media/DeferredShading../Media
+# Zip=../Media/packs/cubemap.zip
+# Zip=../Media/packs/cubemapsJS.zip
+# Zip=../Media/packs/dragon.zip
+# Zip=../Media/packs/fresneldemo.zip
+# Zip=../Media/packs/ogretestmap.zip
+# Zip=../Media/packs/skybox.zip
Index: code/branches/FICN/cmake/FindBoost.cmake
===================================================================
--- code/branches/FICN/cmake/FindBoost.cmake	(revision 337)
+++ code/branches/FICN/cmake/FindBoost.cmake	(revision 337)
@@ -0,0 +1,269 @@
+# - Find the Boost includes and libraries.
+# The following variables are set if Boost is found.  If Boost is not
+# found, Boost_FOUND is set to false.
+#  Boost_FOUND                  - True when the Boost include directory is found.
+#  Boost_INCLUDE_DIRS           - the path to where the boost include files are.
+#  Boost_LIBRARY_DIRS           - The path to where the boost library files are.
+#  Boost_LIB_DIAGNOSTIC_DEFINITIONS - Only set if using Windows.
+#  Boost_<library>_FOUND        - True if the Boost <library> is found.
+#  Boost_<library>_INCLUDE_DIRS - The include path for Boost <library>.
+#  Boost_<library>_LIBRARIES    - The libraries to link to to use Boost <library>.
+#  Boost_LIBRARIES              - The libraries to link to to use all Boost libraries.
+#
+# The following variables can be set to configure how Boost is found:
+#  Boost_LIB_PREFIX             - Look for Boost libraries prefixed with this, e.g. "lib"
+#  Boost_LIB_SUFFIX             - Look for Boost libraries ending with this, e.g. "vc80-mt"
+#  Boost_LIB_SUFFIX_DEBUG       - As for Boost_LIB_SUFFIX but for debug builds, e.g. "vs80-mt-gd"
+
+# ----------------------------------------------------------------------------
+# If you have installed Boost in a non-standard location or you have
+# just staged the boost files using bjam then you have three
+# options. In the following comments, it is assumed that <Your Path>
+# points to the root directory of the include directory of Boost. e.g
+# If you have put boost in C:\development\Boost then <Your Path> is
+# "C:/development/Boost" and in this directory there will be two
+# directories called "include" and "lib".
+# 1) After CMake runs, set Boost_INCLUDE_DIR to <Your Path>/include/boost<-version>
+# 2) Use CMAKE_INCLUDE_PATH to set a path to <Your Path>/include. This will allow FIND_PATH()
+#    to locate Boost_INCLUDE_DIR by utilizing the PATH_SUFFIXES option. e.g.
+#    SET(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "<Your Path>/include")
+# 3) Set an environment variable called ${BOOST_ROOT} that points to the root of where you have
+#    installed Boost, e.g. <Your Path>. It is assumed that there is at least a subdirectory called
+#    include in this path.
+#
+# Note:
+#  1) If you are just using the boost headers, then you do not need to use
+#     Boost_LIBRARY_DIRS in your CMakeLists.txt file.
+#  2) If Boost has not been installed, then when setting Boost_LIBRARY_DIRS
+#     the script will look for /lib first and, if this fails, then for /stage/lib.
+#
+# Usage:
+# In your CMakeLists.txt file do something like this:
+# ...
+# # Boost
+# FIND_PACKAGE(Boost)
+# ...
+# INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
+# LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
+#
+# In Windows, we make the assumption that, if the Boost files are installed, the default directory
+# will be C:\boost.
+
+#
+# TODO:
+#
+# 1) Automatically find the Boost library files and eliminate the need
+#    to use Link Directories.
+#
+
+IF(WIN32)
+# In windows, automatic linking is performed, so you do not have to specify the libraries.
+# If you are linking to a dynamic runtime, then you can choose to link to either a static or a
+# dynamic Boost library, the default is to do a static link.  You can alter this for a specific
+# library "whatever" by defining BOOST_WHATEVER_DYN_LINK to force Boost library "whatever" to
+# be linked dynamically.  Alternatively you can force all Boost libraries to dynamic link by
+# defining BOOST_ALL_DYN_LINK.
+
+# This feature can be disabled for Boost library "whatever" by defining BOOST_WHATEVER_NO_LIB,
+# or for all of Boost by defining BOOST_ALL_NO_LIB.
+
+# If you want to observe which libraries are being linked against then defining
+# BOOST_LIB_DIAGNOSTIC will cause the auto-linking code to emit a #pragma message each time
+# a library is selected for linking.
+  SET(Boost_LIB_DIAGNOSTIC_DEFINITIONS "-DBOOST_LIB_DIAGNOSTIC")
+ENDIF(WIN32)
+
+
+SET(BOOST_INCLUDE_PATH_DESCRIPTION "directory containing the boost include files. E.g /usr/local/include/boost-1_33_1 or c:\\boost\\include\\boost-1_33_1")
+
+SET(BOOST_DIR_MESSAGE "Set the Boost_INCLUDE_DIR cmake cache entry to the ${BOOST_INCLUDE_PATH_DESCRIPTION}")
+
+SET(BOOST_DIR_SEARCH $ENV{BOOST_ROOT})
+IF(BOOST_DIR_SEARCH)
+  FILE(TO_CMAKE_PATH ${BOOST_DIR_SEARCH} BOOST_DIR_SEARCH)
+  SET(BOOST_DIR_SEARCH ${BOOST_DIR_SEARCH}/include)
+ENDIF(BOOST_DIR_SEARCH)
+
+IF(WIN32)
+  SET(BOOST_DIR_SEARCH
+    ${BOOST_DIR_SEARCH}
+    C:/boost/include
+    D:/boost/include
+  )
+ENDIF(WIN32)
+
+# Add in some path suffixes. These will have to be updated whenever a new Boost version comes out.
+SET(SUFFIX_FOR_PATH
+ boost-1_34_1
+ boost-1_34_0
+ boost-1_34
+ boost-1_33_1
+ boost-1_33_0
+)
+
+#
+# Look for an installation.
+#
+FIND_PATH(Boost_INCLUDE_DIR NAMES boost/config.hpp PATH_SUFFIXES ${SUFFIX_FOR_PATH} PATHS
+
+# Look in other places.
+  ${BOOST_DIR_SEARCH}
+
+# Help the user find it if we cannot.
+  DOC "The ${BOOST_INCLUDE_PATH_DESCRIPTION}"
+)
+
+# Assume we didn't find it.
+SET(Boost_FOUND 0)
+
+# Now try to get the include and library path.
+IF(Boost_INCLUDE_DIR)
+
+# Look for the boost library path.
+# Note that the user may not have installed any libraries
+# so it is quite possible the Boost_LIBRARY_PATH may not exist.
+  SET(Boost_LIBRARY_DIR ${Boost_INCLUDE_DIR})
+
+  IF("${Boost_LIBRARY_DIR}" MATCHES "boost-[0-9]+")
+    GET_FILENAME_COMPONENT(Boost_LIBRARY_DIR ${Boost_LIBRARY_DIR} PATH)
+  ENDIF ("${Boost_LIBRARY_DIR}" MATCHES "boost-[0-9]+")
+
+  IF("${Boost_LIBRARY_DIR}" MATCHES "/include$")
+# Strip off the trailing "/include" in the path.
+    GET_FILENAME_COMPONENT(Boost_LIBRARY_DIR ${Boost_LIBRARY_DIR} PATH)
+  ENDIF("${Boost_LIBRARY_DIR}" MATCHES "/include$")
+
+  IF(EXISTS "${Boost_LIBRARY_DIR}/lib")
+    SET (Boost_LIBRARY_DIR ${Boost_LIBRARY_DIR}/lib)
+  ELSE(EXISTS "${Boost_LIBRARY_DIR}/lib")
+    IF(EXISTS "${Boost_LIBRARY_DIR}/stage/lib")
+      SET(Boost_LIBRARY_DIR ${Boost_LIBRARY_DIR}/stage/lib)
+    ELSE(EXISTS "${Boost_LIBRARY_DIR}/stage/lib")
+      SET(Boost_LIBRARY_DIR "")
+    ENDIF(EXISTS "${Boost_LIBRARY_DIR}/stage/lib")
+  ENDIF(EXISTS "${Boost_LIBRARY_DIR}/lib")
+
+  IF(EXISTS "${Boost_INCLUDE_DIR}")
+    SET(Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIR})
+# We have found boost. It is possible that the user has not
+# compiled any libraries so we set Boost_FOUND to be true here.
+    SET(Boost_FOUND 1)
+    MARK_AS_ADVANCED(Boost_INCLUDE_DIR)
+  ENDIF(EXISTS "${Boost_INCLUDE_DIR}")
+
+  IF(Boost_LIBRARY_DIR AND EXISTS "${Boost_LIBRARY_DIR}")
+    SET(Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIR})
+  ENDIF(Boost_LIBRARY_DIR AND EXISTS "${Boost_LIBRARY_DIR}")
+ENDIF(Boost_INCLUDE_DIR)
+
+#
+# Find boost libraries
+#
+
+# List of library suffixes to search, e.g. libboost_date_time-gcc
+SET(BOOST_SUFFIX_SEARCH
+  gcc
+  il
+)
+
+# List of all boost libraries
+SET(BOOST_ALL_LIBRARIES
+  date_time
+  filesystem
+  graph
+  iostreams
+  program_options
+  python
+  regex
+  serialization
+  signals
+  unit_test_framework
+  thread
+  wave
+)
+
+# Macro to find boost library called name
+MACRO(BOOST_FIND_LIBRARY name)
+
+# User can specify a particular build variant via the variables:
+#   Boost_LIB_PREFIX, Boost_LIB_SUFFIX, Boost_LIB_SUFFIX_DEBUG
+# otherwise we'll search the BOOST_SUFFIX_SEARCH list
+  SET(BOOST_LIB_NAMES ${Boost_LIB_PREFIX}boost_${name}-${Boost_LIB_SUFFIX})
+  IF(NOT Boost_LIB_SUFFIX)
+    FOREACH(suffix ${BOOST_SUFFIX_SEARCH})
+      SET(BOOST_LIB_NAMES ${BOOST_LIB_NAMES} ${Boost_LIB_PREFIX}boost_${name}-${suffix})
+    ENDFOREACH(suffix)
+  ENDIF(NOT Boost_LIB_SUFFIX)
+
+# Find the library in the Boost_LIBRARY_DIRS
+  FIND_LIBRARY(Boost_${name}_LIBRARY
+    NAMES ${BOOST_LIB_NAMES}
+    PATHS ${Boost_LIBRARY_DIRS})
+
+# For MSVC builds find debug library
+  IF(WIN32 AND MSVC AND Boost_${name}_LIBRARY)
+    FIND_LIBRARY(Boost_${name}_LIBRARY_DEBUG ${Boost_LIB_PREFIX}boost_${name}-${Boost_LIB_SUFFIX_DEBUG})
+
+    IF(MSVC_IDE)
+      IF(Boost_${name}_LIBRARY AND Boost_${name}_LIBRARY_DEBUG)
+        SET(Boost_${name}_LIBRARIES debug ${Boost_${name}_LIBRARY_DEBUG} optimized ${Boost_${name}_LIBRARY})
+      ELSE(Boost_${name}_LIBRARY AND Boost_${name}_LIBRARY_DEBUG)
+        MESSAGE(FATAL_ERROR "Could not find the debug and release version of Boost ${name} library.")
+      ENDIF(Boost_${name}_LIBRARY AND Boost_${name}_LIBRARY_DEBUG)
+    ELSE(MSVC_IDE)
+      STRING(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_TOLOWER)
+      IF(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug)
+        SET(Boost_${name}_LIBRARIES ${Boost_${name}_LIBRARY_DEBUG})
+      ELSE(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug)
+        SET(Boost_${name}_LIBRARIES ${Boost_${name}_LIBRARY})
+      ENDIF(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug)
+    ENDIF(MSVC_IDE)
+  ELSE(WIN32 AND MSVC AND Boost_${name}_LIBRARY)
+    SET(Boost_${name}_LIBRARIES ${Boost_${name}_LIBRARY})
+  ENDIF(WIN32 AND MSVC AND Boost_${name}_LIBRARY)
+
+# If we've got it setup appropriate variables or issue error message
+  IF(Boost_${name}_LIBRARY)
+    SET(Boost_${name}_FOUND 1)
+    SET(Boost_${name}_INCLUDE_DIRS ${Boost_INCLUDE_DIR})
+    MARK_AS_ADVANCED(Boost_${name}_LIBRARY Boost_${name}_LIBRARY_DEBUG)
+  ELSE(Boost_${name}_LIBRARY)
+    IF(NOT Boost_FIND_QUIETLY)
+      MESSAGE(STATUS "Boost ${name} library was not found.")
+    ELSE(NOT Boost_FIND_QUIETLY)
+      IF(Boost_FIND_REQUIRED_${name})
+        MESSAGE(FATAL_ERROR "Could NOT find required Boost ${name} library.")
+      ENDIF(Boost_FIND_REQUIRED_${name})
+    ENDIF(NOT Boost_FIND_QUIETLY)
+  ENDIF(Boost_${name}_LIBRARY)
+ENDMACRO(BOOST_FIND_LIBRARY)
+
+IF(Boost_LIBRARY_DIRS)
+
+# If the user specified required components e.g. via
+# FIND_PACKAGE(Boost REQUIRED date_time regex)
+# find (just) those libraries. Otherwise find all libraries.
+  IF(Boost_FIND_COMPONENTS)
+    SET(Boost_FIND_LIBRARIES ${Boost_FIND_COMPONENTS})
+  ELSE(Boost_FIND_COMPONENTS)
+    SET(Boost_FIND_LIBRARIES ${BOOST_ALL_LIBRARIES})
+  ENDIF(Boost_FIND_COMPONENTS)
+
+  SET(Boost_LIBRARIES)
+  FOREACH(library ${Boost_FIND_LIBRARIES})
+    BOOST_FIND_LIBRARY(${library})
+    IF(Boost_${library}_FOUND)
+      SET(Boost_LIBRARIES ${Boost_LIBRARIES} ${Boost_${library}_LIBRARIES})
+    ENDIF(Boost_${library}_FOUND)
+  ENDFOREACH(library)
+ENDIF(Boost_LIBRARY_DIRS)
+
+IF(NOT Boost_FOUND)
+  IF(NOT Boost_FIND_QUIETLY)
+    MESSAGE(STATUS "Boost was not found. ${BOOST_DIR_MESSAGE}")
+  ELSE(NOT Boost_FIND_QUIETLY)
+    IF(Boost_FIND_REQUIRED)
+      MESSAGE(FATAL_ERROR "Boost was not found. ${BOOST_DIR_MESSAGE}")
+    ENDIF(Boost_FIND_REQUIRED)
+  ENDIF(NOT Boost_FIND_QUIETLY)
+ENDIF(NOT Boost_FOUND)
Index: code/branches/FICN/cmake/FindENet.cmake
===================================================================
--- code/branches/FICN/cmake/FindENet.cmake	(revision 337)
+++ code/branches/FICN/cmake/FindENet.cmake	(revision 337)
@@ -0,0 +1,46 @@
+# - Try to find enet
+# Once done this will define
+#
+#  ENET_FOUND - system has enet
+#  ENET_INCLUDE_DIR - the enet include directory
+#  ENET_LIBRARIES - the libraries needed to use enet
+#  ENET_DEFINITIONS - Compiler switches required for using enet
+#
+#  Borrowed from The Mana World
+#  http://themanaworld.org/
+#
+
+IF (ENet_INCLUDE_DIR AND ENet_LIBRARY)
+   SET(ENet_FIND_QUIETLY TRUE)
+ENDIF (ENet_INCLUDE_DIR AND ENet_LIBRARY)
+
+FIND_PATH(ENet_INCLUDE_DIR enet/enet.h
+    /usr/include
+    /usr/local/include
+    /usr/pack/enet-2007-sd/include
+    )
+
+FIND_LIBRARY(ENet_LIBRARY
+    NAMES enet
+    PATHS /usr/lib /usr/local/lib /usr/pack/enet-2007-sd/i686-debian-linux3.1/lib/
+    )
+
+IF (ENet_INCLUDE_DIR AND ENet_LIBRARY)
+    SET(ENET_FOUND TRUE)
+    SET(ENET_INCLUDE_DIR ${ENet_INCLUDE_DIR})
+    SET(ENET_LIBRARIES ${ENet_LIBRARY})
+ELSE (ENet_INCLUDE_DIR AND ENet_LIBRARY)
+    SET(ENET_FOUND FALSE)
+ENDIF (ENet_INCLUDE_DIR AND ENet_LIBRARY)
+
+IF (ENET_FOUND)
+    IF (NOT ENet_FIND_QUIETLY)
+        MESSAGE(STATUS "Found enet: ${ENet_LIBRARY}")
+    ENDIF (NOT ENet_FIND_QUIETLY)
+ELSE (ENET_FOUND)
+    IF (ENet_FIND_REQUIRED)
+        MESSAGE(FATAL_ERROR "Could NOT find enet")
+    ENDIF (ENet_FIND_REQUIRED)
+ENDIF (ENET_FOUND)
+
+MARK_AS_ADVANCED(ENet_INCLUDE_DIR ENet_LIBRARY)
Index: code/branches/FICN/cmake/FindODE.cmake
===================================================================
--- code/branches/FICN/cmake/FindODE.cmake	(revision 337)
+++ code/branches/FICN/cmake/FindODE.cmake	(revision 337)
@@ -0,0 +1,46 @@
+# find ODE (Open Dynamics Engine) includes and library
+#
+# ODE_INCLUDE_DIR - where the directory containing the ODE headers can be
+#                   found
+# ODE_LIBRARY     - full path to the ODE library
+# ODE_FOUND       - TRUE if ODE was found
+
+IF (NOT ODE_FOUND)
+
+  FIND_PATH(ODE_INCLUDE_DIR ode/ode.h
+    /usr/include
+    /usr/local/include
+    $ENV{OGRE_HOME}/include # OGRE SDK on WIN32
+    $ENV{INCLUDE}
+  )
+  FIND_LIBRARY(ODE_LIBRARY
+    NAMES ode
+    PATHS
+    /usr/lib
+    /usr/local/lib
+    $ENV{OGRE_HOME}/lib # OGRE SDK on WIN32
+  )
+
+  IF(ODE_INCLUDE_DIR)
+    MESSAGE(STATUS "Found ODE include dir: ${ODE_INCLUDE_DIR}")
+  ELSE(ODE_INCLUDE_DIR)
+    MESSAGE(STATUS "Could NOT find ODE headers.")
+  ENDIF(ODE_INCLUDE_DIR)
+
+  IF(ODE_LIBRARY)
+    MESSAGE(STATUS "Found ODE library: ${ODE_LIBRARY}")
+  ELSE(ODE_LIBRARY)
+    MESSAGE(STATUS "Could NOT find ODE library.")
+  ENDIF(ODE_LIBRARY)
+
+  IF(ODE_INCLUDE_DIR AND ODE_LIBRARY)
+     SET(ODE_FOUND TRUE CACHE STRING "Whether ODE was found or not")
+   ELSE(ODE_INCLUDE_DIR AND ODE_LIBRARY)
+     SET(ODE_FOUND FALSE)
+     IF(ODE_FIND_REQUIRED)
+       MESSAGE(FATAL_ERROR "Could not find ODE. Please install ODE (http://www.ode.org)")
+     ENDIF(ODE_FIND_REQUIRED)
+   ENDIF(ODE_INCLUDE_DIR AND ODE_LIBRARY)
+ENDIF (NOT ODE_FOUND)
+
+# vim: et sw=4 ts=4
Index: code/branches/FICN/src/CMakeLists.txt
===================================================================
--- code/branches/FICN/src/CMakeLists.txt	(revision 336)
+++ code/branches/FICN/src/CMakeLists.txt	(revision 337)
@@ -1,11 +1,21 @@
 PROJECT(Orxonox)
 
-# create a few variables to simplify life
-SET(SRC_FILES orxonox/orxonox.cc loader/LevelLoader.cc xml/xmlParser.cc orxonox/core/IdentifierList.cc orxonox/core/Identifier.cc orxonox/core/MetaObjectList.cc orxonox/core/Factory.cc orxonox/core/OrxonoxClass.cc orxonox/objects/BaseObject.cc orxonox/objects/test1.cc orxonox/objects/test2.cc orxonox/objects/test3.cc)
-SET(INC_FILES loader/LevelLoader.h xml/xmlParser.h orxonox/core/IdentifierIncludes.h orxonox/core/Identifier.h orxonox/core/Factory.h orxonox/core/ClassFactory.h orxonox/core/IdentifierList.h orxonox/core/ObjectList.h orxonox/core/MetaObjectList.h orxonox/core/Iterator.h orxonox/core/OrxonoxClass.h orxonox/objects/BaseObject.h orxonox/objects/Test.h orxonox/objects/test1.h orxonox/objects/test2.h orxonox/objects/test3.h)
+ADD_SUBDIRECTORY(orxonox)
+ADD_SUBDIRECTORY(loader)
+ADD_SUBDIRECTORY(network)
+ADD_SUBDIRECTORY(class_hierarchy)
 
-#Creates an executable
-ADD_EXECUTABLE(../bin/main ${SRC_FILES} ${INC_FILES})
-#Links the executable against OGRE and OIS
-TARGET_LINK_LIBRARIES(../bin/main ${OGRE_LIBRARIES} ${OIS_LIBRARIES} ${CEGUI_LIBRARIES} ${CEGUI_OGRE_LIBRARIES})
-
+# =======
+# PROJECT(Orxonox)
+#
+# # create a few variables to simplify life
+#
+# SET(SRC_FILES orxonox.cc loader/LevelLoader.cc xml/xmlParser.cc spaceship_steering.cc)
+# SET(INC_FILES loader/LevelLoader.h xml/xmlParser.h spaceship_steering.h )
+#
+# #Creates an executable
+# ADD_EXECUTABLE(../bin/main ${SRC_FILES} ${INC_FILES})
+# #Links the executable against OGRE and OIS
+# TARGET_LINK_LIBRARIES(../bin/main ${OGRE_LIBRARIES} ${OIS_LIBRARIES} ${CEGUI_LIBRARIES} ${CEGUI_OGRE_LIBRARIES})
+#
+# >>>>>>> .merge-right.r318
Index: code/branches/FICN/src/Flocking.h
===================================================================
--- code/branches/FICN/src/Flocking.h	(revision 337)
+++ code/branches/FICN/src/Flocking.h	(revision 337)
@@ -0,0 +1,143 @@
+//
+//
+//      TODO: testing orxonox -flocking interface
+//            testing algorithm
+
+// ueberpruefen ob vektoren relativ richtig berechnet werden
+//
+//My Flocking Class
+
+#ifndef Flocking_Class
+#define Flocking_Class
+
+#include <Ogre.h>
+#include <OgreVector3.h>
+
+#include <iostream>
+
+
+#endif
+
+using namespace std;
+using namespace Ogre;
+
+class Element // An element that flocks
+{
+
+  public:
+    Vector3 location;  // locationvector of the element
+    Vector3 speed;  // speedvector of the element
+    Vector3 acceleration;  // accelerationvector of the element
+
+  Element() {
+    acceleration = (0,0,0);
+    speed = (0,0,0);
+    location = (0,0,0);
+  }
+
+  Element(Vector3 location_, Vector3 speed_, Vector3 acceleration_) {
+    acceleration = acceleration_;
+    speed = speed_;
+    location = location_;
+  }
+
+  void setValues(Vector3 location_, Vector3 speed_, Vector3 acceleration_) {
+    acceleration = acceleration_;
+    speed = speed_;
+    location = location_;
+  }
+
+  //calculates the distance between the element and an other point given by temp
+  float getDistance(Element temp) {
+    Vector3 distance = temp.location-location;  //this doesn't work
+    return distance.length();
+  }
+
+//EINF[GEN DES ELEMENTS
+  void update(Element arrayOfElements[], const FrameEvent& time) {
+    calculateAcceleration(arrayOfElements);  //updates the acceleration
+    calculateSpeed(time);  //updates the speed
+    calculateLocation(time);  //updates the location
+  }
+
+//EINF[GEN DES ELEMENTS
+  void calculateAcceleration(Element arrayOfElements[]) {
+  //calculates the accelerationvector based on the steeringvectors of
+  //separtion, alignment and cohesion.
+  acceleration = separation(arrayOfElements) + alignment(arrayOfElements) + cohesion(arrayOfElements);
+  }
+
+  void calculateSpeed(const FrameEvent& time) {
+    speed = speed + acceleration*time.timeSinceLastFrame;
+  }
+
+  void calculateLocation(const FrameEvent& time) {
+    location = location + speed*time.timeSinceLastFrame;
+  }
+
+
+  Vector3 separation(Element arrayOfElements[]) {
+    Vector3* steering = new Vector3(0,0,0); //steeringvector
+    int numberOfNeighbour = 0;  //number of observed neighbours
+    //go through all elements
+    for(int i=0; i<3; i++) {  //just working with 3 elements at the moment
+      Element actual = arrayOfElements[i];  //get the actual element
+      float distance = getDistance(actual);  //get distance between this and actual
+//DUMMY SEPERATION DETECTION DISTANCE =100
+      if ((distance > 0) && (distance<100)) {  //do only if actual is inside detectionradius
+        Vector3 inverseDistance = actual.location-location;  //calculate the distancevector heading towards this
+        inverseDistance = inverseDistance.normalise(); //does this work correctly?  //normalise the distancevector
+        inverseDistance = inverseDistance/*/distance*/;  //devide distancevector by distance (the closer the bigger gets the distancevector -> steeringvector)
+        *steering = *steering + inverseDistance;  //add up all significant steeringvectors
+        numberOfNeighbour++;  //counts the elements inside the detectionradius
+      }
+    }
+    if(numberOfNeighbour > 0) {
+    *steering = *steering / (float)numberOfNeighbour;  //devide the sum of steeringvectors by the number of elements -> separation steeringvector
+    }
+    return *steering;
+  }
+
+  Vector3 alignment(Element arrayOfElements[]) {
+    Vector3* steering = new Vector3(0,0,0); //steeringvector
+    int numberOfNeighbour = 0;  //number of observed neighbours
+    //go through all elements
+    for(int i=0; i<3; i++) {  //just working with 3 elements at the moment
+      Element actual = arrayOfElements[i];  //get the actual element
+      float distance = getDistance(actual);  //get distance between this and actual
+//DUMMY ALIGNMENT DETECTION DISTANCE = 1000
+      if ((distance > 0) && (distance<1000)) {  //check if actual element is inside detectionradius
+        *steering = *steering + actual.speed;  //add up all speedvectors inside the detectionradius
+        numberOfNeighbour++;  //counts the elements inside the detectionradius
+      }
+    }
+    if(numberOfNeighbour > 0) {
+    *steering = *steering / (float)numberOfNeighbour;  //devide the sum of steeringvectors by the number of elements -> alignment steeringvector
+    }
+    return *steering;
+  }
+
+  Vector3 cohesion(Element arrayOfElements[]) {
+    Vector3* steering = new Vector3(0,0,0); //steeringvector
+    int numberOfNeighbour = 0;  //number of observed neighbours
+    //go through all elements
+    for(int i=0; i<3; i++) {  //just working with 3 elements at the moment
+      Element actual = arrayOfElements[i];  //get the actual element
+      float distance = getDistance(actual);  //get distance between this and actual
+// DUMMY COHESION DETECTION DISTANCE = 1000
+      if ((distance > 0) && (distance<1000)) {  //check if actual element is inside detectionradius
+        *steering = *steering + actual.location;  //add up all locations of elements inside the detectionradius
+        numberOfNeighbour++;  //counts the elements inside the detectionradius
+      }
+     }
+    if(numberOfNeighbour > 0) {
+    *steering = *steering  / (float)numberOfNeighbour;  //devide the sum steeringvector by the number of elements -> cohesion steeringvector
+    }
+    return *steering;
+  }
+ 
+};
+
+
+
+//End of My Flocking Class
Index: code/branches/FICN/src/class_hierarchy/BaseObject.cc
===================================================================
--- code/branches/FICN/src/class_hierarchy/BaseObject.cc	(revision 337)
+++ code/branches/FICN/src/class_hierarchy/BaseObject.cc	(revision 337)
@@ -0,0 +1,14 @@
+#include "BaseObject.h"
+
+namespace orxonox
+{
+    BaseObject::BaseObject()
+    {
+        registerRootObject(BaseObject);
+    }
+
+    BaseObject::~BaseObject()
+    {
+        unregisterObject();
+    }
+}
Index: code/branches/FICN/src/class_hierarchy/BaseObject.h
===================================================================
--- code/branches/FICN/src/class_hierarchy/BaseObject.h	(revision 337)
+++ code/branches/FICN/src/class_hierarchy/BaseObject.h	(revision 337)
@@ -0,0 +1,70 @@
+#ifndef _BaseObject_H__
+#define _BaseObject_H__
+
+#include "IdentifierIncludes.h"
+
+namespace orxonox
+{
+    class BaseObject : virtual public OrxonoxClass
+    {
+        public:
+            BaseObject();
+            virtual ~BaseObject();
+
+            inline bool isA(Identifier* identifier)
+                { return this->getIdentifier()->isA(identifier); }
+            inline bool isDirectlyA(Identifier* identifier)
+                { return this->getIdentifier()->isDirectlyA(identifier); }
+            inline bool isChildOf(Identifier* identifier)
+                { return this->getIdentifier()->isChildOf(identifier); }
+            inline bool isDirectChildOf(Identifier* identifier)
+                { return this->getIdentifier()->isDirectChildOf(identifier); }
+            inline bool isParentOf(Identifier* identifier)
+                { return this->getIdentifier()->isParentOf(identifier); }
+            inline bool isDirectParentOf(Identifier* identifier)
+                { return this->getIdentifier()->isDirectParentOf(identifier); }
+
+            inline bool isA(BaseIdentifier<class B>* identifier)
+                { return this->getIdentifier()->isA(identifier->getIdentifier()); }
+            inline bool isDirectlyA(BaseIdentifier<class B>* identifier)
+                { return this->getIdentifier()->isDirectlyA(identifier->getIdentifier()); }
+            inline bool isChildOf(BaseIdentifier<class B>* identifier)
+                { return this->getIdentifier()->isChildOf(identifier->getIdentifier()); }
+            inline bool isDirectChildOf(BaseIdentifier<class B>* identifier)
+                { return this->getIdentifier()->isDirectChildOf(identifier->getIdentifier()); }
+            inline bool isParentOf(BaseIdentifier<class B>* identifier)
+                { return this->getIdentifier()->isParentOf(identifier->getIdentifier()); }
+            inline bool isDirectParentOf(BaseIdentifier<class B>* identifier)
+                { return this->getIdentifier()->isDirectParentOf(identifier->getIdentifier()); }
+
+            inline bool isA(BaseIdentifier<class B> identifier)
+                { return this->getIdentifier()->isA(identifier.getIdentifier()); }
+            inline bool isDirectlyA(BaseIdentifier<class B> identifier)
+                { return this->getIdentifier()->isDirectlyA(identifier.getIdentifier()); }
+            inline bool isChildOf(BaseIdentifier<class B> identifier)
+                { return this->getIdentifier()->isChildOf(identifier.getIdentifier()); }
+            inline bool isDirectChildOf(BaseIdentifier<class B> identifier)
+                { return this->getIdentifier()->isDirectChildOf(identifier.getIdentifier()); }
+            inline bool isParentOf(BaseIdentifier<class B> identifier)
+                { return this->getIdentifier()->isParentOf(identifier.getIdentifier()); }
+            inline bool isDirectParentOf(BaseIdentifier<class B> identifier)
+                { return this->getIdentifier()->isDirectParentOf(identifier.getIdentifier()); }
+/*
+            inline bool isA(OrxonoxClass* object)
+                { return this->getIdentifier()->isA(object->getIdentifier()); }
+            inline bool isDirectlyA(OrxonoxClass* object)
+                { return this->getIdentifier()->isDirectlyA(object->getIdentifier); }
+            inline bool isChildOf(OrxonoxClass* object)
+                { return this->getIdentifier()->isChildOf(object->getIdentifier); }
+            inline bool isDirectChildOf(OrxonoxClass* object)
+                { return this->getIdentifier()->isDirectChildOf(object->getIdentifier); }
+            inline bool isParentOf(OrxonoxClass* object)
+                { return this->getIdentifier()->isParentOf(object->getIdentifier); }
+            inline bool isDirectParentOf(OrxonoxClass* object)
+                { return this->getIdentifier()->isDirectParentOf(object->getIdentifier); }
+*/
+
+    };
+}
+
+#endif
Index: code/branches/FICN/src/class_hierarchy/CMakeLists.txt
===================================================================
--- code/branches/FICN/src/class_hierarchy/CMakeLists.txt	(revision 337)
+++ code/branches/FICN/src/class_hierarchy/CMakeLists.txt	(revision 337)
@@ -0,0 +1,17 @@
+PROJECT(Orxonox)
+
+# create a few variables to simplify life
+SET( CLASS_HIERARCHY_SRC
+	BaseObject.cc
+	ClassHierarchy.cc
+	Identifier.cc
+	IdentifierList.cc
+	ObjectList.cc
+	orxonox.cc
+	OrxonoxClass.cc
+	test1.cc
+	test2.cc
+	test3.cc
+   )
+
+ADD_LIBRARY(classHierarchy ${CLASS_HIERARCHY_SRC} )
Index: code/branches/FICN/src/class_hierarchy/ClassHierarchy.cc
===================================================================
--- code/branches/FICN/src/class_hierarchy/ClassHierarchy.cc	(revision 337)
+++ code/branches/FICN/src/class_hierarchy/ClassHierarchy.cc	(revision 337)
@@ -0,0 +1,28 @@
+#include "ClassHierarchy.h"
+#include "OrxonoxClass.h"
+
+namespace orxonox
+{
+    // ###############################
+    // ###     ClassHierarchy      ###
+    // ###############################
+    ClassHierarchy* ClassHierarchy::pointer_ = NULL;
+
+    ClassHierarchy* ClassHierarchy::getSingleton()
+    {
+        if (!pointer_)
+            pointer_ = new ClassHierarchy();
+
+        return pointer_;
+    }
+
+    ClassHierarchy::ClassHierarchy()
+    {
+        this->hierarchyCreatingCounter_ = 0;
+    }
+
+    ClassHierarchy::~ClassHierarchy()
+    {
+      this->pointer_ = NULL;
+    }
+}
Index: code/branches/FICN/src/class_hierarchy/ClassHierarchy.h
===================================================================
--- code/branches/FICN/src/class_hierarchy/ClassHierarchy.h	(revision 337)
+++ code/branches/FICN/src/class_hierarchy/ClassHierarchy.h	(revision 337)
@@ -0,0 +1,97 @@
+#ifndef _ClassHierarchy_H__
+#define _ClassHierarchy_H__
+
+#include <string>
+#include <iostream>
+
+// DONE AND TESTED:
+// - build class hierarchy
+// - isA, isChildOf, ...
+// - insert into class-lists
+// - ClassIdentifier
+// - BaseIdentifier
+
+// IN WORK:
+// - Factory
+
+// TO DO:
+// - iterate through lists
+// - searchtree for classname-strings
+
+
+namespace orxonox
+{
+    // ##### ClassHierarchy #####
+    template <class T>
+    class ClassIdentifier;
+
+    class ClassHierarchy
+    {
+        template <class T>
+        friend class ClassIdentifier;
+
+        public:
+            static ClassHierarchy* getSingleton();
+            bool isCreatingHierarchy() { return (this->hierarchyCreatingCounter_ > 0); }
+
+        private:
+            ClassHierarchy();
+            ~ClassHierarchy();
+            void startCreatingHierarchy() { this->hierarchyCreatingCounter_++; std::cout << "*** Increased Hierarchy-Creating-Counter to " << this->hierarchyCreatingCounter_ << "\n"; }
+            void stopCreatingHierarchy() { this->hierarchyCreatingCounter_--; std::cout << "*** Decreased Hierarchy-Creating-Counter to " << this->hierarchyCreatingCounter_ << "\n"; }
+
+            static ClassHierarchy* pointer_;
+            int hierarchyCreatingCounter_;
+    };
+
+
+    // ##### Macros #####
+    #define registerRootObject(ClassName) \
+        std::cout << "*** Register Root-Object: " << #ClassName << "\n"; \
+        if (ClassHierarchy::getSingleton()->isCreatingHierarchy() && !this->getParents()) \
+            this->setParents(new IdentifierList()); \
+        if (this->getIdentifier()) \
+            this->getIdentifier()->removeObject(this); \
+        this->setIdentifier(ClassIdentifier<ClassName>::registerClass(this->getParents(), #ClassName, true, false)); \
+        if (ClassHierarchy::getSingleton()->isCreatingHierarchy() && this->getParents()) \
+            this->getParents()->add(this->getIdentifier()); \
+        this->getIdentifier()->addObject(this)
+
+    #define registerAbstractRootObject(ClassName) \
+        std::cout << "*** Register Root-Object: " << #ClassName << "\n"; \
+        if (ClassHierarchy::getSingleton()->isCreatingHierarchy() && !this->getParents()) \
+            this->setParents(new IdentifierList()); \
+        if (this->getIdentifier()) \
+            this->getIdentifier()->removeObject(this); \
+        this->setIdentifier(ClassIdentifier<ClassName>::registerClass(this->getParents(), #ClassName, true, true)); \
+        if (ClassHierarchy::getSingleton()->isCreatingHierarchy() && this->getParents()) \
+            this->getParents()->add(this->getIdentifier()); \
+        this->getIdentifier()->addObject(this)
+
+    #define registerObject(ClassName) \
+        std::cout << "*** Register Object: " << #ClassName << "\n"; \
+        this->getIdentifier()->removeObject(this); \
+        this->setIdentifier(ClassIdentifier<ClassName>::registerClass(this->getParents(), #ClassName, false, false)); \
+        if (ClassHierarchy::getSingleton()->isCreatingHierarchy() && this->getParents()) \
+            this->getParents()->add(this->getIdentifier()); \
+        this->getIdentifier()->addObject(this)
+
+    #define registerAbstractObject(ClassName) \
+        std::cout << "*** Register Object: " << #ClassName << "\n"; \
+        this->getIdentifier()->removeObject(this); \
+        this->setIdentifier(ClassIdentifier<ClassName>::registerClass(this->getParents(), #ClassName, false, true)); \
+        if (ClassHierarchy::getSingleton()->isCreatingHierarchy() && this->getParents()) \
+            this->getParents()->add(this->getIdentifier()); \
+        this->getIdentifier()->addObject(this)
+
+    #define unregisterObject() \
+        this->getIdentifier()->removeObject(this)
+
+    #define Class(ClassName) \
+        ClassIdentifier<ClassName>::getIdentifier()
+
+    #define Factory(ClassName) \
+        ClassIdentifier<ClassName>::create()
+}
+
+#endif
Index: code/branches/FICN/src/class_hierarchy/Identifier.cc
===================================================================
--- code/branches/FICN/src/class_hierarchy/Identifier.cc	(revision 337)
+++ code/branches/FICN/src/class_hierarchy/Identifier.cc	(revision 337)
@@ -0,0 +1,117 @@
+#include "Identifier.h"
+
+namespace orxonox
+{
+    // ###############################
+    // ###       Identifier        ###
+    // ###############################
+    Identifier::Identifier()
+    {
+        this->bCreatedOneObject_ = false;
+        this->directParents_ = new IdentifierList();
+        this->allParents_ = new IdentifierList();
+        this->directChildren_ = new IdentifierList();
+        this->allChildren_ = new IdentifierList();
+        this->objects_ = new ObjectList();
+    }
+
+    Identifier::~Identifier()
+    {
+        delete this->directParents_;
+        delete this->allParents_;
+        delete this->directChildren_;
+        delete this->allChildren_;
+        delete this->objects_;
+        delete &this->name_;
+    }
+
+    void Identifier::initialize(IdentifierList* parents)
+    {
+        std::cout << "*** Initialize " << this->name_ << "-Singleton.\n";
+        if (parents)
+        {
+            this->bCreatedOneObject_ = true;
+
+            IdentifierListElement* temp1;
+            IdentifierListElement* temp2;
+            IdentifierListElement* temp3;
+
+            temp1 = parents->first_;
+            while (temp1)
+            {
+                temp2 = temp1->identifier_->directParents_->first_;
+                while (temp2)
+                {
+                    temp3 = parents->first_;
+                    while(temp3)
+                    {
+                        if (temp3->identifier_ == temp2->identifier_)
+                            temp3->bDirect_ = false;
+
+                        temp3 = temp3->next_;
+                    }
+
+                    temp2 = temp2->next_;
+                }
+                temp1 = temp1->next_;
+            }
+
+            temp1 = parents->first_;
+            while (temp1)
+            {
+                if (temp1->bDirect_)
+                {
+                    this->directParents_->add(temp1->identifier_);
+                    temp1->identifier_->directChildren_->add(this);
+                }
+
+                this->allParents_->add(temp1->identifier_);
+                temp1->identifier_->allChildren_->add(this);
+
+                temp1 = temp1->next_;
+            }
+        }
+    }
+
+    void Identifier::addObject(OrxonoxClass* object)
+    {
+        std::cout << "*** Added " << this->name_ << " to list.\n";
+        this->objects_->add(object);
+    }
+
+    void Identifier::removeObject(OrxonoxClass* object)
+    {
+        std::cout << "*** Removed " << this->name_ << " from list.\n";
+        this->objects_->remove(object);
+    }
+
+    bool Identifier::isA(Identifier* identifier)
+    {
+        return (identifier == this || this->allParents_->isInList(identifier));
+    }
+
+    bool Identifier::isDirectlyA(Identifier* identifier)
+    {
+        return (identifier == this);
+    }
+
+    bool Identifier::isChildOf(Identifier* identifier)
+    {
+        return this->allParents_->isInList(identifier);
+    }
+
+    bool Identifier::isDirectChildOf(Identifier* identifier)
+    {
+        return this->directParents_->isInList(identifier);
+    }
+
+    bool Identifier::isParentOf(Identifier* identifier)
+    {
+        return this->allChildren_->isInList(identifier);
+    }
+
+    bool Identifier::isDirectParentOf(Identifier* identifier)
+    {
+        return this->directChildren_->isInList(identifier);
+    }
+}
Index: code/branches/FICN/src/class_hierarchy/Identifier.h
===================================================================
--- code/branches/FICN/src/class_hierarchy/Identifier.h	(revision 337)
+++ code/branches/FICN/src/class_hierarchy/Identifier.h	(revision 337)
@@ -0,0 +1,173 @@
+#ifndef _Identifier_H__
+#define _Identifier_H__
+
+#include "ClassHierarchy.h"
+#include "IdentifierList.h"
+#include "ObjectList.h"
+#include "OrxonoxClass.h"
+
+namespace orxonox
+{
+    // ##### Identifier #####
+    class Identifier
+    {
+        template <class T>
+        friend class ClassIdentifier;
+
+        template <class T>
+        friend class BaseIdentifier;
+
+        public:
+            void addObject(OrxonoxClass* object);
+            void removeObject(OrxonoxClass* object);
+
+            bool isA(Identifier* identifier);
+            bool isDirectlyA(Identifier* identifier);
+            bool isChildOf(Identifier* identifier);
+            bool isDirectChildOf(Identifier* identifier);
+            bool isParentOf(Identifier* identifier);
+            bool isDirectParentOf(Identifier* identifier);
+
+            std::string getName() { return this->name_; }
+            IdentifierList* getDirectParents() { return this->directParents_; }
+            IdentifierList* getAllParents() { return this->allParents_; }
+            IdentifierList* getDirectChildren() { return this->directChildren_; }
+            IdentifierList* getAllChildren() { return this->allChildren_; }
+
+        private:
+            Identifier();
+            Identifier(const Identifier& identifier) {}
+            virtual ~Identifier();
+            void initialize(IdentifierList* parents);
+
+            IdentifierList* directParents_;
+            IdentifierList* allParents_;
+            IdentifierList* directChildren_;
+            IdentifierList* allChildren_;
+
+            ObjectList* objects_;
+            std::string name_;
+
+            bool bIsAbstractClass_;
+            bool bCreatedOneObject_;
+    };
+
+
+    // ##### ClassIdentifier #####
+    template <class T>
+    class ClassIdentifier : public Identifier
+    {
+        public:
+            static ClassIdentifier<T>* registerClass(IdentifierList* parents, std::string name, bool bRootClass, bool bIsAbstractClass);
+            static ClassIdentifier<T>* getIdentifier();
+
+        private:
+            ClassIdentifier();
+            ClassIdentifier(const ClassIdentifier<T>& identifier) {}
+            ~ClassIdentifier();
+
+            static ClassIdentifier<T>* pointer_;
+
+    };
+
+    template <class T>
+    ClassIdentifier<T>* ClassIdentifier<T>::pointer_ = NULL;
+
+    template <class T>
+    ClassIdentifier<T>::ClassIdentifier()
+    {
+    }
+
+    template <class T>
+    ClassIdentifier<T>::~ClassIdentifier()
+    {
+        this->pointer_ = NULL;
+    }
+
+    template <class T>
+    ClassIdentifier<T>* ClassIdentifier<T>::registerClass(IdentifierList* parents, std::string name, bool bRootClass, bool bIsAbstractClass)
+    {
+        std::cout << "*** Register Class in " << name << "-Singleton.\n";
+        if (!pointer_)
+        {
+            std::cout << "*** Register Class in " << name << "-Singleton -> Create Singleton.\n";
+            if (parents || bRootClass)
+            {
+                pointer_ = new ClassIdentifier();
+                pointer_->name_ = name;
+                pointer_->bIsAbstractClass_ = bIsAbstractClass;
+                pointer_->initialize(parents);
+            }
+            else
+            {
+                pointer_ = getIdentifier();
+            }
+        }
+
+        return pointer_;
+    }
+
+    template <class T>
+    ClassIdentifier<T>* ClassIdentifier<T>::getIdentifier()
+    {
+//        std::cout << "*** Get Identifier.\n";
+        if (!pointer_)
+        {
+            std::cout << "*** Get Identifier -> Create Class\n";
+            ClassHierarchy::getSingleton()->startCreatingHierarchy();
+            T* temp = new T();
+            ClassHierarchy::getSingleton()->stopCreatingHierarchy();
+            delete temp;
+        }
+
+        return pointer_;
+    }
+
+
+    // ##### BaseIdentifier #####
+    template <class B>
+    class BaseIdentifier// : public Identifier
+    {
+        public:
+            BaseIdentifier();
+
+            //template <class T>
+            BaseIdentifier<B>& operator= (/*Class*/Identifier/*<T>*/* identifier)
+            {
+                if (!identifier->isA(ClassIdentifier<B>::getIdentifier()))
+                {
+                    std::cout << "Error: Class " << identifier->getName() << " is not a " << ClassIdentifier<B>::getIdentifier()->getName() << "!\n";
+                    std::cout << "Error: BaseIdentifier<" << ClassIdentifier<B>::getIdentifier()->getName() << "> = Class(" << identifier->getName() << ") is forbidden.\n";
+                    std::cout << "Aborting...\n";
+                    abort();
+                }
+                this->identifier_ = identifier;
+                return *this;
+            }
+            inline Identifier* getIdentifier()
+                { return this->identifier_; }
+            inline bool isA(Identifier* identifier)
+                { return this->identifier_->isA(identifier); }
+            inline bool isDirectlyA(Identifier* identifier)
+                { return this->identifier_->isDirectlyA(identifier); }
+            inline bool isChildOf(Identifier* identifier)
+                { return this->identifier_->isChildOf(identifier); }
+            inline bool isDirectChildOf(Identifier* identifier)
+                { return this->identifier_->isDirectChildOf(identifier); }
+            inline bool isParentOf(Identifier* identifier)
+                { return this->identifier_->isParentOf(identifier); }
+            inline bool isDirectParentOf(Identifier* identifier)
+                { return this->identifier_->isDirectParentOf(identifier); }
+
+        private:
+            Identifier* identifier_;
+    };
+
+    template <class B>
+    BaseIdentifier<B>::BaseIdentifier()
+    {
+        this->identifier_ = ClassIdentifier<B>::getIdentifier();
+    }
+}
+
+#endif
Index: code/branches/FICN/src/class_hierarchy/IdentifierIncludes.h
===================================================================
--- code/branches/FICN/src/class_hierarchy/IdentifierIncludes.h	(revision 337)
+++ code/branches/FICN/src/class_hierarchy/IdentifierIncludes.h	(revision 337)
@@ -0,0 +1,5 @@
+#include "ClassHierarchy.h"
+#include "Identifier.h"
+#include "IdentifierList.h"
+#include "ObjectList.h"
+#include "OrxonoxClass.h"
Index: code/branches/FICN/src/class_hierarchy/IdentifierList.cc
===================================================================
--- code/branches/FICN/src/class_hierarchy/IdentifierList.cc	(revision 337)
+++ code/branches/FICN/src/class_hierarchy/IdentifierList.cc	(revision 337)
@@ -0,0 +1,106 @@
+#include "IdentifierList.h"
+#include "Identifier.h"
+
+namespace orxonox
+{
+    // ###############################
+    // ###     IdentifierList      ###
+    // ###############################
+    IdentifierList::IdentifierList()
+    {
+        this->first_ = 0;
+    }
+
+    IdentifierList::~IdentifierList()
+    {
+        IdentifierListElement* temp;
+        while (this->first_)
+        {
+            temp = this->first_->next_;
+            delete this->first_;
+            this->first_ = temp;
+        }
+    }
+
+    void IdentifierList::add(Identifier* identifier)
+    {
+        IdentifierListElement* temp = this->first_;
+        this->first_ = new IdentifierListElement(identifier);
+        this->first_->next_ = temp;
+    }
+
+    void IdentifierList::remove(Identifier* identifier)
+    {
+        if (!identifier)
+            return;
+
+        if (this->first_->identifier_ == identifier)
+        {
+            IdentifierListElement* temp = this->first_->next_;
+            delete this->first_;
+            this->first_ = temp;
+
+            return;
+        }
+
+        IdentifierListElement* temp = this->first_;
+        while (temp->next_)
+        {
+            if (temp->next_->identifier_ == identifier)
+            {
+                IdentifierListElement* temp2 = temp->next_->next_;
+                delete temp->next_;
+                temp->next_ = temp2;
+
+                return;
+            }
+
+            temp = temp->next_;
+        }
+    }
+
+    bool IdentifierList::isInList(Identifier* identifier)
+    {
+        IdentifierListElement* temp = this->first_;
+        while (temp)
+        {
+            if (temp->identifier_ == identifier)
+                return true;
+
+            temp = temp->next_;
+        }
+
+        return false;
+    }
+
+    std::string IdentifierList::toString()
+    {
+        IdentifierListElement* temp = this->first_;
+        std::string output = "";
+
+        while (temp)
+        {
+            output += temp->identifier_->getName();
+            output += " ";
+
+            temp = temp->next_;
+        }
+
+        return output;
+    }
+
+
+    // ###############################
+    // ###  IdentifierListElement  ###
+    // ###############################
+    IdentifierListElement::IdentifierListElement(Identifier* identifier)
+    {
+        this->identifier_ = identifier;
+        this->next_ = 0;
+        this->bDirect_ = true;
+    }
+
+    IdentifierListElement::~IdentifierListElement()
+    {
+    }
+}
Index: code/branches/FICN/src/class_hierarchy/IdentifierList.h
===================================================================
--- code/branches/FICN/src/class_hierarchy/IdentifierList.h	(revision 337)
+++ code/branches/FICN/src/class_hierarchy/IdentifierList.h	(revision 337)
@@ -0,0 +1,35 @@
+#ifndef _IdentifierList_H__
+#define _IdentifierList_H__
+
+#include <string>
+
+namespace orxonox
+{
+    class Identifier;
+
+    class IdentifierListElement
+    {
+        public:
+            IdentifierListElement(Identifier* identifier);
+            ~IdentifierListElement();
+
+            Identifier* identifier_;
+            IdentifierListElement* next_;
+            bool bDirect_;
+    };
+
+    class IdentifierList
+    {
+        public:
+            IdentifierList();
+            ~IdentifierList();
+            void add(Identifier* identifier);
+            void remove(Identifier* identifier);
+            bool isInList(Identifier* identifier);
+            std::string toString();
+
+            IdentifierListElement* first_;
+    };
+}
+
+#endif
Index: code/branches/FICN/src/class_hierarchy/ObjectList.cc
===================================================================
--- code/branches/FICN/src/class_hierarchy/ObjectList.cc	(revision 337)
+++ code/branches/FICN/src/class_hierarchy/ObjectList.cc	(revision 337)
@@ -0,0 +1,74 @@
+#include "ObjectList.h"
+
+namespace orxonox
+{
+    // ###############################
+    // ###       ObjectList        ###
+    // ###############################
+    ObjectList::ObjectList()
+    {
+        this->first_ = 0;
+    }
+
+    ObjectList::~ObjectList()
+    {
+        ObjectListElement* temp;
+        while (this->first_)
+        {
+            temp = this->first_->next_;
+            delete this->first_;
+            this->first_ = temp;
+        }
+    }
+
+    void ObjectList::add(OrxonoxClass* object)
+    {
+        ObjectListElement* temp = this->first_;
+        this->first_ = new ObjectListElement(object);
+        this->first_->next_ = temp;
+    }
+
+    void ObjectList::remove(OrxonoxClass* object)
+    {
+        if (!object)
+            return;
+
+        if (this->first_->object_ == object)
+        {
+            ObjectListElement* temp = this->first_->next_;
+            delete this->first_;
+            this->first_ = temp;
+
+            return;
+        }
+
+        ObjectListElement* temp = this->first_;
+        while (temp->next_)
+        {
+            if (temp->next_->object_ == object)
+            {
+                ObjectListElement* temp2 = temp->next_->next_;
+                delete temp->next_;
+                temp->next_ = temp2;
+
+                return;
+            }
+
+            temp = temp->next_;
+        }
+    }
+
+
+    // ###############################
+    // ###    ObjectListElement    ###
+    // ###############################
+    ObjectListElement::ObjectListElement(OrxonoxClass* object)
+    {
+        this->object_ = object;
+        this->next_ = 0;
+    }
+
+    ObjectListElement::~ObjectListElement()
+    {
+    }
+}
Index: code/branches/FICN/src/class_hierarchy/ObjectList.h
===================================================================
--- code/branches/FICN/src/class_hierarchy/ObjectList.h	(revision 337)
+++ code/branches/FICN/src/class_hierarchy/ObjectList.h	(revision 337)
@@ -0,0 +1,30 @@
+#ifndef _ObjectList_H__
+#define _ObjectList_H__
+
+namespace orxonox
+{
+    class OrxonoxClass;
+
+    class ObjectListElement
+    {
+        public:
+            ObjectListElement(OrxonoxClass* object);
+            ~ObjectListElement();
+
+            OrxonoxClass* object_;
+            ObjectListElement* next_;
+    };
+
+    class ObjectList
+    {
+        public:
+            ObjectList();
+            ~ObjectList();
+            void add(OrxonoxClass* object);
+            void remove(OrxonoxClass* object);
+
+            ObjectListElement* first_;
+    };
+}
+
+#endif
Index: code/branches/FICN/src/class_hierarchy/OrxonoxClass.cc
===================================================================
--- code/branches/FICN/src/class_hierarchy/OrxonoxClass.cc	(revision 337)
+++ code/branches/FICN/src/class_hierarchy/OrxonoxClass.cc	(revision 337)
@@ -0,0 +1,17 @@
+#include "ClassHierarchy.h"
+#include "OrxonoxClass.h"
+
+namespace orxonox
+{
+    OrxonoxClass::OrxonoxClass()
+    {
+        this->identifier_ = 0;
+        this->parents_ = 0;
+    }
+
+    OrxonoxClass::~OrxonoxClass()
+    {
+        if (this->parents_)
+            delete this->parents_;
+    }
+}
Index: code/branches/FICN/src/class_hierarchy/OrxonoxClass.h
===================================================================
--- code/branches/FICN/src/class_hierarchy/OrxonoxClass.h	(revision 337)
+++ code/branches/FICN/src/class_hierarchy/OrxonoxClass.h	(revision 337)
@@ -0,0 +1,25 @@
+#ifndef _OrxonoxClass_H__
+#define _OrxonoxClass_H__
+
+#include "IdentifierList.h"
+#include "Identifier.h"
+
+namespace orxonox
+{
+    class OrxonoxClass
+    {
+        public:
+            OrxonoxClass();
+            ~OrxonoxClass();
+            Identifier* getIdentifier() { return this->identifier_; }
+            void setIdentifier(Identifier* identifier) { this->identifier_ = identifier; }
+            IdentifierList* getParents() { return this->parents_; }
+            void setParents(IdentifierList* parents) { this->parents_ = parents; }
+
+        private:
+            Identifier* identifier_;
+            IdentifierList* parents_;
+    };
+}
+
+#endif
Index: code/branches/FICN/src/class_hierarchy/Test.h
===================================================================
--- code/branches/FICN/src/class_hierarchy/Test.h	(revision 337)
+++ code/branches/FICN/src/class_hierarchy/Test.h	(revision 337)
@@ -0,0 +1,129 @@
+#ifndef _Test_H__
+#define _Test_H__
+
+#include "IdentifierIncludes.h"
+
+namespace orxonox
+{
+    class Interface1 : virtual public OrxonoxClass
+    {
+        public:
+            Interface1() { registerRootObject(Interface1); }
+    };
+
+    class Interface2 : virtual public OrxonoxClass
+    {
+        public:
+            Interface2() { registerRootObject(Interface2); }
+    };
+
+    class A1 : public BaseObject
+    {
+        public:
+            A1() { registerObject(A1); }
+    };
+
+    class A2 : public BaseObject
+    {
+        public:
+            A2() { registerObject(A2); }
+    };
+
+    class A3: public BaseObject, public Interface1
+    {
+        public:
+            A3() { registerObject(A3); }
+    };
+
+    class A1B1 : public A1
+    {
+        public:
+            A1B1() { registerObject(A1B1); }
+    };
+
+    class A1B2 : public A1
+    {
+        public:
+            A1B2() { registerObject(A1B2); }
+    };
+
+    class A2B1 : public A2
+    {
+        public:
+            A2B1() { registerObject(A2B1); }
+    };
+
+    class A2B2 : public A2, Interface1
+    {
+        public:
+            A2B2() { registerObject(A2B2); }
+    };
+
+    class A3B1 : public A3
+    {
+        public:
+            A3B1() { registerObject(A3B1); }
+    };
+
+    class A3B2 : public A3, Interface2
+    {
+        public:
+            A3B2() { registerObject(A3B2); }
+    };
+
+    class A1B1C1 : public A1B1
+    {
+        public:
+            A1B1C1() { registerObject(A1B1C1); }
+    };
+
+    class A1B1C2 : public A1B1
+    {
+        public:
+            A1B1C2() { registerObject(A1B1C2); }
+    };
+
+    class A1B2C1 : public A1B2
+    {
+        public:
+            A1B2C1() { registerObject(A1B2C1); }
+    };
+
+    class A2B1C1 : public A2B1, Interface2
+    {
+        public:
+            A2B1C1() { registerObject(A2B1C1); }
+    };
+
+    class A2B2C1 : public A2B2
+    {
+        public:
+            A2B2C1() { registerObject(A2B2C1); }
+    };
+
+    class A3B1C1 : public A3B1
+    {
+        public:
+            A3B1C1() { registerObject(A3B1C1); }
+    };
+
+    class A3B1C2 : public A3B1, Interface2
+    {
+        public:
+            A3B1C2() { registerObject(A3B1C2); }
+    };
+
+    class A3B2C1 : public A3B2
+    {
+        public:
+            A3B2C1() { registerObject(A3B2C1); }
+    };
+
+    class A3B2C2 : public A3B2
+    {
+        public:
+            A3B2C2() { registerObject(A3B2C2); }
+    };
+}
+
+#endif
Index: code/branches/FICN/src/class_hierarchy/orxonox.cc
===================================================================
--- code/branches/FICN/src/class_hierarchy/orxonox.cc	(revision 337)
+++ code/branches/FICN/src/class_hierarchy/orxonox.cc	(revision 337)
@@ -0,0 +1,294 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Benjamin Knecht <beni_at_orxonox.net>, (C) 2007
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include <Ogre.h>
+#include <OIS/OIS.h>
+#include <CEGUI/CEGUI.h>
+#include <OgreCEGUIRenderer.h>
+
+#include "BaseObject.h"
+#include "Test.h"
+#include "test1.h"
+#include "test2.h"
+#include "test3.h"
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+#include <CoreFoundation/CoreFoundation.h>
+
+// This function will locate the path to our application on OS X,
+// unlike windows you can not rely on the curent working directory
+// for locating your configuration files and resources.
+std::string macBundlePath()
+{
+  char path[1024];
+  CFBundleRef mainBundle = CFBundleGetMainBundle();
+  assert(mainBundle);
+
+  CFURLRef mainBundleURL = CFBundleCopyBundleURL(mainBundle);
+  assert(mainBundleURL);
+
+  CFStringRef cfStringRef = CFURLCopyFileSystemPath( mainBundleURL, kCFURLPOSIXPathStyle);
+  assert(cfStringRef);
+
+  CFStringGetCString(cfStringRef, path, 1024, kCFStringEncodingASCII);
+
+  CFRelease(mainBundleURL);
+  CFRelease(cfStringRef);
+
+  return std::string(path);
+}
+#endif
+
+namespace orxonox
+{
+  class OrxExitListener : public Ogre::FrameListener
+  {
+    public:
+      OrxExitListener(OIS::Keyboard *keyboard)
+    : mKeyboard(keyboard)
+      {
+      }
+
+      bool frameStarted(const Ogre::FrameEvent& evt)
+      {
+        mKeyboard->capture();
+        return !mKeyboard->isKeyDown(OIS::KC_ESCAPE);
+      }
+
+    private:
+      OIS::Keyboard *mKeyboard;
+  };
+
+  class OrxApplication
+  {
+    public:
+      void go()
+      {
+
+        #define testandcout(code) \
+          std::cout << #code << " " << code << "\n"
+
+
+        std::cout << "Test 8\n";
+
+        std::cout << "1\n";
+        Test1* test8_01 = new Test1;
+        Test3* test8_03 = new Test3;
+        test8_03->usefullClassesIsATest(test8_01);
+
+        std::cout << "2\n";
+        Test2* test8_02 = new Test2;
+        test8_03->usefullClassesIsATest(test8_02);
+
+        std::cout << "3\n";
+        test8_01->setUsefullClass1(Class(Test1));
+        test8_01->setUsefullClass1(test8_02->getIdentifier());
+        test8_01->setUsefullClass2(Class(Test2));
+        test8_01->setUsefullClassOfTypeTest3(Class(Test3));
+        test8_01->setUsefullClassOfTypeTest3(test8_03->getIdentifier());
+
+
+        testandcout(test8_01->isA(Class(Test1)));
+        testandcout(test8_01->isA(Class(Test2)));
+        testandcout(test8_01->isA(Class(Test3)));
+
+        Test2* test8_04 = new Test2;
+        testandcout(test8_02->isA(Class(Test1)));
+        testandcout(test8_02->isA(Class(Test2)));
+        testandcout(test8_02->isA(Class(Test3)));
+
+        Test3* test8_05 = new Test3;
+        testandcout(test8_03->isA(Class(Test1)));
+        testandcout(test8_03->isA(Class(Test2)));
+        testandcout(test8_03->isA(Class(Test3)));
+
+        delete test8_01;
+        delete test8_02;
+        delete test8_03;
+
+
+      }
+
+      ~OrxApplication()
+      {
+        mInputManager->destroyInputObject(mKeyboard);
+        OIS::InputManager::destroyInputSystem(mInputManager);
+
+        delete mRenderer;
+        delete mSystem;
+
+        delete mListener;
+        delete mRoot;
+      }
+
+    private:
+      Ogre::Root *mRoot;
+      OIS::Keyboard *mKeyboard;
+      OIS::Mouse *mMouse;
+      OIS::InputManager *mInputManager;
+      CEGUI::OgreCEGUIRenderer *mRenderer;
+      CEGUI::System *mSystem;
+      OrxExitListener *mListener;
+
+      void createRoot()
+      {
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+        mRoot = new Ogre::Root(macBundlePath() + "/Contents/Resources/plugins.cfg");
+#else
+        mRoot = new Ogre::Root();
+#endif
+      }
+
+      void defineResources()
+      {
+        Ogre::String secName, typeName, archName;
+        Ogre::ConfigFile cf;
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+        cf.load(macBundlePath() + "/Contents/Resources/resources.cfg");
+#else
+        cf.load("resources.cfg");
+#endif
+
+        Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator();
+        while (seci.hasMoreElements())
+        {
+          secName = seci.peekNextKey();
+          Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext();
+          Ogre::ConfigFile::SettingsMultiMap::iterator i;
+          for (i = settings->begin(); i != settings->end(); ++i)
+          {
+            typeName = i->first;
+            archName = i->second;
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+            Ogre::ResourceGroupManager::getSingleton().addResourceLocation( String(macBundlePath() + "/" + archName), typeName, secName);
+#else
+            Ogre::ResourceGroupManager::getSingleton().addResourceLocation( archName, typeName, secName);
+#endif
+          }
+        }
+      }
+
+      void setupRenderSystem()
+      {
+        if (!mRoot->restoreConfig() && !mRoot->showConfigDialog())
+          throw Ogre::Exception(52, "User canceled the config dialog!", "OrxApplication::setupRenderSystem()");
+      }
+
+      void createRenderWindow()
+      {
+        mRoot->initialise(true, "Ogre Render Window");
+      }
+
+      void initializeResourceGroups()
+      {
+        Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);
+        Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
+      }
+
+      void setupScene()
+      {
+        Ogre::SceneManager *mgr = mRoot->createSceneManager(Ogre::ST_GENERIC, "Default SceneManager");
+        Ogre::Camera *cam = mgr->createCamera("Camera");
+        Ogre::Viewport *vp = mRoot->getAutoCreatedWindow()->addViewport(cam);
+      }
+
+      void setupInputSystem()
+      {
+        size_t windowHnd = 0;
+        std::ostringstream windowHndStr;
+        OIS::ParamList pl;
+        Ogre::RenderWindow *win = mRoot->getAutoCreatedWindow();
+
+        win->getCustomAttribute("WINDOW", &windowHnd);
+        windowHndStr << windowHnd;
+        pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
+        mInputManager = OIS::InputManager::createInputSystem(pl);
+
+        try
+        {
+          mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject(OIS::OISKeyboard, false));
+          mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject(OIS::OISMouse, false));
+        }
+        catch (const OIS::Exception &e)
+        {
+          throw new Ogre::Exception(42, e.eText, "OrxApplication::setupInputSystem");
+        }
+      }
+
+      void setupCEGUI()
+      {
+        Ogre::SceneManager *mgr = mRoot->getSceneManager("Default SceneManager");
+        Ogre::RenderWindow *win = mRoot->getAutoCreatedWindow();
+
+        // CEGUI setup
+        mRenderer = new CEGUI::OgreCEGUIRenderer(win, Ogre::RENDER_QUEUE_OVERLAY, false, 3000, mgr);
+        mSystem = new CEGUI::System(mRenderer);
+
+        // Other CEGUI setup here.
+      }
+
+      void createFrameListener()
+      {
+        mListener = new OrxExitListener(mKeyboard);
+        mRoot->addFrameListener(mListener);
+      }
+
+      void startRenderLoop()
+      {
+        mRoot->startRendering();
+      }
+  };
+}
+
+using namespace Ogre;
+
+#if OGRE_PLATFORM == PLATFORM_WIN32 || OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+
+             INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT)
+#else
+             int main(int argc, char **argv)
+#endif
+{
+  try
+  {
+    orxonox::OrxApplication orxonox;
+    orxonox.go();
+  }
+  catch(Exception& e)
+  {
+#if OGRE_PLATFORM == PLATFORM_WIN32 || OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+    MessageBoxA(NULL, e.getFullDescription().c_str(), "An exception has occurred!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
+#else
+    fprintf(stderr, "An exception has occurred: %s\n",
+            e.getFullDescription().c_str());
+#endif
+  }
+
+  return 0;
+}
Index: code/branches/FICN/src/class_hierarchy/test1.cc
===================================================================
--- code/branches/FICN/src/class_hierarchy/test1.cc	(revision 337)
+++ code/branches/FICN/src/class_hierarchy/test1.cc	(revision 337)
@@ -0,0 +1,61 @@
+#include "test1.h"
+#include "test2.h"
+#include "test3.h"
+
+namespace orxonox
+{
+    Test1::Test1()
+    {
+        registerObject(Test1);
+
+        this->usefullClass1_ = Class(Test1);
+        this->usefullClass2_ = Class(Test2);
+        this->usefullClass3_ = Class(Test3);
+    }
+
+    Test1::~Test1()
+    {
+    }
+
+    bool Test1::usefullClass1isA(Identifier* identifier)
+    {
+        return this->usefullClass1_->isA(identifier);
+    }
+
+    bool Test1::usefullClass2isA(Identifier* identifier)
+    {
+        return this->usefullClass2_->isA(identifier);
+    }
+
+    bool Test1::usefullClass3isA(Identifier* identifier)
+    {
+        return this->usefullClass3_.isA(identifier);
+    }
+
+    void Test1::setUsefullClass1(Identifier* identifier)
+    {
+        std::cout << "\n";
+        std::cout << "Test1: usefullClass1->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n";
+        std::cout << "Test1: usefullClass1->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n";
+        std::cout << "Test1: usefullClass1->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << "\n";
+        this->usefullClass1_ = identifier;
+    }
+
+    void Test1::setUsefullClass2(Identifier* identifier)
+    {
+        std::cout << "\n";
+        std::cout << "Test1: usefullClass2->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n";
+        std::cout << "Test1: usefullClass2->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n";
+        std::cout << "Test1: usefullClass2->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << "\n";
+        this->usefullClass2_ = identifier;
+    }
+
+    void Test1::setUsefullClassOfTypeTest3(Identifier* identifier)
+    {
+        std::cout << "\n";
+        std::cout << "Test1: usefullClass3->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n";
+        std::cout << "Test1: usefullClass3->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n";
+        std::cout << "Test1: usefullClass3->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << "\n";
+        this->usefullClass3_ = identifier;
+    }
+}
Index: code/branches/FICN/src/class_hierarchy/test1.h
===================================================================
--- code/branches/FICN/src/class_hierarchy/test1.h	(revision 337)
+++ code/branches/FICN/src/class_hierarchy/test1.h	(revision 337)
@@ -0,0 +1,30 @@
+#ifndef _Test1_H__
+#define _Test1_H__
+
+#include "BaseObject.h"
+#include "test3.h"
+
+namespace orxonox
+{
+    class Test1 : public BaseObject
+    {
+        public:
+            Test1();
+            virtual ~Test1();
+
+            bool usefullClass1isA(Identifier* identifier);
+            bool usefullClass2isA(Identifier* identifier);
+            bool usefullClass3isA(Identifier* identifier);
+            void setUsefullClass1(Identifier* identifier);
+            void setUsefullClass2(Identifier* identifier);
+            void setUsefullClassOfTypeTest3(Identifier* identifier);
+
+        private:
+            Identifier* usefullClass1_;
+            Identifier* usefullClass2_;
+            BaseIdentifier<Test3> usefullClass3_;
+
+    };
+}
+
+#endif
Index: code/branches/FICN/src/class_hierarchy/test2.cc
===================================================================
--- code/branches/FICN/src/class_hierarchy/test2.cc	(revision 337)
+++ code/branches/FICN/src/class_hierarchy/test2.cc	(revision 337)
@@ -0,0 +1,61 @@
+#include "test1.h"
+#include "test2.h"
+#include "test3.h"
+
+namespace orxonox
+{
+    Test2::Test2()
+    {
+        registerObject(Test2);
+
+        this->usefullClass1_ = Class(Test1);
+        this->usefullClass2_ = Class(Test2);
+        this->usefullClass3_ = Class(Test3);
+    }
+
+    Test2::~Test2()
+    {
+    }
+
+    bool Test2::usefullClass1isA(Identifier* identifier)
+    {
+        return this->usefullClass1_->isA(identifier);
+    }
+
+    bool Test2::usefullClass2isA(Identifier* identifier)
+    {
+        return this->usefullClass2_->isA(identifier);
+    }
+
+    bool Test2::usefullClass3isA(Identifier* identifier)
+    {
+        return this->usefullClass3_.isA(identifier);
+    }
+
+    void Test2::setUsefullClass1(Identifier* identifier)
+    {
+        std::cout << "\n";
+        std::cout << "Test2: usefullClass1->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n";
+        std::cout << "Test2: usefullClass1->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n";
+        std::cout << "Test2: usefullClass1->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << "\n";
+        this->usefullClass1_ = identifier;
+    }
+
+    void Test2::setUsefullClass2(Identifier* identifier)
+    {
+        std::cout << "\n";
+        std::cout << "Test2: usefullClass2->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n";
+        std::cout << "Test2: usefullClass2->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n";
+        std::cout << "Test2: usefullClass2->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << "\n";
+        this->usefullClass2_ = identifier;
+    }
+
+    void Test2::setUsefullClassOfTypeTest3(Identifier* identifier)
+    {
+        std::cout << "\n";
+        std::cout << "Test2: usefullClass3->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n";
+        std::cout << "Test2: usefullClass3->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n";
+        std::cout << "Test2: usefullClass3->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << "\n";
+        this->usefullClass3_ = identifier;
+    }
+}
Index: code/branches/FICN/src/class_hierarchy/test2.h
===================================================================
--- code/branches/FICN/src/class_hierarchy/test2.h	(revision 337)
+++ code/branches/FICN/src/class_hierarchy/test2.h	(revision 337)
@@ -0,0 +1,31 @@
+#ifndef _Test2_H__
+#define _Test2_H__
+
+#include "BaseObject.h"
+
+namespace orxonox
+{
+    class Test3;
+
+    class Test2 : public BaseObject
+    {
+        public:
+            Test2();
+            virtual ~Test2();
+
+            bool usefullClass1isA(Identifier* identifier);
+            bool usefullClass2isA(Identifier* identifier);
+            bool usefullClass3isA(Identifier* identifier);
+            void setUsefullClass1(Identifier* identifier);
+            void setUsefullClass2(Identifier* identifier);
+            void setUsefullClassOfTypeTest3(Identifier* identifier);
+
+        private:
+            Identifier* usefullClass1_;
+            Identifier* usefullClass2_;
+            BaseIdentifier<Test3> usefullClass3_;
+
+    };
+}
+
+#endif
Index: code/branches/FICN/src/class_hierarchy/test3.cc
===================================================================
--- code/branches/FICN/src/class_hierarchy/test3.cc	(revision 337)
+++ code/branches/FICN/src/class_hierarchy/test3.cc	(revision 337)
@@ -0,0 +1,53 @@
+#include "test1.h"
+#include "test2.h"
+#include "test3.h"
+
+namespace orxonox
+{
+    Test3::Test3()
+    {
+        registerObject(Test3);
+    }
+
+    Test3::~Test3()
+    {
+    }
+        #define testandcout(code) \
+          std::cout << #code << " " << code << "\n"
+
+    bool Test3::usefullClassesIsATest(Test1* test1)
+    {
+        std::cout << "\n";
+        std::cout << "Test1:\n";
+        testandcout(test1->usefullClass1isA(Class(Test1)));
+        testandcout(test1->usefullClass1isA(Class(Test2)));
+        testandcout(test1->usefullClass1isA(Class(Test3)));
+        std::cout << "\n";
+        testandcout(test1->usefullClass2isA(Class(Test1)));
+        testandcout(test1->usefullClass2isA(Class(Test2)));
+        testandcout(test1->usefullClass2isA(Class(Test3)));
+        std::cout << "\n";
+        testandcout(test1->usefullClass3isA(Class(Test1)));
+        testandcout(test1->usefullClass3isA(Class(Test2)));
+        testandcout(test1->usefullClass3isA(Class(Test3)));
+        return true;
+    }
+
+    bool Test3::usefullClassesIsATest(Test2* test2)
+    {
+        std::cout << "\n";
+        std::cout << "Test2:\n";
+        testandcout(test2->usefullClass1isA(Class(Test1)));
+        testandcout(test2->usefullClass1isA(Class(Test2)));
+        testandcout(test2->usefullClass1isA(Class(Test3)));
+        std::cout << "\n";
+        testandcout(test2->usefullClass2isA(Class(Test1)));
+        testandcout(test2->usefullClass2isA(Class(Test2)));
+        testandcout(test2->usefullClass2isA(Class(Test3)));
+        std::cout << "\n";
+        testandcout(test2->usefullClass3isA(Class(Test1)));
+        testandcout(test2->usefullClass3isA(Class(Test2)));
+        testandcout(test2->usefullClass3isA(Class(Test3)));
+        return true;
+    }
+}
Index: code/branches/FICN/src/class_hierarchy/test3.h
===================================================================
--- code/branches/FICN/src/class_hierarchy/test3.h	(revision 337)
+++ code/branches/FICN/src/class_hierarchy/test3.h	(revision 337)
@@ -0,0 +1,22 @@
+#ifndef _Test3_H__
+#define _Test3_H__
+
+#include "BaseObject.h"
+
+namespace orxonox
+{
+    class Test1;
+    class Test2;
+
+    class Test3 : public BaseObject
+    {
+        public:
+            Test3();
+            virtual ~Test3();
+
+            bool usefullClassesIsATest(Test1* test1);
+            bool usefullClassesIsATest(Test2* test2);
+    };
+}
+
+#endif
Index: code/branches/FICN/src/inertial_node.cc
===================================================================
--- code/branches/FICN/src/inertial_node.cc	(revision 337)
+++ code/branches/FICN/src/inertial_node.cc	(revision 337)
@@ -0,0 +1,126 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OgreSceneNode.h"
+#include "OgreVector3.h"
+
+#include "inertial_node.h"
+
+
+namespace orxonox {
+  using namespace Ogre;
+
+  InertialNode::InertialNode(SceneNode *node, Vector3 speed)
+        : node_(node), speed_(speed), childListSize_(4), childListIndex_(0),
+        parentNode_(NULL)
+  {
+    childList_ = new InertialNode*[childListSize_];
+  }
+
+
+  InertialNode::InertialNode(orxonox::InertialNode *parentNode, Vector3 speed)
+        : parentNode_(parentNode), childListSize_(4), childListIndex_(0), speed_(speed)
+  {
+    childList_ = new InertialNode*[childListSize_];
+    node_ = parentNode_->getSceneNode()->createChildSceneNode();
+  }
+
+
+  InertialNode::~InertialNode()
+  {
+    if (childList_)
+    {
+      for (int i = 0; i < childListIndex_; i++)
+        if (childList_[i])
+          delete childList_[i];
+      delete childList_;
+    }
+  }
+
+
+  InertialNode* InertialNode::createChildNode()
+  {
+    InertialNode *temp = new InertialNode(this);
+    addChild(temp);
+    return temp;
+  }
+
+
+  InertialNode* InertialNode::getParentNode()
+  {
+    return parentNode_;
+  }
+
+
+  SceneNode* InertialNode::getSceneNode()
+  {
+    return node_;
+  }
+
+
+  Vector3 InertialNode::getSpeed()
+  {
+    return speed_;
+  }
+
+
+  Vector3 InertialNode::getWorldSpeed()
+  {
+    // go through the tree of Inertial nodes
+    Vector3 speed = speed_;
+    InertialNode *temp = parentNode_;
+    while (temp != NULL)
+    {
+      speed = temp->getSceneNode()->getOrientation() * speed + temp->getSpeed();
+      temp = temp->getParentNode();
+    }
+    return speed;
+  }
+
+
+  void InertialNode::addSpeed(Vector3 speed)
+  {
+    speed_ += speed;
+  }
+
+
+  void InertialNode::addChild(orxonox::InertialNode *node)
+  {
+    if (childListIndex_ == childListSize_)
+    {
+      // redimension the array
+      InertialNode **tempArray = new InertialNode*[2*childListSize_];
+      for (int i = 0; i < childListSize_; i++)
+        tempArray[i] = childList_[i];
+      childListSize_ *= 2;
+      delete childList_;
+      childList_ = tempArray;
+    }
+    childList_[childListIndex_++] = node;
+  }
+
+}
Index: code/branches/FICN/src/inertial_node.h
===================================================================
--- code/branches/FICN/src/inertial_node.h	(revision 337)
+++ code/branches/FICN/src/inertial_node.h	(revision 337)
@@ -0,0 +1,77 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef INERTIAL_NODE_H
+#define INERTIAL_NODE_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+
+  class InertialNode
+  {
+  public:
+    InertialNode(Ogre::SceneNode*, Ogre::Vector3);
+	  ~InertialNode();
+
+    InertialNode* createChildNode();
+
+    InertialNode* getParentNode();
+
+    Ogre::SceneNode* getSceneNode();
+
+    Ogre::Vector3 getSpeed();
+
+    Ogre::Vector3 getWorldSpeed();
+
+    void addSpeed(Ogre::Vector3);
+
+  protected:
+    InertialNode(InertialNode*, Ogre::Vector3 speed = Ogre::Vector3::ZERO);
+    void addChild(InertialNode*);
+
+  public:
+
+  protected:
+    InertialNode **childList_;
+    int childListSize_;
+    int childListIndex_;
+
+    Ogre::SceneNode *node_;
+	  Ogre::Vector3 speed_;
+
+    InertialNode* parentNode_;
+
+  };
+
+}
+
+#endif /* INERTIAL_NODE_H */
Index: code/branches/FICN/src/loader/CMakeLists.txt
===================================================================
--- code/branches/FICN/src/loader/CMakeLists.txt	(revision 337)
+++ code/branches/FICN/src/loader/CMakeLists.txt	(revision 337)
@@ -0,0 +1,9 @@
+PROJECT(Orxonox)
+
+# TODO find a cleaner way to include xmlParser
+SET(SRC_FILES LevelLoader.cc ../xml/xmlParser.cc)
+# SET(INC_FILES LevelLoader.h ../xml/xmlParser.h)
+
+INCLUDE_DIRECTORIES(..)
+
+ADD_LIBRARY(loader ${SRC_FILES} ${INC_FILES})
Index: code/branches/FICN/src/network/CMakeLists.txt
===================================================================
--- code/branches/FICN/src/network/CMakeLists.txt	(revision 337)
+++ code/branches/FICN/src/network/CMakeLists.txt	(revision 337)
@@ -0,0 +1,7 @@
+PROJECT(Orxonox)
+
+SET(SRC_FILES Client.cc ConnectionManager.cc PacketBuffer.cc PacketGenerator.cc Synchronisable.cc ClientConnection.cc GameStateManager.cc PacketDecoder.cc Server.cc)
+
+INCLUDE_DIRECTORIES(..)
+
+ADD_LIBRARY(network ${SRC_FILES} ${ENet_LIBRARY})
Index: code/branches/FICN/src/network/Client.cc
===================================================================
--- code/branches/FICN/src/network/Client.cc	(revision 337)
+++ code/branches/FICN/src/network/Client.cc	(revision 337)
@@ -0,0 +1,142 @@
+//
+// C++ Implementation: Client
+//
+// Description:
+//
+//
+// Author:  Oliver Scheuss, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+#include "Client.h"
+
+namespace network{
+
+  /**
+   * Constructor for the Client class
+   * initializes the address and the port to default localhost:NETWORK_PORT
+   */
+  Client::Client(): client_connection(NETWORK_PORT,"127.0.0.1"){
+    // set server address to localhost
+    //server_address="127.0.0.1";
+    //port = NETWORK_PORT;
+    isConnected=false;
+  }
+
+  /**
+   * Constructor for the Client class
+   * @param address the server address
+   * @param port port of the application on the server
+   */
+  Client::Client(std::string address, int port) : client_connection(port, address){
+    //server_address=address.c_str();
+    //this->port = port;
+    isConnected=false;
+  }
+
+  /**
+   * Constructor for the Client class
+   * @param address the server address
+   * @param port port of the application on the server
+   */
+  Client::Client(const char *address, int port) : client_connection(port, address){
+    //server_address = address;
+    //this->port = port;
+    isConnected=false;
+  }
+
+  /**
+   * Establish the Connection to the Server
+   * @return true/false
+   */
+  bool Client::establishConnection(){
+    isConnected=client_connection.createConnection();
+    return isConnected;
+  }
+
+  /**
+   * closes the Connection to the Server
+   * @return true/false
+   */
+  bool Client::closeConnection(){
+    isConnected=false;
+    return client_connection.closeConnection();
+  }
+
+  /**
+   * submits a MouseAction to the server
+   * @param x x Coordinate
+   * @param y y Coordinate
+   * @return true/false
+   */
+  bool Client::sendMouse(double x, double y){
+    ENetEvent event;
+    // generate packet and add it to the queue
+    if(!client_connection.addPacket(pck_gen.mousem(x, y)))
+        return false;
+    // send packets
+    client_connection.sendPackets(&event);
+    if(event.type==ENET_EVENT_TYPE_NONE)
+      return true;
+    else
+      return false;
+  }
+
+  /**
+   * submits a Keystrike to the server
+   * @param key_code code to submit
+   * @return true/false
+   */
+  bool Client::sendKeyboard(char key_code){
+    ENetEvent event;
+    // generate packet and add it to queue
+    if(!client_connection.addPacket(pck_gen.keystrike(key_code)))
+        return false;
+    // send packets
+    client_connection.sendPackets(&event);
+    if(event.type==ENET_EVENT_TYPE_NONE)
+      return true;
+    else
+      return false;
+  }
+
+  /**
+   * Adds a MouseAction to the PacketQueue
+   * @param x x Coordinate
+   * @param y y Coordinate
+   * @return true/false
+   */
+  bool Client::addMouse(double x, double y){
+    // generate packet and add it to the queue
+    if(client_connection.addPacket(pck_gen.mousem(x, y)))
+      return true;
+    else
+      return false;
+  }
+
+  /**
+   * Adds a Keystrike to the PacketQueue
+   * @param key_code
+   * @return true/false
+   */
+  bool Client::addKeyboard(char key_code){
+    ENetEvent event;
+    // generate packet and add it to queue
+    if(client_connection.addPacket(pck_gen.keystrike(key_code)))
+      return true;
+    else
+      return false;
+  }
+
+  /**
+   * Performs a GameState update
+   */
+  void Client::update(){
+    // to be implemented ==================
+
+
+  }
+
+}
Index: code/branches/FICN/src/network/Client.h
===================================================================
--- code/branches/FICN/src/network/Client.h	(revision 337)
+++ code/branches/FICN/src/network/Client.h	(revision 337)
@@ -0,0 +1,58 @@
+//
+// C++ Interface: Client
+//
+// Description:
+//
+//
+// Author:  Oliver Scheuss, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+#ifndef NETWORK_CLIENT_H
+#define NETWORK_CLIENT_H
+
+#include <string>
+
+#include "ClientConnection.h"
+#include "PacketManager.h"
+
+
+namespace network{
+
+/**
+ * The network/Client class
+ * This class implements all necessary function for the network communication
+ * It is the root class of the network module
+ *
+ */
+class Client : PacketDecoder{
+  public:
+  Client();
+  Client(std::string address, int port);
+  Client(const char *address, int port);
+
+  bool establishConnection();
+  bool closeConnection();
+
+  bool sendMouse(double x, double y);
+  bool sendKeyboard(char key_code);
+
+  bool addMouse(double x, double y);
+  bool addKeyboard(char key_code);
+
+  void update();
+
+  private:
+  ClientConnection client_connection;
+  PacketGenerator pck_gen;
+
+  //const char *server_address;
+  //int port;
+  bool isConnected;
+};
+
+}
+
+#endif
Index: code/branches/FICN/src/network/ClientConnection.cc
===================================================================
--- code/branches/FICN/src/network/ClientConnection.cc	(revision 337)
+++ code/branches/FICN/src/network/ClientConnection.cc	(revision 337)
@@ -0,0 +1,172 @@
+//
+// C++ Interface: ClientConnection
+//
+// Description: The Class ClientConnection manages the servers conenctions to the clients.
+// each connection is provided by a new process. communication between master process and
+// connection processes is provided by ...
+//
+//
+// Author:  Oliver Scheuss
+//
+
+#include "ClientConnection.h"
+
+namespace network{
+
+  boost::thread_group network_threads;
+
+  ClientConnection::ClientConnection(int port, std::string address){
+    quit=false;
+    server=NULL;
+    enet_address_set_host(&serverAddress, address.c_str());
+    serverAddress.port = NETWORK_PORT;
+    established=false;
+  }
+
+  ClientConnection::ClientConnection(int port, const char *address){
+    quit=false;
+    server=NULL;
+    enet_address_set_host(&serverAddress, address);
+    serverAddress.port = NETWORK_PORT;
+    established=false;
+  }
+
+  bool ClientConnection::waitEstablished(int milisec){
+    for(int i=0; i<=milisec && !established; i++)
+      usleep(1000);
+    return established;
+  }
+
+
+  ENetPacket *ClientConnection::getPacket(ENetAddress &address){
+    if(!buffer.isEmpty())
+      return buffer.pop(address);
+    else
+        return NULL;
+  }
+
+  bool ClientConnection::queueEmpty(){
+    return buffer.isEmpty();
+  }
+
+  bool ClientConnection::createConnection(){
+    network_threads.create_thread(boost::bind(boost::mem_fn(&ClientConnection::receiverThread), this));
+    // wait 10 seconds for the connection to be established
+    return waitEstablished(10000);
+  }
+
+  bool ClientConnection::closeConnection(){
+    quit=true;
+    network_threads.join_all();
+    established=false;
+    return true;
+  }
+
+
+  bool ClientConnection::addPacket(ENetPacket *packet){
+    if(server==NULL)
+      return false;
+    if(enet_peer_send(server, 1, packet)!=0)
+      return false;
+    else
+      return true;
+  }
+
+  bool ClientConnection::sendPackets(ENetEvent *event){
+    if(server==NULL)
+      return false;
+    if(enet_host_service(client, event, NETWORK_SEND_WAIT)>=0)
+      return true;
+    else
+      return false;
+  }
+
+  bool ClientConnection::sendPackets(){
+    ENetEvent event;
+    if(server==NULL)
+      return false;
+    if(enet_host_service(client, &event, NETWORK_SEND_WAIT)>=0)
+      return true;
+    else
+      return false;
+  }
+
+  void ClientConnection::receiverThread(){
+    // what about some error-handling here ?
+    enet_initialize();
+    atexit(enet_deinitialize);
+    ENetEvent event;
+    client = enet_host_create(NULL, NETWORK_CLIENT_MAX_CONNECTIONS, 0, 0);
+    if(client==NULL)
+      // add some error handling here ==========================
+      quit=true;
+    //connect to the server
+    if(!establishConnection())
+      quit=true;
+    //main loop
+    while(!quit){
+      if(enet_host_service(client, &event, NETWORK_WAIT_TIMEOUT)<0){
+        // we should never reach this point
+        quit=true;
+        // add some error handling here ========================
+      }
+      switch(event.type){
+        // log handling ================
+      case ENET_EVENT_TYPE_RECEIVE:
+        processData(&event);
+        break;
+      case ENET_EVENT_TYPE_DISCONNECT:
+        // add some error/log handling here
+        // extend =====================
+        break;
+      }
+    }
+    // now disconnect
+
+    if(!disconnectConnection())
+    // if disconnecting failed destroy conn.
+      enet_peer_reset(server);
+    return;
+  }
+
+  bool ClientConnection::disconnectConnection(){
+    ENetEvent event;
+//     enet_peer_disconnect(server);
+    enet_peer_disconnect(server, 0);
+    while(enet_host_service(client, &event, NETWORK_WAIT_TIMEOUT) > 0){
+      switch (event.type)
+      {
+        case ENET_EVENT_TYPE_RECEIVE:
+          enet_packet_destroy(event.packet);
+          break;
+        case ENET_EVENT_TYPE_DISCONNECT:
+          return true;
+      }
+    }
+    enet_peer_reset(server);
+  }
+
+  bool ClientConnection::establishConnection(){
+    ENetEvent event;
+    // connect to peer
+    server = enet_host_connect(client, &serverAddress, NETWORK_CLIENT_CHANNELS);
+    if(server==NULL)
+      // error handling
+      return false;
+    // handshake
+    if(enet_host_service(client, &event, NETWORK_WAIT_TIMEOUT)>0 && event.type == ENET_EVENT_TYPE_CONNECT){
+      established=true;
+      return true;
+    }
+    else
+      return false;
+  }
+
+  bool ClientConnection::processData(ENetEvent *event){
+    // just add packet to the buffer
+    // this can be extended with some preprocessing
+    return buffer.push(event);
+  }
+
+
+}
Index: code/branches/FICN/src/network/ClientConnection.h
===================================================================
--- code/branches/FICN/src/network/ClientConnection.h	(revision 337)
+++ code/branches/FICN/src/network/ClientConnection.h	(revision 337)
@@ -0,0 +1,79 @@
+//
+// C++ Interface: ClientConnection
+//
+// Description:
+//
+//
+// Author:  Oliver Scheuss, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef NETWORK_CLIENTCONNECTION_H
+#define NETWORK_CLIENTCONNECTION_H
+
+#include <iostream>
+#include <string>
+// enet library for networking support
+#include <enet/enet.h>
+// boost.thread library for multithreading support
+#include <boost/thread/thread.hpp>
+#include <boost/bind.hpp>
+// headerfile
+#include "ClientConnection.h"
+#include "PacketBuffer.h"
+
+namespace network{
+  //
+#define NETWORK_PORT 55556
+#define NETWORK_CLIENT_MAX_CONNECTIONS 5
+#define NETWORK_WAIT_TIMEOUT 5000
+#define NETWORK_SEND_WAIT 5
+#define NETWORK_CLIENT_CHANNELS 2
+
+
+  class ClientConnection{
+    public:
+    ClientConnection(int port, std::string address);
+    ClientConnection(int port, const char* address);
+    ENetPacket *getPacket(ENetAddress &address); // thread1
+    // check wheter the packet queue is empty
+    bool queueEmpty();
+    // create a new listener thread
+    bool createConnection();
+    bool closeConnection();
+    // add a packet to queue for the server
+    bool addPacket(ENetPacket *packet);
+    // send out all queued packets
+    bool sendPackets();
+    // send out all queued packets and save result in event
+    bool sendPackets(ENetEvent *event);
+    bool waitEstablished(int milisec);
+    private:
+    bool processData(ENetEvent *event);
+    // implementation of the listener
+    void receiverThread(); //thread2
+    //packetbuffer
+    bool establishConnection();
+    bool disconnectConnection();
+    PacketBuffer buffer;
+    // enet stuff
+    ENetHost *client;
+    ENetAddress serverAddress;
+    // quit-variable (communication with threads)
+    bool quit;
+    bool established;
+    // clientlist
+    ENetPeer *server;
+  };
+
+
+
+
+
+
+
+
+}
+
+#endif
Index: code/branches/FICN/src/network/ConnectionManager.cc
===================================================================
--- code/branches/FICN/src/network/ConnectionManager.cc	(revision 337)
+++ code/branches/FICN/src/network/ConnectionManager.cc	(revision 337)
@@ -0,0 +1,206 @@
+//
+// C++ Interface: ConnectionManager
+//
+// Description: The Class ConnectionManager manages the servers conenctions to the clients.
+// each connection is provided by a new process. communication between master process and
+// connection processes is provided by ...
+//
+//
+// Author:  Oliver Scheuss
+//
+
+#include "ConnectionManager.h"
+
+namespace network{
+
+  boost::thread_group network_threads;
+
+  void test(){
+    return;
+  }
+
+  ConnectionManager::ConnectionManager(){
+    quit=false;
+    client=NULL;
+    bindAddress.host = ENET_HOST_ANY;
+    bindAddress.port = NETWORK_PORT;
+  }
+
+  ConnectionManager::ConnectionManager(int port, std::string address){
+    quit=false;
+    client=NULL;
+    enet_address_set_host (& bindAddress, address.c_str());
+    bindAddress.port = NETWORK_PORT;
+  }
+
+  ConnectionManager::ConnectionManager(int port, const char *address){
+    quit=false;
+    client=NULL;
+    enet_address_set_host (& bindAddress, address);
+    bindAddress.port = NETWORK_PORT;
+  }
+
+  ENetPacket *ConnectionManager::getPacket(ENetAddress &address){
+    if(!buffer.isEmpty())
+      return buffer.pop(address);
+    else
+        return NULL;
+  }
+
+  bool ConnectionManager::queueEmpty(){
+    return buffer.isEmpty();
+  }
+
+  void ConnectionManager::createListener(){
+    network_threads.create_thread(boost::bind(boost::mem_fn(&ConnectionManager::receiverThread), this));
+//     boost::thread thr(boost::bind(boost::mem_fn(&ConnectionManager::receiverThread), this));
+    return;
+  }
+
+  bool ConnectionManager::quitListener(){
+    quit=true;
+    network_threads.join_all();
+    return true;
+  }
+
+  bool ConnectionManager::addPacket(ENetPacket *packet, ENetPeer *peer){
+    if(client=NULL)
+      return false;
+    ClientList *temp=client;
+    while(peer->host != temp->event->peer->host){
+      temp=temp->next;
+      if(temp==NULL)
+        return false;
+    }
+    if(enet_peer_send(temp->event->peer, temp->ID, packet)!=0)
+      return false;
+    return true;
+  }
+
+  bool ConnectionManager::addPacket(ENetPacket *packet, int ID){
+    if(client==NULL)
+      return false;
+    ClientList *temp=client;
+    while(ID != temp->ID){
+      temp=temp->next;
+      if(temp==NULL)
+        return false;
+    }
+    if(enet_peer_send(temp->event->peer, temp->ID, packet)!=0)
+      return false;
+    else
+      return true;
+  }
+
+  bool ConnectionManager::addPacketAll(ENetPacket *packet){
+    ClientList *temp=client;
+    while(temp!=NULL){
+      if(enet_peer_send(temp->event->peer, temp->ID, packet)!=0)
+         return false;
+    }
+    return true;
+  }
+
+  bool ConnectionManager::sendPackets(ENetEvent *event){
+    if(server==NULL)
+      return false;
+    if(enet_host_service(server, event, NETWORK_SEND_WAIT)>=0)
+      return true;
+    else
+      return false;
+  }
+
+  void ConnectionManager::receiverThread(){
+    // what about some error-handling here ?
+    enet_initialize();
+    atexit(enet_deinitialize);
+    ENetEvent event;
+    server = enet_host_create(&bindAddress, NETWORK_MAX_CONNECTIONS, 0, 0);
+    if(server==NULL)
+      // add some error handling here ==========================
+      quit=true;
+
+    while(!quit){
+      if(enet_host_service(server, &event, NETWORK_WAIT_TIMEOUT)<0){
+        // we should never reach this point
+        quit=true;
+        // add some error handling here ========================
+      }
+      switch(event.type){
+        // log handling ================
+        case ENET_EVENT_TYPE_CONNECT:
+        addClient(&event);
+        break;
+      case ENET_EVENT_TYPE_RECEIVE:
+        processData(&event);
+        break;
+      case ENET_EVENT_TYPE_DISCONNECT:
+        // add some error/log handling here
+        clientDisconnect(event.peer);
+        break;
+      }
+    }
+    // if we're finishied, destroy server
+    enet_host_destroy(server);
+  }
+
+  bool ConnectionManager::processData(ENetEvent *event){
+    // just add packet to the buffer
+    // this can be extended with some preprocessing
+    return buffer.push(event);
+  }
+
+  bool ConnectionManager::clientDisconnect(ENetPeer *peer){
+    ClientList *temp=client;
+    // do we have to remove the first item ?
+    if(temp->event->peer->host==peer->host){
+      if(temp->next==NULL){
+        client=NULL;
+      } else{
+        client=temp->next;
+      }
+      delete temp;
+      return true;
+    } else {
+      while(temp->next!=NULL){
+        if(temp->next->event->peer->host==peer->host){
+          // do a correct relink and delete the disconnected client
+          ClientList *temp2=temp->next;
+          temp->next=temp2->next;
+          delete temp2;
+          return true;
+        } else
+          //otherwise keep on searching ;)
+          temp=temp->next;
+      }
+    }
+    return false;
+  }
+
+  bool ConnectionManager::addClient(ENetEvent *event){
+
+    // first client?
+    if(client==NULL){
+      client =new ClientList;
+      client->ID=1;
+      client->next=NULL;
+      client->event = event;
+    } else {
+      // otherwise add a new element to clientlist
+      ClientList *temp = client;
+      int i=1;
+      while(temp->next != NULL){
+        temp=temp->next;
+        i++;
+      }
+      temp->next=new ClientList;
+      temp=temp->next;
+      temp->ID=i+1;
+      temp->event=event;
+      temp->next=NULL;
+    }
+    return true;
+  }
+
+
+}
Index: code/branches/FICN/src/network/ConnectionManager.h
===================================================================
--- code/branches/FICN/src/network/ConnectionManager.h	(revision 337)
+++ code/branches/FICN/src/network/ConnectionManager.h	(revision 337)
@@ -0,0 +1,91 @@
+//
+// C++ Interface: ConnectionManager
+//
+// Description:
+//
+//
+// Author:  Oliver Scheuss, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef NETWORK_CONNECTIONMANAGER_H
+#define NETWORK_CONNECTIONMANAGER_H
+
+#include <iostream>
+#include <string>
+// enet library for networking support
+#include <enet/enet.h>
+// boost.thread library for multithreading support
+#include <boost/thread/thread.hpp>
+#include <boost/bind.hpp>
+// headerfile
+#include "ConnectionManager.h"
+#include "PacketBuffer.h"
+
+namespace network{
+  //
+#define NETWORK_PORT 55556
+#define NETWORK_MAX_CONNECTIONS 50
+#define NETWORK_WAIT_TIMEOUT 5000
+#define NETWORK_SEND_WAIT 5
+  //just some defines to make life easier ;)
+// #define ENetEvent std::ENetEvent
+// #define ENetHost std::ENetHost
+// #define ENetAddress std::ENetAddress
+// #define ENetPeer std::ENetPeer
+
+  struct ClientList{
+    ENetEvent *event;
+    int ID;
+    ClientList *next;
+  };
+
+  class ConnectionManager{
+    public:
+    ConnectionManager();
+    ConnectionManager(int port, const char *address);
+    ConnectionManager(int port, std::string address);
+    ENetPacket *getPacket(ENetAddress &address); // thread1
+    // check wheter the packet queue is empty
+    bool queueEmpty();
+    // create a new listener thread
+    void createListener();
+    bool quitListener();
+    // add a packet to queue for a specific client peer
+    bool addPacket(ENetPacket *packet, ENetPeer *peer);
+    // add ad packet to queue for a specific client ID
+    bool addPacket(ENetPacket *packet, int ID);
+    // add a packet to queue for all clients
+    bool addPacketAll(ENetPacket *packet);
+    // send out all queued packets
+    bool sendPackets(ENetEvent *event);
+    private:
+    bool clientDisconnect(ENetPeer *peer);
+    bool processData(ENetEvent *event);
+    bool addClient(ENetEvent *event);
+    // implementation of the listener
+    void receiverThread(); //thread2
+    //packetbuffer
+    PacketBuffer buffer;
+    // enet stuff
+    ENetHost *server;
+    ENetAddress bindAddress;
+    // quit-variable (communication with threads)
+    bool quit;
+    // clientlist
+    ClientList *client;
+//     thread group
+//     boost::thread_group threads;
+  };
+
+
+
+
+
+
+
+
+}
+
+#endif
Index: code/branches/FICN/src/network/GameStateManager.cc
===================================================================
--- code/branches/FICN/src/network/GameStateManager.cc	(revision 337)
+++ code/branches/FICN/src/network/GameStateManager.cc	(revision 337)
@@ -0,0 +1,127 @@
+//
+// C++ Implementation: GameStateManager
+//
+// Description: 
+//
+//
+// Author:  Oliver Scheuss, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "GameStateManager.h"
+
+namespace network {
+
+GameStateManager::GameStateManager()
+{
+}
+
+GameStateManager::~GameStateManager()
+{
+}
+
+/**
+ * This function goes through the whole list of synchronisables and 
+ * saves all the synchronisables to a flat "list".
+ * @return struct of type gamestate containing the size of the whole gamestate and a pointer linking to the flat list
+ */
+GameState GameStateManager::getSnapshot(int id)
+{
+  //the size of the gamestate
+  int totalsize=0;
+  //the size of one specific synchronisable
+  int tempsize=0;
+  // get the start of the Synchronisable list
+  orxonox::Iterator<Synchronisable> it;
+  // struct for return value of Synchronisable::getData()
+  syncData sync;
+  
+  GameState retval; //return value
+  retval.id=id;
+  // reserve a little memory and increase it later on
+  retval.data = (unsigned char*)malloc(1);
+  
+  // offset of memory functions
+  int offset=0;
+  // go through all Synchronisables
+  for(it = orxonox::ObjectList<Synchronisable>::start(); it != 0; ++it){
+    //get size of the synchronisable
+    tempsize=it->getSize();
+    // add place for data and 3 ints (length,classid,objectid)
+    totalsize+=tempsize+3*sizeof(int);
+    // allocate additional space
+    retval.data = (unsigned char *)realloc((void *)retval.data, totalsize);
+    
+    // run Synchronisable::getData with offset and additional place for 3 ints in between (for ids and length)
+    sync=it->getData(retval.data+offset+3*sizeof(int));
+    *(retval.data+offset)=sync.length;
+    *(retval.data+offset+sizeof(int))=sync.objectID;
+    *(retval.data+offset+2*sizeof(int))=sync.classID;
+    // increase data pointer
+    offset+=tempsize+3*sizeof(int);
+  }
+  retval.size=totalsize;
+  return retval;
+}
+
+/**
+ * This function loads a Snapshort of the gamestate into the universe
+ * @param state a GameState struct containing the size of the gamestate and a pointer linking to a flat list (returned by getSnapshot)
+ */
+bool GameStateManager::loadSnapshot(GameState state)
+{
+  unsigned char *data=state.data;
+  // get the start of the Synchronisable list
+  orxonox::Iterator<Synchronisable> it=orxonox::ObjectList<Synchronisable>::start();
+  syncData sync;
+  // loop as long as we have some data ;)
+  while(data < state.data+state.size){
+    // prepare the syncData struct
+    sync.length = *(int *)data;
+    data+=sizeof(int);
+    sync.objectID = *(int *)data;
+    data+=sizeof(int);
+    sync.classID = *(int *)data;
+    data+=sizeof(int);
+    sync.data = data;
+    data+=sync.length;
+    
+    if(it->objectID!=sync.objectID){
+      // bad luck ;)
+      // delete the synchronisable (obviously seems to be deleted on the server)
+      while(it != 0 && it->objectID!=sync.objectID){
+        removeObject(it);
+      }
+      if(it==0){  // add the new object
+        
+      }
+    } else {
+      // we have our object
+      if(! it->updateData(sync))
+        std::cout << "We couldn't update objectID: " \
+          << sync.objectID << "; classID: " << sync.classID << std::endl;
+    }
+    
+  }
+  
+  
+}
+
+/**
+ * This function removes a Synchronisable out of the universe
+ * @param it iterator of the list pointing to the object
+ * @return iterator pointing to the next object in the list
+ */
+// orxonox::Iterator<Synchronisable> removeObject(orxonox::Iterator<Synchronisable> it){
+void removeObject(orxonox::Iterator<Synchronisable> &it){
+  orxonox::Iterator<Synchronisable> temp=it;
+  ++it;
+  delete  *temp;
+//   return it;
+}
+
+
+}
+
+
Index: code/branches/FICN/src/network/GameStateManager.h
===================================================================
--- code/branches/FICN/src/network/GameStateManager.h	(revision 337)
+++ code/branches/FICN/src/network/GameStateManager.h	(revision 337)
@@ -0,0 +1,52 @@
+//
+// C++ Interface: GameStateManager
+//
+// Description: 
+//
+//
+// Author:  Oliver Scheuss, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef NETWORK_GAMESTATEMANAGER_H
+#define NETWORK_GAMESTATEMANAGER_H
+
+#include "Synchronisable.h"
+#include "orxonox/core/IdentifierIncludes.h"
+#include "orxonox/core/Iterator.h"
+
+namespace network {
+
+/**
+ * This struct defines a gamestate:
+ * size: total size of the data in *data
+ * data: pointer to the data allocated in the memory
+ */
+  struct GameState{
+  int id;
+  int size;
+  unsigned char *data;
+};
+
+/**
+ * This Class implements a manager for gamestates:
+ * - creating snapshots of gamestates
+ * - writing gamestates to universe
+ * - diffing gamestates ?
+ * @author Oliver Scheuss
+*/
+class GameStateManager{
+public:
+  GameStateManager();
+  ~GameStateManager();
+  GameState getSnapshot(int id);
+  bool loadSnapshot(GameState state);
+private:
+  bool removeObject(orxonox::Iterator<Synchronisable> it);
+
+};
+
+}
+
+#endif
Index: code/branches/FICN/src/network/Makefile.norm
===================================================================
--- code/branches/FICN/src/network/Makefile.norm	(revision 337)
+++ code/branches/FICN/src/network/Makefile.norm	(revision 337)
@@ -0,0 +1,40 @@
+CC=g++
+MAIN_INC=..
+INC=-I ${MAIN_INC}
+
+all: server client
+
+# Link command:
+server: PacketBuffer.o ConnectionManager.o dummyserver.o PacketDecoder.o PacketGenerator.o
+	${CC} PacketDecoder.o PacketGenerator.o ConnectionManager.o dummyserver.o PacketBuffer.o -o server -lenet -lboost_thread -g
+
+dummyserver.o: dummyserver.cc
+	${CC} -c dummyserver.cc -o dummyserver.o -g ${INC}
+# Compilation commands:
+ConnectionManager.o: ConnectionManager.cc ConnectionManager.h
+	${CC} -c ConnectionManager.cc -o ConnectionManager.o -g ${INC}
+ClientConnection.o: ClientConnection.cc ClientConnection.h
+	${CC} -c ClientConnection.cc -o ClientConnection.o -g ${INC}
+
+PacketBuffer.o: PacketBuffer.cc
+	${CC} -c PacketBuffer.cc -o PacketBuffer.o -g ${INC}
+PacketGenerator.o: PacketGenerator.cc
+	${CC} -c PacketGenerator.cc -o PacketGenerator.o -g ${INC}
+PacketDecoder.o: PacketDecoder.cc
+	${CC} -c PacketDecoder.cc -o PacketDecoder.o -g ${INC}
+Client.o: Client.cc
+	${CC} -c Client.cc -g ${INC}
+Server.o: Server.cc
+	${CC} -c Server.cc -g ${INC}
+Synchronisable.o: Synchronisable.cc
+	${CC} -c Synchronisable.cc -g ${INC}
+GameStateManager.o: GameStateManager.cc
+	${CC} -c GameStateManager.cc -g ${INC}
+
+clean:
+	rm -rf *.o
+
+client_old: PacketGenerator.o dummyclient.cc
+	${CC} dummyclient.cc PacketGenerator.o -o client -lenet -g ${INC}
+client: PacketGenerator.o ClientConnection.o PacketBuffer.o dummyclient2.cc 
+	${CC} dummyclient2.cc PacketGenerator.o PacketBuffer.o ClientConnection.o -o client -lenet -lboost_thread -g ${INC}
Index: code/branches/FICN/src/network/Makefile.tardis
===================================================================
--- code/branches/FICN/src/network/Makefile.tardis	(revision 337)
+++ code/branches/FICN/src/network/Makefile.tardis	(revision 337)
@@ -0,0 +1,39 @@
+all: server client
+
+CC=g++-4.1.1
+
+BOOST_INC=/usr/pack/boost-1.34.1-sd/i686-debian-linux3.1/include/boost-1_34_1/
+BOOST_LIB=/usr/pack/boost-1.34.1-sd/i686-debian-linux3.1/lib/
+MAIN_INC=..
+ENET_INC=/usr/pack/enet-2007-sd/include/
+ENET_LIB=/usr/pack/enet-2007-sd/i686-debian-linux3.1/lib/
+INC=-I ${BOOST_INC} -I ${MAIN_INC} -I ${ENET_INC}
+LIB=-L ${BOOST_LIB} -L ${ENET_LIB}
+
+# Link command:
+server: clean PacketBuffer.o ConnectionManager.o dummyserver.o PacketGenerator.o PacketDecoder.o
+	${CC} ConnectionManager.o dummyserver.o PacketBuffer.o PacketDecoder.o PacketGenerator.o -o server -lenet -lboost_thread-gcc41-mt -g ${INC} ${LIB} -Wl,-rpath,${BOOST_LIB} -Wl,-rpath,${ENET_LIB}
+
+dummyserver.o:
+	${CC} -c dummyserver.cc -o dummyserver.o -g ${INC}
+# Compilation commands:
+
+ConnectionManager.o:
+	${CC} -c ConnectionManager.cc -o ConnectionManager.o -g ${INC}
+
+PacketBuffer.o: 
+	${CC} -c PacketBuffer.cc -o PacketBuffer.o -g ${INC}
+PacketGenerator.o: PacketGenerator.cc
+	${CC} -c PacketGenerator.cc -o PacketGenerator.o -g ${INC}
+PacketDecoder.o: PacketDecoder.cc
+	${CC} -c PacketDecoder.cc -o PacketDecoder.o -g ${INC}
+Synchronisable.o: Synchronisable.cc
+	${CC} -c Synchronisable.cc -g ${INC}
+GameStateManager.o: GameStateManager.cc
+	${CC} -c GameStateManager.cc -g ${INC}
+
+clean:
+	rm -rf *.o
+
+client: dummyclient.cc PacketDecoder.o PacketGenerator.o
+	${CC} PacketGenerator.o PacketDecoder.o dummyclient.cc -o client -lenet ${LIB} ${INC} -Wl,-rpath,${BOOST_LIB}
Index: code/branches/FICN/src/network/PacketBuffer.cc
===================================================================
--- code/branches/FICN/src/network/PacketBuffer.cc	(revision 337)
+++ code/branches/FICN/src/network/PacketBuffer.cc	(revision 337)
@@ -0,0 +1,103 @@
+// C++ PacketBuffer
+// d
+// Author Oliver Scheuss
+
+#ifndef NETWORK_PACKETBUFFER_CC
+#define NETWORK_PACKETBUFFER_CC
+
+#include <iostream>
+#include "PacketBuffer.h"
+
+namespace network{
+
+   boost::mutex networkPacketBufferMutex;
+
+PacketBuffer::PacketBuffer(){
+  closed=false;
+  first=NULL;
+  last=NULL;
+}
+    //this is needed in order to make the packetbuffer threadsafe
+
+
+bool PacketBuffer::push(ENetEvent *ev){
+  boost::mutex::scoped_lock lock(networkPacketBufferMutex);
+//   if(closed)
+//     return false;
+  // first element?
+  if(first==NULL){
+    first=new QueueItem;
+    last=first;
+    last->next=NULL;
+    // change this!!!!!!!
+    last->packet = ev->packet;
+    last->address = ev->peer->address;
+    } else {
+    //insert a new element at the bottom
+    last->next = new QueueItem;
+    last=last->next;
+    // initialize last->next
+    last->next=NULL;
+    // save the packet to the new element
+    last->packet = ev->packet;
+    last->address = ev->peer->address;
+  }
+  return true;
+}
+
+ENetPacket *PacketBuffer::pop(){
+  boost::mutex::scoped_lock lock(networkPacketBufferMutex);
+  if(first!=NULL /*&& !closed*/){
+    QueueItem *temp = first;
+    // get packet
+    ENetPacket *pck=first->packet;
+    // remove first element
+    first = first->next;
+    delete temp;
+    return pck;
+  } else{
+    return NULL;
+  }
+}
+
+ENetPacket *PacketBuffer::pop(ENetAddress &address){
+  boost::mutex::scoped_lock lock(networkPacketBufferMutex);
+  if(first!=NULL /*&& !closed*/){
+    QueueItem *temp = first;
+    // get packet
+    ENetPacket *pck=first->packet;
+    address = first->address;
+    // remove first element
+    first = first->next;
+    delete temp;
+    return pck;
+  } else{
+    return NULL;
+  }
+}
+
+bool PacketBuffer::isEmpty(){
+  return (first==NULL);
+}
+
+void PacketBuffer::print(){
+  QueueItem *temp=first;
+  while(temp!=NULL){
+//    std::cout << temp->packet->data << std::endl;
+    temp=temp->next;
+  }
+
+}
+
+bool PacketBuffer::isClosed(){
+  return closed;
+}
+
+void PacketBuffer::setClosed(bool value){
+  closed=value;
+  return;
+}
+
+}// namespace network
+
+#endif
Index: code/branches/FICN/src/network/PacketBuffer.h
===================================================================
--- code/branches/FICN/src/network/PacketBuffer.h	(revision 337)
+++ code/branches/FICN/src/network/PacketBuffer.h	(revision 337)
@@ -0,0 +1,58 @@
+//
+// C++ Interface: PacketBuffer
+//
+// Description: 
+//
+//
+// Author:  Oliver Scheuss, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+#ifndef NETWORK_PACKETBUFFER_H 
+#define NETWORK_PACKETBUFFER_H
+
+#include <queue>
+#include <string>
+#include <enet/enet.h>
+#include <boost/bind.hpp>
+#include <boost/thread/mutex.hpp>
+
+
+namespace network{
+
+
+struct PacketEnvelope{
+  int length;
+  int data;
+};
+
+struct QueueItem{
+  ENetPacket *packet;
+  ENetAddress address;
+  QueueItem *next;
+};
+
+class PacketBuffer{
+public:
+  PacketBuffer();
+  bool isEmpty();
+  bool isClosed();
+  void setClosed(bool value);
+  void print();
+  // pops a packet from the queue
+  ENetPacket *pop();
+  ENetPacket *pop(ENetAddress &address);
+  // pushs a packet to the queue
+  bool push(ENetEvent *ev);
+  
+private:
+  QueueItem *first;
+  QueueItem *last;
+  bool closed;
+  
+};
+
+} //namespace
+#endif /* NETWORK_PACKETBUFFER_H */
Index: code/branches/FICN/src/network/PacketBufferTest.cc
===================================================================
--- code/branches/FICN/src/network/PacketBufferTest.cc	(revision 337)
+++ code/branches/FICN/src/network/PacketBufferTest.cc	(revision 337)
@@ -0,0 +1,25 @@
+#include "PacketBuffer.h"
+#include "PacketBuffer.cc"
+#include <iostream>
+#include <string>
+
+using namespace network;
+
+int main(int argc, char **argv[]){
+  PacketBuffer test = PacketBuffer();
+  PacketEnvelope p={8, 5};
+  if(test.isEmpty())
+    std::cout << "empty buffer" << std::endl;
+  for(int i=0; i<10; i++){
+    p.data=i*i;
+    std::cout << i << ": pushing " << p.data << std::endl;
+    test.push(p);
+  }
+  std::cout << std::endl << "queue.print()" << std::endl;
+  test.print();
+  while(!test.isEmpty()){
+    int i=test.pop().data;
+    std::cout << "We popped the value " << i << std::endl;
+  }
+  return 0;
+}
Index: code/branches/FICN/src/network/PacketBufferTestExt.cc
===================================================================
--- code/branches/FICN/src/network/PacketBufferTestExt.cc	(revision 337)
+++ code/branches/FICN/src/network/PacketBufferTestExt.cc	(revision 337)
@@ -0,0 +1,51 @@
+#include <string>
+#include <iostream>
+#include <enet/enet.h>
+#include <boost/thread/thread.hpp>
+#include "PacketBuffer.h"
+#include "PacketBuffer.cc"
+
+using namespace network;
+
+
+void write(PacketBuffer *test){
+  ENetPacket *packet;
+  if(test->isEmpty())
+    std::cout << "empty buffer" << std::endl;
+  for(int i=0; i<10; i++){
+    std::string temp = "packet ";
+    packet = enet_packet_create("packet", strlen("packet ")+1,
+ENET_PACKET_FLAG_RELIABLE);
+    std::cout << i << ": pushing " << packet->data << std::endl;
+    test->push(packet);
+    if(i==5)
+      usleep(200000);
+  }
+  test->setClosed(true);
+  return;
+}
+
+void read(PacketBuffer *test){
+  //test->print();
+  // exit if the queue is closed and empty
+  while(!test->isClosed() || !test->isEmpty()){
+    // only pop if the queue isn't empty
+    while(!test->isEmpty()){
+      std::cout << "We popped the value " << test->pop()->data << std::endl;
+    }
+  }
+  return;
+}
+
+
+int main(int argc, char **argv[]){
+  PacketBuffer test = PacketBuffer();
+  boost::thread thrd1(boost::bind(&write, &test));
+  boost::thread thrd2(boost::bind(&read, &test));
+
+  thrd1.join();
+  thrd2.join();
+
+  return 0;
+}
+
Index: code/branches/FICN/src/network/PacketDecoder.cc
===================================================================
--- code/branches/FICN/src/network/PacketDecoder.cc	(revision 337)
+++ code/branches/FICN/src/network/PacketDecoder.cc	(revision 337)
@@ -0,0 +1,155 @@
+/*
+ * Class contains functions to determine and decode incomming packages
+ * ->don't read this without the class PacketGenerator, since they belong together
+ * 
+ * Autor: Dumeni Manatschal
+ * 
+*/
+
+#include "enet/enet.h"
+#include "PacketManager.h"
+#include <iostream>
+
+using namespace std;
+using namespace network;
+
+PacketDecoder::PacketDecoder(){}
+
+//call this function out of an instance of PacketDecoder
+//it will determine the type id and call the right decode function
+bool PacketDecoder::elaborate( ENetPacket* packet, int clientId )
+{
+	int client = clientId;
+	cout << "clientId: " << client << endl; //control cout, not important, just debugging info
+	int id = (int)*packet->data; //the first 4 bytes are always the enet packet id
+	switch( id ) {
+	case ACK:
+		acknowledgement( packet );
+		return true;
+		break;
+	case MOUSE:
+		mousem( packet );
+		return true;
+		break;
+	case KEYBOARD:
+		keystrike( packet );
+		return true;
+		break;
+	case CHAT:
+		chatMessage( packet );
+		return true;
+		break;
+	case GAMESTATE:
+		gstate( packet );
+		return true;
+		break;
+	}
+	return false;
+}
+
+//following are the decode functions for the data of the packets
+
+void PacketDecoder::acknowledgement( ENetPacket* packet )
+{
+	ack* a = new ack;
+	*a = *(ack*)packet->data; //press pattern of ack on new data
+	
+	//clean memory
+	enet_packet_destroy( packet );
+	
+	printAck( a ); //debug info
+}
+
+void PacketDecoder::mousem( ENetPacket* packet )
+{
+	mouse* mouseMove = new mouse;
+	//copy data of packet->data to new struct
+	*mouseMove = *(mouse*)packet->data; 
+	
+	//clean memory
+	enet_packet_destroy( packet );
+	
+	printMouse( mouseMove ); //debug info
+}
+
+void PacketDecoder::keystrike( ENetPacket* packet )
+{
+	keyboard* key = new keyboard;
+	*key = *(keyboard*)packet->data; //see above
+	
+	//clean memory
+	enet_packet_destroy( packet );
+	
+	printKey( key ); //debug info
+
+}
+
+void PacketDecoder::chatMessage( ENetPacket* packet )
+{
+	chat* chatting = new chat;
+	chatting->id = (int)*packet->data; //first copy id into new struct
+	//since the chat message is a char*, allocate the memory needed
+	char* reserve = new char[packet->dataLength-4]; 
+	//copy the transmitted bytestream into the new generated char*,
+	//note the lenght of the message is represented as "packet->dataLength-sizeof( int )" 
+	memcpy( &reserve[0], packet->data+sizeof(int), packet->dataLength-sizeof(int) );
+	//put pointer of chatting struct to the begining of the new generated char*
+	chatting->message = reserve;
+	
+	//clean memory
+	enet_packet_destroy( packet );
+	
+	printChat( chatting ); //debug info
+	
+}
+
+void PacketDecoder::gstate( ENetPacket* packet )
+{
+	GameState* currentState = new GameState;
+	//since it's not alowed to use void* for pointer arithmetic
+	unsigned char* data = (unsigned char*)packet->data;
+	//copy the gamestate id into the struct, which is located at second place data+sizeof( int )
+	memcpy( (void*)&(currentState->id), (const void*)(data+sizeof( int )), sizeof( int ) );
+	//copy the size of the gamestate data into the new gamestate struct, located at 3th
+	//position of the data stream, data+2*sizeof( int )
+	memcpy( (void*)&(currentState->size), (const void*)(data+2*sizeof( int )), sizeof( int) );
+	//since data is not allocated, because it's just a pointer, allocate it with size of gamestatedatastream
+	currentState->data = (unsigned char*)(malloc( currentState->size ));
+	//copy the gamestate data
+	memcpy( (void*)(currentState->data), (const void*)(data+3*sizeof( int )), currentState->size );
+	
+	//clean memory
+	enet_packet_destroy( packet );
+}
+
+//these are some print functions for test stuff
+
+void PacketDecoder::printAck( ack* data )
+{
+	cout << "data id: " << data->id << endl;
+	cout << "data:    " << data->a << endl;
+}
+
+void PacketDecoder::printMouse( mouse* data )
+{
+	cout << "data id: " << data->id << endl;
+	cout << "data:    " << data->x << " " << data->y << endl;
+}
+
+void PacketDecoder::printKey( keyboard* data )
+{
+	cout << "data id: " << data->id << endl;
+	cout << "data:    " << (char)data->press << endl;
+}
+
+void PacketDecoder::printChat( chat* data )
+{
+	cout << "data id: " << data->id << endl;
+	cout << "data:    " << data->message << endl;
+}
+
+void PacketDecoder::printGamestate( GameState* data )
+{
+	cout << "id of gamestate:   " << data->id << endl;
+	cout << "size of gamestate: " << data->size << endl;
+}
Index: code/branches/FICN/src/network/PacketGenerator.cc
===================================================================
--- code/branches/FICN/src/network/PacketGenerator.cc	(revision 337)
+++ code/branches/FICN/src/network/PacketGenerator.cc	(revision 337)
@@ -0,0 +1,87 @@
+/*
+ *Class generates packets that can be send by enet
+ * ->don't read this without the class PacketDecoder, since they belong together
+ * 
+ * Autor: Dumeni Manatschal
+ *  
+*/
+
+#include "PacketManager.h"
+#include "enet/enet.h"
+#include <iostream>
+#include <list>
+#include <string>
+#include <cstring>
+
+using namespace std;
+using namespace network;
+
+PacketGenerator::PacketGenerator() {}
+
+//following functions create a packet in form of bytestream
+
+ENetPacket* PacketGenerator::acknowledgement( int state, int reliable )
+{
+	cout << "generating new acknowledgement" << endl;
+	ack* ackreq = new ack;
+	ackreq->id = ACK;
+	ackreq->a = state;
+	
+	ENetPacket *packet = enet_packet_create( ackreq , sizeof( *ackreq ), reliable );
+	
+	return packet;
+}
+/*### mouseupdates */
+ENetPacket* PacketGenerator::mousem( double x, double y, int reliable )
+{
+	cout << "generating new mouse" << endl;
+	mouse* mousemove = new mouse;
+	mousemove->id = MOUSE;
+	mousemove->x = x;
+	mousemove->y = y;
+	
+	ENetPacket *packet = enet_packet_create( mousemove , sizeof( *mousemove ), reliable );
+	
+	return packet;
+}
+/*### keystrikes updates */
+ENetPacket* PacketGenerator::keystrike( char press, int reliable )
+{
+	cout << "generating new keyboard" << endl;
+	keyboard* key = new keyboard;
+	key->id = KEYBOARD;
+	key->press = press;
+	
+	ENetPacket *packet = enet_packet_create( key , sizeof( *key ), reliable );
+	
+	return packet;
+}
+/*### chat messages packet */
+ENetPacket* PacketGenerator::chatMessage( const char* message, int reliable )
+{
+	int* trans = new int[sizeof(int) + strlen(message) + 1];
+	*trans = CHAT;
+	//be carefull here, don't forget to allocate the space before using it ;-)
+	memcpy( &trans[1], (const void*)message, strlen( message ) + 1);
+	ENetPacket *packet = enet_packet_create( trans , sizeof( int ) + strlen( message ) + 1, reliable );
+	
+	return packet;
+}
+
+/*### gamestate packet */
+ENetPacket* PacketGenerator::gstate( GameState* states, int reliable )
+{
+	int* gid; *gid = GAMESTATE; //first assign the correct enet id
+	int totalLen = 3*sizeof( int ) + states->size; //calculate the total size of the datastream memory
+	unsigned char* data = (unsigned char*)malloc( totalLen ); //allocate the memory for datastream
+	memcpy( (void*)(data), (const void*)gid, sizeof( int ) ); //this is the enet id
+	memcpy( (void*)(data+sizeof(int)), (const void*)&(states->id), sizeof(int) ); //the gamestate id
+	//this is the size of the gamestate data, place at 3th position of the enet datastream
+	memcpy( (void*)(data+2*sizeof(int)), (const void*)&(states->size), sizeof(int)); 
+	//place the gamestate data at the end of the enet datastream
+	memcpy( (void*)(data+3*sizeof( int )), (const void*)states->data, states->size );
+	//create an enet packet with the generated bytestream
+	ENetPacket *packet = enet_packet_create( data , totalLen, reliable );
+	
+	return packet;
+}
Index: code/branches/FICN/src/network/PacketManager.h
===================================================================
--- code/branches/FICN/src/network/PacketManager.h	(revision 337)
+++ code/branches/FICN/src/network/PacketManager.h	(revision 337)
@@ -0,0 +1,103 @@
+#ifndef PACKETMANAGER_H_
+#define PACKETMANAGER_H_
+
+#include <enet/enet.h>
+#include <network/GameStateManager.h>
+
+//enum netowk generaly used to set the type ID of a packet
+namespace network
+{
+enum packet_id {
+	ACK,
+	MOUSE,
+	KEYBOARD,
+	CHAT,
+	GAMESTATE
+};
+
+/*
+ * class to generate packets
+ * 
+ * @autor: Dumeni Manatschal
+ * 
+*/ 
+class PacketGenerator
+{
+public:
+	PacketGenerator();
+	//call one of this functions out of an instance of PacketGenerator to create a packet
+	ENetPacket* acknowledgement( int state, int reliable = ENET_PACKET_FLAG_RELIABLE );
+	ENetPacket* mousem( double x, double y, int reliable = ENET_PACKET_FLAG_RELIABLE );
+	ENetPacket* keystrike( char press, int reliable = ENET_PACKET_FLAG_RELIABLE );
+	ENetPacket* chatMessage( const char* message, int reliable = ENET_PACKET_FLAG_RELIABLE );
+	ENetPacket* gstate( GameState* states, int reliable = ENET_PACKET_FLAG_RELIABLE );
+private:
+	//used to set the bytes in the right order
+	struct ack {
+		int id;
+		int a;
+	};
+
+	struct mouse {
+		int id;
+		double x;
+		double y;
+	};
+
+	struct keyboard {
+		int id;
+		char press;
+	};	
+};
+
+/*
+ * class used to decode incoming packets
+ * 
+ * @autor: Dumeni Manatschal
+ * 
+*/
+class PacketDecoder
+{
+public:
+	PacketDecoder();
+	//call this function to decode, it calls the right decoding function below
+	bool elaborate( ENetPacket* packet, int clientId );
+private:
+	struct ack {
+		int id;
+		int a;
+	};
+
+	struct mouse {
+		int id;
+		double x;
+		double y;
+	};
+
+	struct keyboard {
+		int id;
+		char press;
+	};
+	//only in this class, not PacketGenerator, used as pattern to put incoming
+	//bytes inside
+	struct chat {
+		int id;
+		const char* message;
+	};
+	
+	void acknowledgement( ENetPacket* packet );
+	void mousem( ENetPacket* packet );
+	void keystrike( ENetPacket* packet );
+	void chatMessage( ENetPacket* packet );
+	void gstate( ENetPacket* packet );
+	
+	//print functions
+	void printAck( ack* data );
+	void printMouse( mouse* data );
+	void printKey( keyboard* data );
+	void printChat( chat* data );
+	void printGamestate( GameState* data );
+};
+}
+
+#endif /*PACKETMANAGER_H_*/
Index: code/branches/FICN/src/network/Server.cc
===================================================================
--- code/branches/FICN/src/network/Server.cc	(revision 337)
+++ code/branches/FICN/src/network/Server.cc	(revision 337)
@@ -0,0 +1,53 @@
+//
+// C++ Implementation: Server
+//
+// Description:
+//
+//
+// Author:  Oliver Scheuss, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+
+#include "Server.h"
+
+namespace network{
+
+  /**
+   * Constructor for default values (bindaddress is set to ENET_HOST_ANY
+   *
+   */
+  Server::Server(){
+
+
+  }
+
+  /**
+   * Constructor
+   * @param port Port to listen on
+   * @param bindAddress Address to listen on
+   */
+  Server::Server(int port, std::string bindAddress) : connection(port, bindAddress){
+
+
+  }
+
+  /**
+   * Constructor
+   * @param port Port to listen on
+   * @param bindAddress Address to listen on
+   */
+  Server::Server(int port, const char *bindAddress) : connection(port, bindAddress){
+
+
+
+
+  }
+
+
+
+
+
+}
Index: code/branches/FICN/src/network/Server.h
===================================================================
--- code/branches/FICN/src/network/Server.h	(revision 337)
+++ code/branches/FICN/src/network/Server.h	(revision 337)
@@ -0,0 +1,51 @@
+//
+// C++ Interface: Server
+//
+// Description:
+//
+//
+// Author:  Oliver Scheuss, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+#ifndef NETWORK_SERVER_H
+#define NETWORK_SERVER_H
+
+#include <string>
+
+#include "ConnectionManager.h"
+#include "PacketManager.h"
+
+
+namespace network{
+
+  /**
+   * This class is the root class of the network module for a server.
+   * It implements all functions necessary for a Server
+   */
+  class Server : PacketDecoder{
+    public:
+    Server();
+    Server(int port, std::string bindAddress);
+    Server(int port, const char *bindAddress);
+
+    private:
+    ConnectionManager connection;
+
+
+
+
+
+
+
+  };
+
+
+
+
+
+}
+
+#endif
Index: code/branches/FICN/src/network/Synchronisable.cc
===================================================================
--- code/branches/FICN/src/network/Synchronisable.cc	(revision 337)
+++ code/branches/FICN/src/network/Synchronisable.cc	(revision 337)
@@ -0,0 +1,141 @@
+//
+// C++ Implementation: synchronisable
+//
+// Description:
+//
+//
+// Author:  Dumeni, Oliver Scheuss, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+
+#include "Synchronisable.h"
+
+namespace network {
+
+/**
+ * Constructor:
+ * calls registarAllVariables, that has to be implemented by the inheriting classID
+ */
+Synchronisable::Synchronisable()
+{
+  datasize=0;
+  registerAllVariables();
+}
+
+
+Synchronisable::~Synchronisable()
+{
+
+}
+
+/**
+ * This function is used to register a variable to be synchronized
+ * also counts the total datasize needed to save the variables
+ * @param var pointer to the variable
+ * @param size size of the datatype the variable consists of
+ */
+void Synchronisable::registerVar(const void *var, int size){
+  // create temporary synch.Var struct
+  synchronisableVariable temp={size, var};
+  // increase datasize
+  datasize+=sizeof(int)+size;
+  // push temp to syncList (at the bottom)
+  syncList.push_back(temp);
+}
+
+/**
+ * note: only use this function for debug use, because it's inefficient (in order to produce a gamestate, you have to copy the whole data again to another memory location after this process)
+ * This function takes all SynchronisableVariables out of the Synchronisable and saves it into a syncData struct
+ * structure of the bitstream:
+ * (var1_size,var1,var2_size,var2,...)
+ * varx_size: size = sizeof(int)
+ * varx: size = varx_size
+ * @return data containing all variables and their sizes
+ */
+syncData Synchronisable::getData(){
+  std::list<synchronisableVariable>::iterator i;
+  int totalsize=0;
+  //figure out size of data to be allocated
+  for(i=syncList.begin(); i!=syncList.end(); i++){
+    // increase size (size of variable and size of size of variable ;)
+    totalsize+=sizeof(int)+i->size;
+  }
+  syncData retVal;
+  retVal.objectID=this->objectID;
+  retVal.classID=this->classID;
+  retVal.length=totalsize;
+  // allocate memory
+  retVal.data = (unsigned char *)malloc(totalsize);
+  // copy to location
+  //CHANGED: REMOVED DECLARATION int n=0 FROM LOOP
+  int n=0;
+  for(i=syncList.begin(); n<totalsize && i!=syncList.end(); i++){
+	//CHANGED: i->size TO (const void*)(&(i->size)) memcpy WANTS A CONST VOID* SO CONVERT INT TO CONST VOID*
+    std::memcpy(retVal.data+n, (const void*)(i->size), sizeof(int));
+    n+=sizeof(int);
+    //CHANGED: i->var TO (const void*)(&(i->var)) SINCE var IS A POINTER, NO & BEFORE i
+    std::memcpy(retVal.data+n, (const void*)(i->var), i->size);
+    n+=i->size;
+  }
+  return retVal;
+}
+/**
+ * This function takes all SynchronisableVariables out of the Synchronisable and saves it into a syncData struct
+ * Difference to the above function:
+ * takes a pointer to already allocated memory (must have at least getSize bytes length)
+ * structure of the bitstream:
+ * (var1_size,var1,var2_size,var2,...)
+ * varx_size: size = sizeof(int)
+ * varx: size = varx_size
+ * @return data containing all variables and their sizes
+ */
+syncData Synchronisable::getData(unsigned char *mem){
+  std::list<synchronisableVariable>::iterator i;
+  syncData retVal;
+  retVal.objectID=this->objectID;
+  retVal.classID=this->classID;
+  retVal.length=datasize;
+  retVal.data=mem;
+  // copy to location
+  //CHANGED: REMOVED DECLARATION int n=0 FROM LOOP
+  int n=0;
+  for(i=syncList.begin(); n<datasize && i!=syncList.end(); i++){
+        //CHANGED: i->size TO (const void*)(&(i->size)) memcpy WANTS A CONST VOID* SO CONVERT INT TO CONST VOID*
+    std::memcpy(retVal.data+n, (const void*)(i->size), sizeof(int));
+    n+=sizeof(int);
+    //CHANGED: i->var TO (const void*)(&(i->var)) SINCE var IS A POINTER, NO & BEFORE i
+    std::memcpy(retVal.data+n, (const void*)(i->var), i->size);
+    n+=i->size;
+  }
+  return retVal;
+}
+
+/**
+ * This function takes a syncData struct and takes it to update the variables
+ * @param vars data of the variables
+ * @return true/false
+ */
+bool Synchronisable::updateData(syncData vars){
+  unsigned char *data=vars.data;
+  std::list<synchronisableVariable>::iterator i;
+  for(i=syncList.begin(); i!=syncList.end(); i++){
+    if((int)*data==i->size){
+      data+=sizeof(int);
+      //CHANGED: THIS FROM i->var TO (void*)i->var SINCE var IS A CONST VOID* AND memcpy NEEDS A VOID* AS FIRST ARGUMENT
+      memcpy((void*)i->var, data, i->size);
+      data+=i->size;
+    } else
+      return false; //there was some problem with registerVar
+  }
+}
+
+/**
+ * This function returns the total amount of bytes needed by getData to save the whole content of the variables
+ * @return amount of bytes
+ */
+int Synchronisable::getSize(){
+  return datasize;
+}
+
+}
Index: code/branches/FICN/src/network/Synchronisable.h
===================================================================
--- code/branches/FICN/src/network/Synchronisable.h	(revision 337)
+++ code/branches/FICN/src/network/Synchronisable.h	(revision 337)
@@ -0,0 +1,65 @@
+//
+// C++ Interface: synchronisable
+//
+// Description: 
+//
+//
+// Author:  Oliver Scheuss, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef NETWORK_SYNCHRONISABLE_H
+#define NETWORK_SYNCHRONISABLE_H
+
+#include <list>
+#include <iostream>
+
+#include "orxonox/core/IdentifierIncludes.h"
+
+namespace network {
+
+  
+struct syncData{
+  int length;
+  int objectID;
+  int classID;
+  unsigned char *data;
+};
+
+typedef struct synchronisableVariable{
+  int size;
+  const void *var;
+}SYNCVAR;
+
+  
+/**
+ * This class is the base class of all the Objects in the universe that need to be synchronised over the network
+ * Every class, that inherits from this class has to link the DATA THAT NEEDS TO BE SYNCHRONISED into the linked list. Additionally it also has to provide a Constructor, that takes exactly the variables in this linked list.
+ * @author Oliver Scheuss
+*/
+class Synchronisable{
+public:
+  Synchronisable();
+
+  virtual ~Synchronisable();
+  int objectID;
+  int classID;
+    
+  void registerVar(const void *var, int size);
+  syncData getData();
+  syncData getData(unsigned char *mem);
+  int getSize();
+  bool updateData(syncData vars);
+  virtual void registerAllVariables();
+
+private:
+/*  bool removeObject(Iterator<Synchronisable> it);*/
+  
+  std::list<SYNCVAR> syncList;
+  int datasize;
+};
+
+}
+
+#endif
Index: code/branches/FICN/src/network/dummyclient.cc
===================================================================
--- code/branches/FICN/src/network/dummyclient.cc	(revision 337)
+++ code/branches/FICN/src/network/dummyclient.cc	(revision 337)
@@ -0,0 +1,93 @@
+//
+// Dummy client to test ConnectionManager and PacketBuffer classes
+//
+// Author: Oliver Scheuss
+
+#include <iostream>
+#include <string>
+#include <enet/enet.h>
+#include "PacketManager.h"
+
+using namespace std;
+
+int main(){
+  ENetHost * client;
+  ENetAddress address;
+  ENetEvent event;
+  ENetPeer *peer;
+  network::PacketGenerator pck;
+
+  enet_initialize();
+  atexit(enet_deinitialize);
+
+  cout << "Enter address of the server xxx.xxx.xxx.xxx (enter for localhost)" << endl;
+  string str;
+  getline(cin, str);
+  cout << "You entered: " << str << endl;
+  if(str.compare("")==0)
+    str="127.0.0.1";
+
+  enet_address_set_host(&address, str.c_str());
+  address.port = 55556;
+
+        // create client object
+  client = enet_host_create(NULL, 2, 0, 0);
+
+  if(client==NULL){
+    fprintf(stderr, "An error occured");
+    exit(EXIT_FAILURE);
+  }
+        // connect peer
+  peer = enet_host_connect(client, &address, 2);
+  if(peer==NULL){
+    fprintf(stderr, "Peer establishing error");
+    exit(EXIT_FAILURE);
+  }
+        // wait 5 seconds for the connection attempt to succeed
+  if(enet_host_service(client, &event, 5000) > 0 && event.type == ENET_EVENT_TYPE_CONNECT){
+    cout << "Connection to " << str << " succeeded." << endl;
+    //puts("Connection to localhost:5555 succeeded.");
+  }else{
+    enet_peer_reset(peer);
+    cout << "Connection to " << str << " failed." << endl;
+    //puts("Connection to localhost:5555 failed.");
+    exit(EXIT_FAILURE);
+  }
+
+  for(int i=0; i<10; i++){
+        // weihnachtsmann bringt packete
+    //ENetPacket *packet = enet_packet_create ("packet1234", strlen("packet1234") + 1, ENET_PACKET_FLAG_RELIABLE);
+        // extend the packet and append the string foo to it
+        // send packet to peer on channel id 0
+    enet_peer_send(peer, 1, pck.chatMessage("test2"));
+        // keep the timeout very small for low delay
+    if(enet_host_service(client, &event, 1)==0){
+      cout << "successfully sent: " << event.type << endl;
+    }else{
+      cout << "failed sending" << endl;
+    }
+    usleep(1000000);
+  }
+
+        // now disconnect
+//   enet_peer_disconnect (peer);
+  enet_peer_disconnect (peer, 0);
+        // 3 seconds timeout
+  while(enet_host_service(client, &event, 3000) > 0){
+    switch (event.type)
+    {
+      case ENET_EVENT_TYPE_RECEIVE:
+        enet_packet_destroy(event.packet);
+        break;
+      case ENET_EVENT_TYPE_DISCONNECT:
+        puts("Disconnection succeeded.");
+        return 0;
+    }
+  }
+        // if disconnect failed
+  enet_peer_reset(peer);
+
+
+
+  return 0;
+}
Index: code/branches/FICN/src/network/dummyclient2.cc
===================================================================
--- code/branches/FICN/src/network/dummyclient2.cc	(revision 337)
+++ code/branches/FICN/src/network/dummyclient2.cc	(revision 337)
@@ -0,0 +1,61 @@
+//
+// Dummy client to test ConnectionManager, PacketBuffer, ClientConnection and other classes
+//
+// Author: Oliver Scheuss
+
+#include <iostream>
+#include <string>
+#include <enet/enet.h>
+#include "PacketManager.h"
+#include "ClientConnection.h"
+
+using namespace network;
+
+int main(){
+  network::PacketGenerator pck;
+
+  std::cout << "Enter address of the server xxx.xxx.xxx.xxx (enter for localhost)" << std::endl;
+  std::string str;
+  std::getline(std::cin, str);
+  std::cout << "You entered: " << str << std::endl;
+  if(str.compare("")==0)
+    str="127.0.0.1";
+
+  ClientConnection client = ClientConnection(55556, str);
+
+  client.createConnection();
+
+  if(client.waitEstablished(10000))
+    std::cout << "Connection established" << std::endl;
+  else
+    std::cout << "Connection failed" << std::endl;
+
+  ENetPacket *packet;
+  ENetEvent event;
+
+
+
+  for(int i=0; i<10; i++){
+        // weihnachtsmann bringt packete
+        // extend the packet and append the string foo to it
+        // send packet to peer on channel id 0
+    client.addPacket(pck.chatMessage("test"));
+        // keep the timeout very small for low delay
+    if(client.sendPackets(&event)){
+      std::cout << "successfully sent: " << event.type << std::endl;
+    }else{
+      std::cout << "failed sending" << std::endl;
+    }
+    //usleep(100000);
+  }
+
+        // now disconnect
+  if(client.closeConnection())
+    std::cout << "Connection successfully closed" << std::endl;
+  else
+    std::cout << "Connection closing failed" << std::endl;
+
+        // 3 seconds timeout
+  return 0;
+}
+
Index: code/branches/FICN/src/network/dummyserver.cc
===================================================================
--- code/branches/FICN/src/network/dummyserver.cc	(revision 337)
+++ code/branches/FICN/src/network/dummyserver.cc	(revision 337)
@@ -0,0 +1,42 @@
+//
+// Dummy server to test ConnectionManager and PacketBuffer classes
+//
+// Author: Oliver Scheuss
+
+
+#include <iostream>
+#include "enet/enet.h"
+#include "ConnectionManager.h"
+#include "PacketManager.h"
+
+using namespace network;
+
+int main(){
+  ConnectionManager server = ConnectionManager();
+  bool quit=false;
+  ENetPacket *packet;
+  ENetEvent event;
+  server.createListener();
+
+  PacketDecoder dec;
+
+  while(!quit){
+    if(server.queueEmpty())
+      usleep(100);
+    else{
+      ENetAddress addr;
+      packet=server.getPacket(addr);
+      if(packet==NULL){
+        // there was some error
+        //std::cout << "null pointer" << std::endl;
+        quit=true;
+      }
+      else{
+        //std::cout << "We received: " << packet->data << std::endl;
+        dec.elaborate(packet, 1);
+      }
+    }
+  }
+  server.quitListener();
+  return 0;
+}
Index: code/branches/FICN/src/ogre_control.cc
===================================================================
--- code/branches/FICN/src/ogre_control.cc	(revision 337)
+++ code/branches/FICN/src/ogre_control.cc	(revision 337)
@@ -0,0 +1,223 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OgrePlatform.h"
+#include "OgreRoot.h"
+#include "OgreRenderWindow.h"
+#include "OgreString.h"
+#include "OgreConfigFile.h"
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+  #include <CoreFoundation/CoreFoundation.h>
+#endif
+
+#include "ogre_control.h"
+
+
+namespace orxonox {
+  using namespace Ogre;
+
+  /**
+  * Ogre control class.
+  * This is merely a convenient way to handle Ogre. It only holds the Root
+  * object and the render Window. These are the objects, that are independant
+  * of the game state (playing, menu browsing, loading, etc.).
+  * This class could easily be merged into the Orxnox class.
+  */
+
+
+  /**
+  * Provide support for mac users.
+  */
+  #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+  // This function will locate the path to our application on OS X,
+  // unlike windows you can not rely on the curent working directory
+  // for locating your configuration files and resources.
+  std::string macBundlePath()
+  {
+	  char path[1024];
+	  CFBundleRef mainBundle = CFBundleGetMainBundle();
+	  assert(mainBundle);
+
+	  CFURLRef mainBundleURL = CFBundleCopyBundleURL(mainBundle);
+	  assert(mainBundleURL);
+
+	  CFStringRef cfStringRef =
+          CFURLCopyFileSystemPath( mainBundleURL, kCFURLPOSIXPathStyle);
+	  assert(cfStringRef);
+
+	  CFStringGetCString(cfStringRef, path, 1024, kCFStringEncodingASCII);
+
+	  CFRelease(mainBundleURL);
+	  CFRelease(cfStringRef);
+
+	  return std::string(path);
+  }
+  #endif
+
+
+  /**
+  * Constructor that determines the resource path platform dependant.
+  */
+  OgreControl::OgreControl() : root_(0)
+  {
+	  // Provide a nice cross platform solution for locating the configuration
+	  // files. On windows files are searched for in the current working
+    // directory, on OS X however you must provide the full path, the helper
+    // function macBundlePath does this for us.
+  #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+	  resourcePath_ = macBundlePath() + "/Contents/Resources/";
+  #else
+	  resourcePath_ = "";
+  #endif
+  }
+
+
+  /**
+  * Standard Destructor.
+  */
+  OgreControl::~OgreControl()
+  {
+	  if (root_)
+		  delete root_;
+  }
+
+
+  /* Sets up Ogre.
+  * First, the Root object is being created, then the resources are defined
+  * (not loaded!). And last but not least, the render settings (like resolution
+  * or AA level) are prompted to the user.
+  */
+  bool OgreControl::initialise(void)
+  {
+	  String pluginsPath;
+	  // only use plugins.cfg if not static
+  #ifndef OGRE_STATIC_LIB
+	  pluginsPath = resourcePath_ + "plugins.cfg";
+  #endif
+
+	  root_ = new Root(pluginsPath, 
+		  resourcePath_ + "ogre.cfg", resourcePath_ + "Ogre.log");
+
+	  setupResources();
+
+	  if (!configure())
+		  return false;
+
+	  return true;
+  }
+
+
+  /**
+  * Defines the source of the resources.
+  */
+  void OgreControl::setupResources(void)
+  {
+	  // Load resource paths from config file
+	  ConfigFile cf;
+	  cf.load(resourcePath_ + "resources.cfg");
+
+	  // Go through all sections & settings in the file
+	  ConfigFile::SectionIterator seci = cf.getSectionIterator();
+
+	  String secName, typeName, archName;
+	  while (seci.hasMoreElements())
+	  {
+		  secName = seci.peekNextKey();
+		  ConfigFile::SettingsMultiMap *settings = seci.getNext();
+		  ConfigFile::SettingsMultiMap::iterator i;
+		  for (i = settings->begin(); i != settings->end(); ++i)
+		  {
+			  typeName = i->first;
+			  archName = i->second;
+  #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+			  // OS X does not set the working directory relative to the app,
+			  // In order to make things portable on OS X we need to provide
+			  // the loading with it's own bundle path location
+			  ResourceGroupManager::getSingleton().addResourceLocation(
+				  String(macBundlePath() + "/" + archName), typeName, secName);
+  #else
+			  ResourceGroupManager::getSingleton().addResourceLocation(
+				  archName, typeName, secName);
+  #endif
+		  }
+	  }
+  }
+
+
+  /**
+  * Prompts a setting window for the render engine if that has not already
+  * been done.
+  * The method also calls the root initialiser in order to get a render window.
+  */
+  bool OgreControl::configure(void)
+  {
+	  // Show the configuration dialog and initialise the system
+	  // You can skip this and use root.restoreConfig() to load configuration
+	  // settings if you were sure there are valid ones saved in ogre.cfg
+	  if(!root_->restoreConfig() && !root_->showConfigDialog())
+		  return false;
+
+	  // user clicked OK so initialise
+	  // Here we choose to let the system create a default
+    // rendering window by passing 'true'
+	  root_->saveConfig();
+	  window_ = root_->initialise(true);
+	  return true;
+  }
+
+
+  /**
+  * Returns the root object.
+  * @return Root object.
+  */
+  Root* OgreControl::getRoot(void)
+  {
+	  return root_;
+  }
+
+
+  /**
+  * Returns the render window.
+  * @return Render window.
+  */
+  RenderWindow* OgreControl::getRenderWindow(void)
+  {
+	  return window_;
+  }
+
+
+  /**
+  * Returns the resource path.
+  * @return Resource path.
+  */
+  Ogre::String OgreControl::getResourcePath(void)
+  {
+	  return resourcePath_;
+  }
+
+}
Index: code/branches/FICN/src/ogre_control.h
===================================================================
--- code/branches/FICN/src/ogre_control.h	(revision 337)
+++ code/branches/FICN/src/ogre_control.h	(revision 337)
@@ -0,0 +1,71 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef OGRE_CONTROL_H
+#define OGRE_CONTROL_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+
+  class OgreControl
+  {
+  public:
+	  OgreControl();
+
+	  virtual ~OgreControl();
+
+	  /** Sets up the application - returns false if the user chooses to abandon configuration. */
+	  virtual bool initialise();
+
+    virtual Ogre::Root* getRoot();
+
+	  virtual Ogre::RenderWindow* getRenderWindow();
+
+	  virtual Ogre::String getResourcePath();
+
+  protected:
+	  /** Configures the application - returns false if the user chooses to abandon configuration. */
+	  virtual bool configure(void);
+
+	  /// Method which will define the source of resources (other than current folder)
+	  virtual void setupResources(void);
+
+  protected:
+	  Ogre::Root         *root_;
+	  Ogre::RenderWindow *window_;
+	  Ogre::String  resourcePath_;
+
+  };
+
+}
+
+#endif /* OGRE_CONTROL_H */
Index: code/branches/FICN/src/orxonox.h
===================================================================
--- code/branches/FICN/src/orxonox.h	(revision 337)
+++ code/branches/FICN/src/orxonox.h	(revision 337)
@@ -0,0 +1,59 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef ORXONOX_H
+#define ORXONOX_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+namespace orxonox {
+
+  class Orxonox
+  {
+  public:
+    Orxonox();
+    virtual ~Orxonox();
+	  virtual void go();
+
+  protected:
+	  virtual bool setup(void);
+
+	  virtual void destroy(void);
+
+  protected:
+	  OgreControl *ogre_;
+	  RunManager  *runMgr_;
+	  Ogre::Timer *timer_;
+
+  };
+
+}
+
+#endif /* ORXONOX_H */
Index: code/branches/FICN/src/orxonox/CMakeLists.txt
===================================================================
--- code/branches/FICN/src/orxonox/CMakeLists.txt	(revision 337)
+++ code/branches/FICN/src/orxonox/CMakeLists.txt	(revision 337)
@@ -0,0 +1,14 @@
+PROJECT(Orxonox)
+
+SET(SRC_FILES orxonox.cc spaceship_steering.cc)
+
+ADD_EXECUTABLE(../../bin/main ${SRC_FILES})
+
+TARGET_LINK_LIBRARIES(../../bin/main ${OGRE_LIBRARIES} ${OIS_LIBRARIES} loader )
+
+INCLUDE_DIRECTORIES(..)
+
+ADD_SUBDIRECTORY(core)
+ADD_SUBDIRECTORY(objects)
+ADD_SUBDIRECTORY(hud)
+ADD_SUBDIRECTORY(weapon)
Index: code/branches/FICN/src/orxonox/core/CMakeLists.txt
===================================================================
--- code/branches/FICN/src/orxonox/core/CMakeLists.txt	(revision 337)
+++ code/branches/FICN/src/orxonox/core/CMakeLists.txt	(revision 337)
@@ -0,0 +1,5 @@
+PROJECT(Orxonox)
+
+SET(SRC_FILES IdentifierList.cc Identifier.cc MetaObjectList.cc Factory.cc OrxonoxClass.cc)
+
+ADD_LIBRARY(core ${SRC_FILES})
Index: code/branches/FICN/src/orxonox/core/Iterator.h
===================================================================
--- code/branches/FICN/src/orxonox/core/Iterator.h	(revision 336)
+++ code/branches/FICN/src/orxonox/core/Iterator.h	(revision 337)
@@ -1,4 +1,4 @@
-#ifndef _Iterator_H__
-#define _Iterator_H__
+#ifndef _Iterator_H2__
+#define _Iterator_H2__
 
 namespace orxonox
Index: code/branches/FICN/src/orxonox/hud/CMakeLists.txt
===================================================================
--- code/branches/FICN/src/orxonox/hud/CMakeLists.txt	(revision 337)
+++ code/branches/FICN/src/orxonox/hud/CMakeLists.txt	(revision 337)
@@ -0,0 +1,5 @@
+PROJECT(Orxonox)
+
+SET(SRC_FILES hud_overlay.cc test_overlay.cc)
+
+ADD_LIBRARY(objects ${SRC_FILES})
Index: code/branches/FICN/src/orxonox/hud/hud_overlay.cc
===================================================================
--- code/branches/FICN/src/orxonox/hud/hud_overlay.cc	(revision 337)
+++ code/branches/FICN/src/orxonox/hud/hud_overlay.cc	(revision 337)
@@ -0,0 +1,151 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      HUD design: Yuning Chai
+ *      Implementation: Yuning Chai
+ *   Co-authors:
+ *      Implementation: Reto Grieder
+ *
+ */
+
+//#include "OgreMath.h"
+//#include "OgreVector3.h"
+#include "OgreStringConverter.h"
+#include "OgreOverlayManager.h"
+#include "OgreOverlay.h"
+#include "OgreOverlayElement.h"
+
+#include "hud_overlay.h"
+
+
+namespace orxonox {
+namespace hud {
+  using namespace Ogre;
+
+  HUDOverlay::HUDOverlay()
+  {
+    //TODO: write safe guard
+    overlay_ = OverlayManager::getSingleton().getByName("Orxonox/HUD1.2");
+  }
+
+
+  HUDOverlay::~HUDOverlay()
+  {
+  }
+
+
+  void HUDOverlay::show()
+  {
+    //TODO: safe guard
+    overlay_->show();
+  }
+
+
+  void HUDOverlay::hide()
+  {
+    //TODO: safe guard
+    overlay_->hide();
+  }
+
+
+  bool HUDOverlay::tick(unsigned long, Ogre::Real)
+  {
+		// set Time
+		int TimeMin = 99;
+		int TimeSec = 55;
+		OverlayElement* TimeText = OverlayManager::getSingleton().getOverlayElement("Orxonox/HUD1.2/Time/Text");
+		TimeText->setCaption(StringConverter::toString(TimeMin) + ":" + StringConverter::toString(TimeSec));
+		
+		// set TargetWindow
+		String TargetWindowName = "HURRA";
+		int TargetWindowDistance = 12;
+		String TargetWindowStatus = "Dead";
+		int TargetWindowHitRating = 30;
+		OverlayElement* TargetWindowNameText = OverlayManager::getSingleton().getOverlayElement("Orxonox/HUD1.2/TargetWindow/Name");
+		TargetWindowNameText->setCaption( TargetWindowName);		
+		OverlayElement* TargetWindowDistanceText = OverlayManager::getSingleton().getOverlayElement("Orxonox/HUD1.2/TargetWindow/DistanceText");
+		TargetWindowDistanceText->setCaption(StringConverter::toString(TargetWindowDistance) + "km" );
+		OverlayElement* TargetWindowStatusText = OverlayManager::getSingleton().getOverlayElement("Orxonox/HUD1.2/TargetWindow/StatusText");
+		TargetWindowStatusText->setCaption( TargetWindowStatus );
+		OverlayElement* TargetWindowHitRatingText = OverlayManager::getSingleton().getOverlayElement("Orxonox/HUD1.2/TargetWindow/HitRatingText");
+		TargetWindowHitRatingText->setCaption(StringConverter::toString(TargetWindowHitRating) + "%" );
+		
+		// set Energy
+		int EnergyValue = 60.0;
+		OverlayElement* EnergyLength = OverlayManager::getSingleton().getOverlayElement("Orxonox/HUD1.2/EnergyBackground");
+		EnergyLength->setWidth((int)((double)60/(double)100*200));
+		
+		// set Shild
+		bool ShildLeftTopValue = true;
+		bool ShildRightTopValue = false;
+		bool ShildLeftBottomValue = false;
+		bool ShildRightBottomValue = true;
+		OverlayElement* ShildLeftTop = OverlayManager::getSingleton().getOverlayElement("Orxonox/HUD1.2/ShildLeftTop");
+		if (ShildLeftTopValue) ShildLeftTop->show();
+		else ShildLeftTop->hide();
+		OverlayElement* ShildRightTop = OverlayManager::getSingleton().getOverlayElement("Orxonox/HUD1.2/ShildRightTop");
+		if (ShildRightTopValue) ShildRightTop->show();
+		else ShildRightTop->hide();
+		OverlayElement* ShildLeftBottom = OverlayManager::getSingleton().getOverlayElement("Orxonox/HUD1.2/ShildLeftBottom");
+		if (ShildLeftBottomValue) ShildLeftBottom->show();
+		else ShildLeftBottom->hide();
+		OverlayElement* ShildRightBottom = OverlayManager::getSingleton().getOverlayElement("Orxonox/HUD1.2/ShildRightBottom");
+		if (ShildRightBottomValue) ShildRightBottom->show();
+		else ShildRightBottom->hide();
+		
+		// set Rockets
+		int Rocket1 = 11;
+		int Rocket2 = 22;
+		int Rocket3 = 33;
+		int Rocket4 = 44;
+		OverlayElement* RocketNum1 = OverlayManager::getSingleton().getOverlayElement("Orxonox/HUD1.2/RocketNum1");
+		RocketNum1->setCaption(StringConverter::toString(Rocket1));
+		OverlayElement* RocketNum2 = OverlayManager::getSingleton().getOverlayElement("Orxonox/HUD1.2/RocketNum2");
+		RocketNum2->setCaption(StringConverter::toString(Rocket2));
+		OverlayElement* RocketNum3 = OverlayManager::getSingleton().getOverlayElement("Orxonox/HUD1.2/RocketNum3");
+		RocketNum3->setCaption(StringConverter::toString(Rocket3));
+		OverlayElement* RocketNum4 = OverlayManager::getSingleton().getOverlayElement("Orxonox/HUD1.2/RocketNum4");
+		RocketNum4->setCaption(StringConverter::toString(Rocket4));
+		
+		// set EnergyDistribution
+		double EnergyDistrPixelX = 100;
+		double EnergyDistrPixelY = 86;		
+		double EnergyDistrShild = 32;
+		double EnergyDistrEngine = 50;
+		double EnergyDistrLaser = 18;
+		double EnergyDistrShildInv = 100 - EnergyDistrShild;
+		double EnergyDistrEngineInv = 100 - EnergyDistrEngine;
+		double EnergyDistrLaserInv = 100 - EnergyDistrLaser;
+		double EnergyDistrY = (double)EnergyDistrEngineInv/((double)EnergyDistrEngineInv+(double)EnergyDistrLaserInv) * EnergyDistrPixelY;
+		double EnergyDistrX = EnergyDistrY/1.7321;
+		
+		
+		
+		OverlayElement* EnergyDistrPoint = OverlayManager::getSingleton().getOverlayElement("Orxonox/HUD1.2/EnergyDistrPoint");
+//		EnergyDistrPoint->setLeft();
+//		EnergyDistrPoint->setTop();
+
+
+    // keep rendering
+    return true;
+  }
+}
+}
Index: code/branches/FICN/src/orxonox/hud/hud_overlay.h
===================================================================
--- code/branches/FICN/src/orxonox/hud/hud_overlay.h	(revision 337)
+++ code/branches/FICN/src/orxonox/hud/hud_overlay.h	(revision 337)
@@ -0,0 +1,64 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      HUD design: Yuning Chai
+ *      Implementation: Yuning Chai
+ *   Co-authors:
+ *      Implementation: Reto Grieder
+ *
+ */
+
+
+#ifndef HUD_OVERLAY_H
+#define HUD_OVERLAY_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+namespace hud {
+
+  class HUDOverlay
+  {
+  public:
+    HUDOverlay();
+	  virtual ~HUDOverlay();
+
+    void show();
+
+    void hide();
+
+    bool tick(unsigned long, Ogre::Real);
+
+  protected:
+
+  public:
+
+  protected:
+    Ogre::Overlay *overlay_;
+
+  };
+}
+}
+
+#endif /* HUD_OVERLAY_H */
Index: code/branches/FICN/src/orxonox/hud/test_overlay.cc
===================================================================
--- code/branches/FICN/src/orxonox/hud/test_overlay.cc	(revision 337)
+++ code/branches/FICN/src/orxonox/hud/test_overlay.cc	(revision 337)
@@ -0,0 +1,124 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      HUD design: Yuning Chai
+ *      Implementation: Yuning Chai
+ *   Co-authors:
+ *      Implementation: Reto Grieder
+ *
+ */
+
+//#include "OgreMath.h"
+//#include "OgreVector3.h"
+#include "OgreStringConverter.h"
+#include "OgreOverlayManager.h"
+#include "OgreOverlay.h"
+#include "OgreOverlayElement.h"
+#include "OgreRenderWindow.h"
+#include "OgreRenderTarget.h"
+
+#include "test_overlay.h"
+
+
+namespace orxonox {
+namespace hud {
+  using namespace Ogre;
+
+  TestOverlay::TestOverlay(RenderWindow *window)
+    :window_(window)
+  {
+    //TODO: write safe guard
+    overlay_ = OverlayManager::getSingleton().getByName("Core/DebugOverlay");
+  }
+
+
+  TestOverlay::~TestOverlay()
+  {
+  }
+
+
+  void TestOverlay::show()
+  {
+    //TODO: safe guard
+    overlay_->show();
+  }
+
+
+  void TestOverlay::hide()
+  {
+    //TODO: safe guard
+    overlay_->hide();
+  }
+
+
+  void TestOverlay::setDebugText(Ogre::String &str)
+  {
+    debugText_ = str;
+  }
+
+
+  bool TestOverlay::tick(unsigned long, Ogre::Real)
+  {
+    static String currFps = "Current FPS: ";
+    static String avgFps = "Average FPS: ";
+    static String bestFps = "Best FPS: ";
+    static String worstFps = "Worst FPS: ";
+    static String tris = "Triangle Count: ";
+    static String batches = "Batch Count: ";
+
+    // update stats when necessary
+    try {
+      OverlayElement* guiAvg = OverlayManager::getSingleton()
+        .getOverlayElement("Core/AverageFps");
+      OverlayElement* guiCurr = OverlayManager::getSingleton()
+        .getOverlayElement("Core/CurrFps");
+      OverlayElement* guiBest = OverlayManager::getSingleton()
+        .getOverlayElement("Core/BestFps");
+      OverlayElement* guiWorst = OverlayManager::getSingleton()
+        .getOverlayElement("Core/WorstFps");
+
+      const RenderTarget::FrameStats& stats = window_->getStatistics();
+      guiAvg->setCaption(avgFps + StringConverter::toString(stats.avgFPS));
+      guiCurr->setCaption(currFps + StringConverter::toString(stats.lastFPS));
+      guiBest->setCaption(bestFps + StringConverter::toString(stats.bestFPS)
+        +" "+StringConverter::toString(stats.bestFrameTime)+" ms");
+      guiWorst->setCaption(worstFps + StringConverter::toString(stats.worstFPS)
+        +" "+StringConverter::toString(stats.worstFrameTime)+" ms");
+
+      OverlayElement* guiTris = OverlayManager::getSingleton()
+        .getOverlayElement("Core/NumTris");
+      guiTris->setCaption(tris + StringConverter::toString(stats.triangleCount));
+
+      OverlayElement* guiBatches = OverlayManager::getSingleton()
+        .getOverlayElement("Core/NumBatches");
+      guiBatches->setCaption(batches
+        + StringConverter::toString(stats.batchCount));
+
+      OverlayElement* guiDbg = OverlayManager::getSingleton()
+        .getOverlayElement("Core/DebugText");
+      guiDbg->setCaption(debugText_);
+    }
+    catch(...) { /* ignore */ }
+
+    return true;
+  }
+}
+}
Index: code/branches/FICN/src/orxonox/hud/test_overlay.h
===================================================================
--- code/branches/FICN/src/orxonox/hud/test_overlay.h	(revision 337)
+++ code/branches/FICN/src/orxonox/hud/test_overlay.h	(revision 337)
@@ -0,0 +1,69 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      HUD design: Yuning Chai
+ *      Implementation: Yuning Chai
+ *   Co-authors:
+ *      Implementation: Reto Grieder
+ *
+ */
+
+
+#ifndef TEST_OVERLAY_H
+#define TEST_OVERLAY_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+namespace hud {
+
+  class TestOverlay
+  {
+  public:
+    TestOverlay(Ogre::RenderWindow*);
+	  virtual ~TestOverlay();
+
+    void show();
+
+    void hide();
+
+    void setDebugText(Ogre::String&);
+
+    bool tick(unsigned long, Ogre::Real);
+
+  protected:
+
+  public:
+
+  protected:
+    Ogre::Overlay *overlay_;
+    Ogre::RenderWindow *window_;
+
+    Ogre::String debugText_;
+
+  };
+}
+}
+
+#endif /* TEST_OVERLAY_H */
Index: code/branches/FICN/src/orxonox/objects/CMakeLists.txt
===================================================================
--- code/branches/FICN/src/orxonox/objects/CMakeLists.txt	(revision 337)
+++ code/branches/FICN/src/orxonox/objects/CMakeLists.txt	(revision 337)
@@ -0,0 +1,5 @@
+PROJECT(Orxonox)
+
+SET(SRC_FILES BaseObject.cc test1.cc test2.cc test3.cc)
+
+ADD_LIBRARY(objects ${SRC_FILES})
Index: code/branches/FICN/src/orxonox/orxonox.cc
===================================================================
--- code/branches/FICN/src/orxonox/orxonox.cc	(revision 336)
+++ code/branches/FICN/src/orxonox/orxonox.cc	(revision 337)
@@ -39,6 +39,9 @@
 #include <iostream>
 
-#include "../xml/xmlParser.h"
-#include "../loader/LevelLoader.h"
+#include "xml/xmlParser.h"
+#include "loader/LevelLoader.h"
+
+#include "spaceship_steering.h"
+SpaceshipSteering* steering;
 
 
@@ -76,21 +79,98 @@
 namespace orxonox
 {
-  class OrxExitListener : public Ogre::FrameListener
-  {
-    public:
-      OrxExitListener(OIS::Keyboard *keyboard)
-    : mKeyboard(keyboard)
-      {
-      }
-
-      bool frameStarted(const Ogre::FrameEvent& evt)
-      {
-        mKeyboard->capture();
-        return !mKeyboard->isKeyDown(OIS::KC_ESCAPE);
-      }
-
-    private:
-      OIS::Keyboard *mKeyboard;
-  };
+
+using namespace Ogre;
+
+class OrxExitListener : public FrameListener, public OIS::MouseListener
+{
+  public:
+    OrxExitListener(OIS::Keyboard *keyboard, OIS::Mouse *mouse)
+  : mKeyboard(keyboard), mMouse(mouse)
+    {
+      speed = 250;
+      loop = 100;
+      rotate = 10;
+      mouseX = 0;
+      mouseY = 0;
+      maxMouseX = 0;
+      minMouseX = 0;
+      moved = false;
+      steering->brakeRotate(rotate*10);
+      steering->brakeLoop(loop);
+      mMouse->setEventCallback(this);
+    }
+    bool frameStarted(const FrameEvent& evt)
+    {
+      mKeyboard->capture();
+      mMouse->capture();
+      if (mKeyboard->isKeyDown(OIS::KC_UP) || mKeyboard->isKeyDown(OIS::KC_W))
+        steering->moveForward(speed);
+      else
+        steering->moveForward(0);
+      if(mKeyboard->isKeyDown(OIS::KC_DOWN) || mKeyboard->isKeyDown(OIS::KC_S))
+        steering->brakeForward(speed);
+      else
+        steering->brakeForward(speed/10);
+      if (mKeyboard->isKeyDown(OIS::KC_RIGHT) || mKeyboard->isKeyDown(OIS::KC_D))
+        steering->loopRight(loop);
+      else
+        steering->loopRight(0);
+      if (mKeyboard->isKeyDown(OIS::KC_LEFT) || mKeyboard->isKeyDown(OIS::KC_A))
+        steering->loopLeft(loop);
+      else
+        steering->loopLeft(0);
+
+      if(moved) {
+        if (mouseY<0)
+          steering->rotateUp(-mouseY*rotate);
+        if (mouseY>0)
+          steering->rotateDown(mouseY*rotate);
+        if (mouseX>0)
+          steering->rotateRight(mouseX*rotate);
+        if (mouseX<0)
+          steering->rotateLeft(-mouseX*rotate);
+        moved = false;
+      }
+      else {
+        steering->rotateUp(0);
+        steering->rotateDown(0);
+        steering->rotateRight(0);
+        steering->rotateLeft(0);
+      }
+
+      steering->tick(evt.timeSinceLastFrame);
+//	scenemanager->spacehip->tick(evt.timesincelastframe);
+      if(mKeyboard->isKeyDown(OIS::KC_ESCAPE))
+        cout << "maximal MouseX: " << maxMouseX << "\tminMouseX: " << minMouseX << endl;
+      return !mKeyboard->isKeyDown(OIS::KC_ESCAPE);
+    }
+
+    bool mouseMoved(const OIS::MouseEvent &e)
+    {
+      mouseX = e.state.X.rel;
+      mouseY = e.state.Y.rel;
+      if(mouseX>maxMouseX) maxMouseX = mouseX;
+      if(mouseX<minMouseX) minMouseX = mouseX;
+      cout << "mouseX: " << mouseX << "\tmouseY: " << mouseY << endl;
+      moved = true;
+      return true;
+    }
+
+    bool mousePressed(const OIS::MouseEvent &e, OIS::MouseButtonID id) { return true; }
+    bool mouseReleased(const OIS::MouseEvent &e, OIS::MouseButtonID id) { return true; }
+
+  private:
+    float speed;
+    float rotate;
+    float loop;
+    float mouseY;
+    float mouseX;
+    float maxMouseX;
+    float minMouseX;
+    bool moved;
+    OIS::Keyboard *mKeyboard;
+    OIS::Mouse *mMouse;
+};
+
 
   class OrxApplication
@@ -174,5 +254,5 @@
       {
         if (!mRoot->restoreConfig() && !mRoot->showConfigDialog())
-          throw Ogre::Exception(52, "User canceled the config dialog!", "OrxApplication::setupRenderSystem()");
+          throw Exception(52, "User canceled the config dialog!", "OrxApplication::setupRenderSystem()");
       }
 
@@ -184,6 +264,6 @@
       void initializeResourceGroups()
       {
-        Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);
-        Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
+        TextureManager::getSingleton().setDefaultNumMipmaps(5);
+        ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
       }
 
@@ -191,14 +271,45 @@
       {
 
-        string levelFile = "sp_level_moonstation.oxw";
-        loader::LevelLoader* loader = new loader::LevelLoader(levelFile);
-      }
-
-      void setupScene()
-      {
-        Ogre::SceneManager *mgr = mRoot->createSceneManager(Ogre::ST_GENERIC, "Default SceneManager");
-        Ogre::Camera *cam = mgr->createCamera("Camera");
-        Ogre::Viewport *vp = mRoot->getAutoCreatedWindow()->addViewport(cam);
-      }
+      string levelFile = "sp_level_moonstation.oxw";
+      loader::LevelLoader* loader = new loader::LevelLoader(levelFile);
+    }
+
+    void setupScene()
+    {
+      SceneManager *mgr = mRoot->createSceneManager(ST_GENERIC, "Default SceneManager");
+      Camera *cam = mgr->createCamera("Camera");
+      cam->setPosition(Vector3(0,0,-250));
+      cam->lookAt(Vector3(0,0,0));
+      Viewport *vp = mRoot->getAutoCreatedWindow()->addViewport(cam);
+
+
+      mgr->setAmbientLight(ColourValue(1,1,1));
+      Entity* head = mgr->createEntity("head", "ogrehead.mesh");
+      SceneNode *node = mgr->getRootSceneNode()->createChildSceneNode("OgreHeadNode", Vector3(0,0,0));
+      node->attachObject(head);
+      node->attachObject(cam);
+      mgr->setSkyBox(true, "Examples/SceneSkyBox2");
+
+      Entity* head1 = mgr->createEntity("head1", "ogrehead.mesh");
+      SceneNode *node1 = mgr->getRootSceneNode()->createChildSceneNode("OgreHeadNode1", Vector3(200,0,0));
+      node1->attachObject(head1);
+      Entity* head2 = mgr->createEntity("head2", "ogrehead.mesh");
+      SceneNode *node2 = mgr->getRootSceneNode()->createChildSceneNode("OgreHeadNode2", Vector3(200,400,-100));
+      node2->attachObject(head2);
+      Entity* head3 = mgr->createEntity("head3", "ogrehead.mesh");
+      SceneNode *node3 = mgr->getRootSceneNode()->createChildSceneNode("OgreHeadNode3", Vector3(0,400,200));
+      node3->attachObject(head3);
+      Entity* head4 = mgr->createEntity("head4", "ogrehead.mesh");
+      SceneNode *node4 = mgr->getRootSceneNode()->createChildSceneNode("OgreHeadNode4", Vector3(-400,-200,600));
+      node4->attachObject(head4);
+      Entity* head5 = mgr->createEntity("head5", "ogrehead.mesh");
+      SceneNode *node5 = mgr->getRootSceneNode()->createChildSceneNode("OgreHeadNode5", Vector3(0,0,-400));
+      node5->attachObject(head5);
+
+      steering = new SpaceshipSteering(500, 200, 200, 200);
+      steering->addNode(node);
+
+    }
+
 
       void setupInputSystem()
@@ -217,5 +328,5 @@
         {
           mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject(OIS::OISKeyboard, false));
-          mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject(OIS::OISMouse, false));
+          mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject(OIS::OISMouse, true));
         }
         catch (const OIS::Exception &e)
@@ -237,10 +348,10 @@
       }
 
-      void createFrameListener()
-      {
-        mListener = new OrxExitListener(mKeyboard);
-        mRoot->addFrameListener(mListener);
-      }
-
+
+    void createFrameListener()
+    {
+      mListener = new OrxExitListener(mKeyboard, mMouse);
+      mRoot->addFrameListener(mListener);
+    }
       void startRenderLoop()
       {
Index: code/branches/FICN/src/orxonox/spaceship_steering.cc
===================================================================
--- code/branches/FICN/src/orxonox/spaceship_steering.cc	(revision 337)
+++ code/branches/FICN/src/orxonox/spaceship_steering.cc	(revision 337)
@@ -0,0 +1,186 @@
+#include "Ogre.h"
+#include "spaceship_steering.h"
+using namespace Ogre;
+
+SpaceshipSteering::SpaceshipSteering(float maxSpeedForward, float
+maxSpeedRotateUpDown, float maxSpeedRotateRightLeft, float
+maxSpeedLoopRightLeft) {
+  moveForward_ = 0;
+  rotateUp_ = 0;
+  rotateDown_ = 0;
+  rotateRight_ = 0;
+  rotateLeft_ = 0;
+  loopRight_ = 0;
+  loopLeft_ = 0;
+  brakeForward_ = 0;
+  brakeRotate_ = 0;
+  brakeLoop_ = 0;
+  speedForward_ = 0;
+  speedRotateUpDown_ = 0;
+  speedRotateRightLeft_ = 0;
+  speedLoopRightLeft_ = 0;
+  maxSpeedForward_ = maxSpeedForward;
+  maxSpeedRotateUpDown_ = maxSpeedRotateUpDown;
+  maxSpeedRotateRightLeft_ = maxSpeedRotateRightLeft;
+  maxSpeedLoopRightLeft_ = maxSpeedLoopRightLeft;
+  accelerationForward_ = 0;
+  accelerationRotateUpDown_ = 0;
+  accelerationRotateRightLeft_ = 0;
+  accelerationLoopRightLeft_ = 0;
+}
+
+void SpaceshipSteering::tick(float time) {
+
+  if(moveForward_ > 0) {
+    accelerationForward_ = moveForward_;
+    if(speedForward_ < maxSpeedForward_)
+      speedForward_ += accelerationForward_*time;
+    if(speedForward_ > maxSpeedForward_)
+      speedForward_ = maxSpeedForward_;
+  }
+  if(moveForward_ <= 0) {
+    accelerationForward_ = brakeForward_;
+    if(speedForward_ > 0)
+      speedForward_ -= accelerationForward_*time;
+    if(speedForward_ < 0)
+      speedForward_ = 0;
+  }
+
+  if(rotateUp_ > 0) {
+    accelerationRotateUpDown_ = rotateUp_;
+    if(speedRotateUpDown_ < maxSpeedRotateUpDown_)
+      speedRotateUpDown_ += accelerationRotateUpDown_*time;
+    if(speedRotateUpDown_ > maxSpeedRotateUpDown_)
+      speedRotateUpDown_ = maxSpeedRotateUpDown_;
+  }
+  if(rotateDown_ > 0) {
+    accelerationRotateUpDown_ = rotateDown_;
+    if(speedRotateUpDown_ > -maxSpeedRotateUpDown_)
+      speedRotateUpDown_ -= accelerationRotateUpDown_*time;
+    if(speedRotateUpDown_ < -maxSpeedRotateUpDown_)
+      speedRotateUpDown_ = -maxSpeedRotateUpDown_;
+  }
+  if(rotateUp_ == 0 && rotateDown_ == 0) {
+    accelerationRotateUpDown_ = brakeRotate_;
+    if(speedRotateUpDown_ > 0)
+      speedRotateUpDown_ -= accelerationRotateUpDown_*time;
+    if(speedRotateUpDown_ < 0)
+      speedRotateUpDown_ += accelerationRotateUpDown_*time;
+  }
+
+  if(rotateRight_ > 0) {
+    accelerationRotateRightLeft_ = rotateRight_;
+    if(speedRotateRightLeft_ > -maxSpeedRotateRightLeft_)
+      speedRotateRightLeft_ -= accelerationRotateRightLeft_*time;
+    if(speedRotateRightLeft_ < -maxSpeedRotateRightLeft_)
+      speedRotateRightLeft_ = -maxSpeedRotateRightLeft_;
+  }
+  if(rotateLeft_ > 0) {
+    accelerationRotateRightLeft_ = rotateLeft_;
+    if(speedRotateRightLeft_ < maxSpeedRotateRightLeft_)
+      speedRotateRightLeft_ += accelerationRotateRightLeft_*time;
+    if(speedRotateRightLeft_ > maxSpeedRotateRightLeft_)
+      speedRotateRightLeft_ = maxSpeedRotateRightLeft_;
+  }
+  if(rotateRight_ == 0 && rotateLeft_ == 0) {
+    accelerationRotateRightLeft_ = brakeRotate_;
+    if(speedRotateRightLeft_ > 0)
+      speedRotateRightLeft_ -= accelerationRotateRightLeft_*time;
+    if(speedRotateRightLeft_ < 0)
+      speedRotateRightLeft_ += accelerationRotateRightLeft_*time;
+  }
+
+  if(loopRight_ > 0) {
+    accelerationLoopRightLeft_ = loopRight_;
+    if(speedLoopRightLeft_ < maxSpeedLoopRightLeft_)
+      speedLoopRightLeft_ += accelerationLoopRightLeft_*time;
+    if(speedLoopRightLeft_ > maxSpeedLoopRightLeft_)
+      speedLoopRightLeft_ = maxSpeedLoopRightLeft_;
+  }
+  if(loopLeft_ > 0) {
+    accelerationLoopRightLeft_ = loopLeft_;
+    if(speedLoopRightLeft_ > -maxSpeedLoopRightLeft_)
+      speedLoopRightLeft_ -= accelerationLoopRightLeft_*time;
+    if(speedLoopRightLeft_ < -maxSpeedLoopRightLeft_)
+      speedLoopRightLeft_ = -maxSpeedLoopRightLeft_;
+  }
+  if(loopLeft_ == 0 && loopRight_ == 0) {
+    accelerationLoopRightLeft_ = brakeLoop_;
+    if(speedLoopRightLeft_ > 0)
+      speedLoopRightLeft_ -= accelerationLoopRightLeft_*time;
+    if(speedLoopRightLeft_ < 0)
+      speedLoopRightLeft_ += accelerationLoopRightLeft_*time;
+  }
+
+  Vector3 transVector = Vector3::ZERO;
+  transVector.z = 1;
+  steeringNode_->translate(transVector*speedForward_*time,
+  Node::TS_LOCAL);
+  steeringNode_->pitch(Degree(speedRotateUpDown_*time),
+  Node::TS_LOCAL);
+  steeringNode_->yaw(Degree(speedRotateRightLeft_*time),
+  Node::TS_LOCAL);
+  steeringNode_->roll(Degree(speedLoopRightLeft_*time),
+  Node::TS_LOCAL);
+
+}
+
+void SpaceshipSteering::moveForward(float moveForward) {
+  moveForward_ = moveForward;
+}
+
+void SpaceshipSteering::rotateUp(float rotateUp) {
+  rotateUp_ = rotateUp;
+}
+
+void SpaceshipSteering::rotateDown(float rotateDown) {
+  rotateDown_ = rotateDown;
+}
+
+void SpaceshipSteering::rotateLeft(float rotateLeft) {
+  rotateLeft_ = rotateLeft;
+}
+
+void SpaceshipSteering::rotateRight(float rotateRight) {
+  rotateRight_ = rotateRight;
+}
+
+void SpaceshipSteering::loopLeft(float loopLeft) {
+  loopLeft_ = loopLeft;
+}
+
+void SpaceshipSteering::loopRight(float loopRight) {
+  loopRight_ = loopRight;
+}
+
+void SpaceshipSteering::brakeForward(float brakeForward) {
+  brakeForward_ = brakeForward;
+}
+
+void SpaceshipSteering::brakeRotate(float brakeRotate) {
+  brakeRotate_ = brakeRotate;
+}
+
+void SpaceshipSteering::brakeLoop(float brakeLoop) {
+  brakeLoop_ = brakeLoop;
+}
+
+void SpaceshipSteering::maxSpeedForward(float maxSpeedForward) {
+  maxSpeedForward_ = maxSpeedForward;
+}
+
+void SpaceshipSteering::maxSpeedRotateUpDown(float maxSpeedRotateUpDown) {
+  maxSpeedRotateUpDown_ = maxSpeedRotateUpDown;
+}
+
+void SpaceshipSteering::maxSpeedRotateRightLeft(float maxSpeedRotateRightLeft) {
+  maxSpeedRotateRightLeft_ = maxSpeedRotateRightLeft;
+}
+
+void SpaceshipSteering::maxSpeedLoopRightLeft(float maxSpeedLoopRightLeft) {
+  maxSpeedLoopRightLeft_ = maxSpeedLoopRightLeft;
+}
+
+void SpaceshipSteering::addNode(Ogre::SceneNode *steeringNode) {
+  steeringNode_ = steeringNode;
+}
Index: code/branches/FICN/src/orxonox/spaceship_steering.h
===================================================================
--- code/branches/FICN/src/orxonox/spaceship_steering.h	(revision 337)
+++ code/branches/FICN/src/orxonox/spaceship_steering.h	(revision 337)
@@ -0,0 +1,60 @@
+#ifndef SPACESHIP_STEERING_H
+#define SPACESHIP_STEERING_H
+
+#include "OgrePrerequisites.h"
+
+class SpaceshipSteering
+{
+  public:
+    SpaceshipSteering(float maxSpeedForward, float maxSpeedRotateUpDown,
+    float maxSpeedRotateRightLeft, float maxSpeedLoopRightLeft);
+    void tick(float time);
+    void moveForward(float moveForward);
+    void rotateUp(float rotateUp);
+    void rotateDown(float rotateDown);
+    void rotateRight(float rotateRight);
+    void rotateLeft(float rotateLeft);
+    void loopRight(float loopRight);
+    void loopLeft(float loopLeft);
+    void brakeForward(float brakeForward);
+    void brakeRotate(float brakeRotate);
+    void brakeLoop(float brakeLoop);
+    void maxSpeedForward(float maxSpeedForward);
+    void maxSpeedRotateUpDown(float maxSpeedRotateUpDown);
+    void maxSpeedRotateRightLeft(float maxSpeedRotateRightLeft);
+    void maxSpeedLoopRightLeft(float maxSpeedLoopRightLeft);
+    void addNode(Ogre::SceneNode *steeringNode);
+
+  protected:
+    Ogre::SceneNode *steeringNode_;
+
+  private:
+    float moveForward_;
+    float rotateUp_;
+    float rotateDown_;
+    float rotateRight_;
+    float rotateLeft_;
+    float loopRight_;
+    float loopLeft_;
+    float brakeForward_;
+    float brakeRotate_;
+    float brakeLoop_;
+
+    float speedForward_;
+    float speedRotateUpDown_;
+    float speedRotateRightLeft_;
+    float speedLoopRightLeft_;
+
+    float maxSpeedForward_;
+    float maxSpeedRotateUpDown_;
+    float maxSpeedRotateRightLeft_;
+    float maxSpeedLoopRightLeft_;
+
+    float accelerationForward_;
+    float accelerationRotateUpDown_;
+    float accelerationRotateRightLeft_;
+    float accelerationLoopRightLeft_;
+
+};
+
+#endif
Index: code/branches/FICN/src/orxonox/weapon/CMakeLists.txt
===================================================================
--- code/branches/FICN/src/orxonox/weapon/CMakeLists.txt	(revision 337)
+++ code/branches/FICN/src/orxonox/weapon/CMakeLists.txt	(revision 337)
@@ -0,0 +1,15 @@
+PROJECT(Orxonox)
+
+# create a few variables to simplify life
+SET( WEAPON_SRC
+	ammunition_dump.cc
+	barrel_gun.cc
+	base_weapon.cc
+	bullet.cc
+	bullet_manager.cc
+	weapon_station.cc
+)
+
+INCLUDE_DIRECTORIES(..)
+
+ADD_LIBRARY(weapon ${WEAPON_SRC})
Index: code/branches/FICN/src/orxonox/weapon/ammunition_dump.cc
===================================================================
--- code/branches/FICN/src/orxonox/weapon/ammunition_dump.cc	(revision 337)
+++ code/branches/FICN/src/orxonox/weapon/ammunition_dump.cc	(revision 337)
@@ -0,0 +1,109 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "run_manager.h"
+
+#include "ammunition_dump.h"
+
+
+namespace orxonox {
+namespace weapon {
+
+  AmmunitionDump::AmmunitionDump()
+    : numberOfAmmos_(RunManager::getSingletonPtr()->getNumberOfAmmos()),
+      stock_(new int[numberOfAmmos_]),
+      capacity_(new int[numberOfAmmos_])
+  {
+    for (int i = 0; i < numberOfAmmos_; i++)
+    {
+      stock_[i] = 0;
+      capacity_[i] = 0;
+    }
+  }
+
+
+  AmmunitionDump::~AmmunitionDump()
+  {
+    if (stock_)
+      delete stock_;
+    if (capacity_)
+      delete capacity_;
+  }
+
+  void AmmunitionDump::setDumpSize(const Ogre::String &name, int size)
+  {
+    if (size < 0)
+      return;
+    int id = RunManager::getSingletonPtr()->getAmmunitionID(name);
+    if (id == -1)
+      return;
+    capacity_[id] = size;
+  }
+
+  
+  int AmmunitionDump::store(const Ogre::String &name, int quantity)
+  {
+    int id = RunManager::getSingletonPtr()->getAmmunitionID(name);
+    if (id == -1)
+      return quantity;
+    stock_[id] += quantity;
+    if (stock_[id] > capacity_[id])
+    {
+      quantity = capacity_[id] - stock_[id];
+      stock_[id] = capacity_[id];
+      return quantity;
+    }
+    else
+      return 0;
+  }
+
+
+  int AmmunitionDump::getAmmunition(const Ogre::String &name, int quantity)
+  {
+    int id = RunManager::getSingletonPtr()->getAmmunitionID(name);
+    if (id == -1)
+      return 0;
+    if (stock_[id] >= quantity)
+      stock_[id] -= quantity;
+    else
+    {
+      quantity = stock_[id];
+      stock_[id] = 0;
+    }
+    return quantity;
+  }
+
+
+  int AmmunitionDump::getStockSize(const Ogre::String &name)
+  {
+    int id = RunManager::getSingletonPtr()->getAmmunitionID(name);
+    if (id = -1)
+      return -1;
+    return stock_[id];
+  }
+}
+}
Index: code/branches/FICN/src/orxonox/weapon/ammunition_dump.h
===================================================================
--- code/branches/FICN/src/orxonox/weapon/ammunition_dump.h	(revision 337)
+++ code/branches/FICN/src/orxonox/weapon/ammunition_dump.h	(revision 337)
@@ -0,0 +1,66 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef AmmunitionDump_H
+#define AmmunitionDump_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+namespace weapon {
+
+  class AmmunitionDump
+  {
+  public:
+    AmmunitionDump();
+	  ~AmmunitionDump();
+
+    void setDumpSize(const Ogre::String &name, int size);
+
+    int store(const Ogre::String &name, int quantiy);
+
+    int getAmmunition(const Ogre::String &name, int quantity);
+
+    int getStockSize(const Ogre::String &name);
+
+  protected:
+    int numberOfAmmos_;
+    int *stock_;
+    int *capacity_;
+
+  protected:
+
+  };
+
+}
+}
+
+#endif /* AmmunitionDump_H */
Index: code/branches/FICN/src/orxonox/weapon/barrel_gun.cc
===================================================================
--- code/branches/FICN/src/orxonox/weapon/barrel_gun.cc	(revision 337)
+++ code/branches/FICN/src/orxonox/weapon/barrel_gun.cc	(revision 337)
@@ -0,0 +1,140 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OgreMath.h"
+#include "OgreVector3.h"
+#include "OgreStringConverter.h"
+#include "OgreSceneNode.h"
+#include "OgreEntity.h"
+#include "OgreSceneManager.h"
+
+#include "bullet.h"
+#include "bullet_manager.h"
+#include "inertial_node.h"
+#include "ammunition_dump.h"
+#include "base_weapon.h"
+
+#include "barrel_gun.h"
+
+
+namespace orxonox {
+namespace weapon {
+  using namespace Ogre;
+
+  BarrelGun::BarrelGun(InertialNode *node, AmmunitionDump *ammoDump)
+        : BaseWeapon(node, ammoDump)
+  {
+    name_ = "Barrel Gun";
+    primaryFirePower_ = 100;
+    secondaryFirePower_ = 500;
+    primaryFiringRate_ = 10;
+    secondaryFiringRate_ = 2;
+    primaryBulletSpeed_ = 1000;
+    secondaryBulletSpeed_ = 500;
+    magazineSize_ = 25;
+  }
+
+
+  BarrelGun::~BarrelGun()
+  {
+  }
+
+
+  void BarrelGun::primaryFire()
+  {
+    if (leftAmmo_ < 1)
+    {
+      currentState_ = IDLE;
+      return;
+    }
+
+    SceneNode *temp = sceneMgr_->getRootSceneNode()->createChildSceneNode(
+          node_->getSceneNode()->getWorldPosition(),
+          node_->getSceneNode()->getWorldOrientation());
+
+    Entity* bulletEntity = sceneMgr_->createEntity("BulletEntity"
+          + StringConverter::toString(bulletCounter_++), "Barrel.mesh");
+
+    Vector3 speed = (temp->getOrientation() * Vector3(0, 0, -1))
+          .normalisedCopy() * primaryBulletSpeed_;
+    speed += node_->getWorldSpeed();
+
+	  temp->setScale(Vector3(1, 1, 1) * 4);
+	  temp->yaw(Degree(-90));
+
+	  bulletManager_->addBullet(new Bullet(temp, bulletEntity, speed));
+
+    --leftAmmo_;
+  }
+
+
+  void BarrelGun::primaryFiring(unsigned int time)
+  {
+    if (time > (unsigned int)1000/primaryFiringRate_)
+    {
+      currentState_ = IDLE;
+    }
+  }
+
+
+
+  void BarrelGun::secondaryFire()
+  {
+    if (leftAmmo_ < 5)
+    {
+      currentState_ = IDLE;
+      return;
+    }
+
+    SceneNode *temp = sceneMgr_->getRootSceneNode()->createChildSceneNode(
+          node_->getSceneNode()->getWorldPosition(),
+          node_->getSceneNode()->getWorldOrientation());
+
+    Entity* bulletEntity = sceneMgr_->createEntity("BulletEntity"
+          + StringConverter::toString(bulletCounter_++), "Barrel.mesh");
+
+    Vector3 speed = (temp->getOrientation() * Vector3(0, 0, -1))
+          .normalisedCopy() * secondaryBulletSpeed_*0.5;
+    speed += node_->getWorldSpeed();
+
+	  temp->setScale(Vector3(1, 1, 1) * 10);
+	  temp->yaw(Degree(-90));
+
+	  bulletManager_->addBullet(new Bullet(temp, bulletEntity, speed));
+
+    leftAmmo_ -= 5;
+  }
+
+
+  void BarrelGun::secondaryFiring(unsigned int time)
+  {
+    if (time > (unsigned int)1000/secondaryFiringRate_)
+      currentState_ = IDLE;
+  }
+
+}
+}
Index: code/branches/FICN/src/orxonox/weapon/barrel_gun.h
===================================================================
--- code/branches/FICN/src/orxonox/weapon/barrel_gun.h	(revision 337)
+++ code/branches/FICN/src/orxonox/weapon/barrel_gun.h	(revision 337)
@@ -0,0 +1,65 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef BARREL_GUN_H
+#define BARREL_GUN_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+namespace weapon {
+
+  class BarrelGun : public BaseWeapon
+  {
+ public:
+    BarrelGun(InertialNode*, AmmunitionDump*);
+	  virtual ~BarrelGun();
+
+    bool tick(unsigned long, Ogre::Real);
+
+  protected:
+    void primaryFire();
+
+    void primaryFiring(unsigned int);
+
+    void secondaryFire();
+
+    void secondaryFiring(unsigned int);
+
+  public:
+
+  protected:
+
+  };
+}
+}
+
+#endif /* BARREL_GUN_H */
Index: code/branches/FICN/src/orxonox/weapon/base_weapon.cc
===================================================================
--- code/branches/FICN/src/orxonox/weapon/base_weapon.cc	(revision 337)
+++ code/branches/FICN/src/orxonox/weapon/base_weapon.cc	(revision 337)
@@ -0,0 +1,180 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OgreMath.h"
+#include "OgreVector3.h"
+#include "OgreStringConverter.h"
+#include "OgreSceneNode.h"
+#include "OgreEntity.h"
+#include "OgreSceneManager.h"
+
+#include "bullet.h"
+#include "bullet_manager.h"
+#include "inertial_node.h"
+#include "ammunition_dump.h"
+#include "run_manager.h"
+
+#include "base_weapon.h"
+
+
+namespace orxonox {
+namespace weapon {
+  using namespace Ogre;
+
+  BaseWeapon::BaseWeapon(InertialNode *node, AmmunitionDump *ammoDump)
+    : sceneMgr_(RunManager::getSingletonPtr()->getSceneManagerPtr()), node_(node),
+      bulletCounter_(0), primaryFireRequest_(false), currentState_(IDLE),
+      secondaryFireRequest_(false),
+      bulletManager_(RunManager::getSingletonPtr()->getBulletManagerPtr()),
+      secondaryFired_(false),
+      timeSinceNextActionAdded_(0), actionAdded_(false), nextAction_(NOTHING),
+      ammoDump_(ammoDump)
+  {
+    leftAmmo_ = 0;
+  }
+
+
+  BaseWeapon::~BaseWeapon()
+  {
+  }
+
+
+  bool BaseWeapon::addAction(const Action act)
+  {
+    if (nextAction_ == NOTHING)
+    {
+      nextAction_ = act;
+      actionAdded_ = true;
+      return true;
+    }
+    else
+      return false;
+  }
+
+
+  void BaseWeapon::primaryFireRequest()
+  {
+    primaryFireRequest_ = true;
+  }
+
+
+  void BaseWeapon::secondaryFireRequest()
+  {
+    secondaryFireRequest_ = true;
+  }
+
+
+  bool BaseWeapon::tick(unsigned long time, Real deltaTime)
+  {
+    // process action adder
+    if (actionAdded_)
+    {
+      timeSinceNextActionAdded_ = time;
+      actionAdded_ = false;
+    }
+
+    if (currentState_ != IDLE)
+    {
+      switch (currentState_)
+      {
+      case PRIMARY_FIRE:
+        primaryFiring((unsigned int)(time - actionStartTime_));
+        break;
+
+      case SECONDARY_FIRE:
+        secondaryFiring((unsigned int)(time - actionStartTime_));
+        break;
+
+      case RELOADING:
+        break;
+
+      case CHANGING_AMMO:
+        break;
+      }
+    }
+
+    if (currentState_ == IDLE)
+    {
+      // first, process next action
+      if (nextAction_ != NOTHING)
+      {
+        actionStartTime_ = time;
+        switch (nextAction_)
+        {
+        case RELOAD:
+          leftAmmo_ += ammoDump_->getAmmunition("Barrel", magazineSize_ - leftAmmo_);
+          break;
+
+        case CHANGE_AMMO:
+          break;
+
+        case SPECIAL:
+          break;
+
+        default:
+          break;
+        }
+
+        // pay attention when multithreaded!
+        nextAction_ = NOTHING;
+      }
+      else
+      {
+        // secondly, execute firing
+        if (primaryFireRequest_ && !(secondaryFired_ && secondaryFireRequest_))
+        {
+          actionStartTime_ = time;
+          currentState_ = PRIMARY_FIRE;
+          secondaryFired_ = false;
+          primaryFire();
+        }
+        else if (secondaryFireRequest_)
+        {
+          actionStartTime_ = time;
+          currentState_ = SECONDARY_FIRE;
+          secondaryFired_ = true;
+          secondaryFire();
+        }
+      }
+    }
+
+    primaryFireRequest_ = false;
+    secondaryFireRequest_ = false;
+
+    if (time - timeSinceNextActionAdded_ > nextActionValidityPeriod_)
+      nextAction_ = NOTHING;
+
+    return true;
+  }
+
+
+  int BaseWeapon::getAmmoState()
+  {
+    return leftAmmo_;
+  }
+}
+}
Index: code/branches/FICN/src/orxonox/weapon/base_weapon.h
===================================================================
--- code/branches/FICN/src/orxonox/weapon/base_weapon.h	(revision 337)
+++ code/branches/FICN/src/orxonox/weapon/base_weapon.h	(revision 337)
@@ -0,0 +1,124 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef BASE_WEAPON_H
+#define BASE_WEAPON_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+namespace weapon {
+
+  class BaseWeapon
+  {
+  public:
+    enum Action {
+      NOTHING  = 0,
+      RELOAD   = 1,
+      CHANGE_AMMO  = 2,
+      SPECIAL  = 3
+    };
+
+  protected:
+    enum State {
+      IDLE = 0,
+      PRIMARY_FIRE = 1,
+      SECONDARY_FIRE = 2,
+      RELOADING = 3,
+      CHANGING_AMMO = 4,
+    };
+
+  public:
+    BaseWeapon(InertialNode*, AmmunitionDump*);
+	  virtual ~BaseWeapon();
+
+    bool addAction(const Action);
+
+    void primaryFireRequest();
+
+    void secondaryFireRequest();
+
+    int getAmmoState();
+
+    bool tick(unsigned long, Ogre::Real);
+
+  protected:
+    virtual void primaryFire() = 0;
+
+    virtual void primaryFiring(unsigned int) = 0;
+
+    virtual void secondaryFire() = 0;
+
+    virtual void secondaryFiring(unsigned int) = 0;
+
+  public:
+
+  protected:
+    Ogre::SceneManager *sceneMgr_;
+    //Ogre::SceneNode *node_;
+    InertialNode* node_;
+
+    int bulletCounter_;
+    BulletManager *bulletManager_;
+
+    AmmunitionDump *ammoDump_;
+
+    bool primaryFireRequest_;
+    bool secondaryFireRequest_;
+
+    unsigned long actionStartTime_;
+
+    State currentState_;
+    bool secondaryFired_;
+
+    Action nextAction_;
+    bool actionAdded_;
+    unsigned long timeSinceNextActionAdded_;
+    static const unsigned long nextActionValidityPeriod_ = 500;
+
+    // weapon properties
+    int leftAmmo_;
+    Ogre::String name_;
+    int primaryFirePower_;
+    int secondaryFirePower_;
+    int primaryFiringRate_;
+    int secondaryFiringRate_;
+    Ogre::Real primaryBulletSpeed_;
+    Ogre::Real secondaryBulletSpeed_;
+
+    int magazineSize_;
+
+  };
+
+}
+}
+
+#endif /* BASE_WEAPON_H */
Index: code/branches/FICN/src/orxonox/weapon/bullet.cc
===================================================================
--- code/branches/FICN/src/orxonox/weapon/bullet.cc	(revision 337)
+++ code/branches/FICN/src/orxonox/weapon/bullet.cc	(revision 337)
@@ -0,0 +1,51 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OgreSceneNode.h"
+#include "OgreEntity.h"
+#include "OgreVector3.h"
+
+#include "bullet.h"
+
+
+namespace orxonox {
+namespace weapon {
+  using namespace Ogre;
+
+  Bullet::Bullet(SceneNode *node, Entity *entity, Vector3 speed)
+    : node_(node), entity_(entity), speed_(speed)
+  {
+	  node_->attachObject(entity_);
+  }
+
+
+  Bullet::~Bullet()
+  {
+  }
+
+}
+}
Index: code/branches/FICN/src/orxonox/weapon/bullet.h
===================================================================
--- code/branches/FICN/src/orxonox/weapon/bullet.h	(revision 337)
+++ code/branches/FICN/src/orxonox/weapon/bullet.h	(revision 337)
@@ -0,0 +1,60 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef BULLET_H
+#define BULLET_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+namespace weapon {
+
+  class Bullet
+  {
+  public:
+	  Bullet(Ogre::SceneNode*, Ogre::Entity*, Ogre::Vector3);
+	  ~Bullet();
+
+  protected:
+
+  public:
+    Ogre::SceneNode *node_;
+	  Ogre::Entity *entity_;
+	  Ogre::Vector3 speed_;
+
+  protected:
+
+  };
+
+}
+}
+
+#endif /* BULLET_H */
Index: code/branches/FICN/src/orxonox/weapon/bullet_manager.cc
===================================================================
--- code/branches/FICN/src/orxonox/weapon/bullet_manager.cc	(revision 337)
+++ code/branches/FICN/src/orxonox/weapon/bullet_manager.cc	(revision 337)
@@ -0,0 +1,90 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OgreSceneManager.h"
+
+#include "bullet_manager.h"
+#include "bullet.h"
+
+
+namespace orxonox {
+namespace weapon {
+  using namespace Ogre;
+
+  BulletManager::BulletManager(SceneManager *sceneMgr) : sceneMgr_(sceneMgr),
+        bulletsIndex_(0), bulletsSize_(8)
+  {
+    bullets_ = new Bullet*[bulletsSize_];
+  }
+
+
+  BulletManager::~BulletManager()
+  {
+    // clean up the bullet list
+    if (bullets_)
+    {
+      for (int i = 0; i < bulletsIndex_; i++)
+        delete bullets_[i];
+      delete bullets_;
+    }
+  }
+
+
+  void BulletManager::addBullet(Bullet *bullet)
+  {
+    // resize array if neccessary (double the size then)
+    if (bulletsIndex_ >= bulletsSize_)
+    {
+      // redimension the array
+      Bullet **tempArray = new Bullet*[2*bulletsSize_];
+      for (int i = 0; i < bulletsSize_; i++)
+        tempArray[i] = bullets_[i];
+      bulletsSize_ *= 2;
+      delete bullets_;
+      bullets_ = tempArray;
+    }
+
+    // add the bullet to the list
+    bullets_[bulletsIndex_++] = bullet;
+  }
+
+
+  bool BulletManager::tick(unsigned long time, Real deltaTime)
+  {
+    // update the bullet positions
+    for (int i = 0; i < bulletsIndex_; i++)
+    {
+      bullets_[i]->node_->translate(bullets_[i]->speed_*deltaTime);
+      bullets_[i]->node_->yaw(Degree(deltaTime*100));
+      bullets_[i]->node_->roll(Degree(deltaTime*300));
+    }
+
+    return true;
+  }
+
+}
+}
Index: code/branches/FICN/src/orxonox/weapon/bullet_manager.h
===================================================================
--- code/branches/FICN/src/orxonox/weapon/bullet_manager.h	(revision 337)
+++ code/branches/FICN/src/orxonox/weapon/bullet_manager.h	(revision 337)
@@ -0,0 +1,66 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef BULLET_MANAGER_H
+#define BULLET_MANAGER_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+namespace weapon {
+
+  class BulletManager
+  {
+  public:
+    BulletManager(Ogre::SceneManager*);
+	  virtual ~BulletManager();
+
+    void addBullet(Bullet*);
+
+    bool tick(unsigned long, Ogre::Real);
+
+  protected:
+
+  public:
+    Ogre::SceneManager *sceneMgr_;
+
+  protected:
+    // Bullet array
+	  Bullet **bullets_;
+	  int bulletsSize_;
+	  int bulletsIndex_;
+
+  };
+
+}
+}
+
+#endif /* BULLET_MANAGER_H */
Index: code/branches/FICN/src/orxonox/weapon/weapon_station.cc
===================================================================
--- code/branches/FICN/src/orxonox/weapon/weapon_station.cc	(revision 337)
+++ code/branches/FICN/src/orxonox/weapon/weapon_station.cc	(revision 337)
@@ -0,0 +1,80 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OgreMath.h"
+#include "OgreVector3.h"
+#include "OgreStringConverter.h"
+#include "OgreSceneNode.h"
+#include "OgreEntity.h"
+#include "OgreSceneManager.h"
+
+#include "base_weapon.h"
+
+#include "weapon_station.h"
+
+
+namespace orxonox {
+namespace weapon {
+  using namespace Ogre;
+
+  WeaponStation::WeaponStation(int stationSize)
+        : stationSize_(stationSize), lastActiveSlotIndex_(-1),
+        slots_(new BaseWeapon*[stationSize])
+  {
+  	//slots_ = new BaseWeapon*[stationSize];
+  }
+
+
+  WeaponStation::~WeaponStation()
+  {
+    if (slots_)
+      delete slots_;
+    // when factory available: delete weapons too
+  }
+
+
+  bool WeaponStation::addWeapon(BaseWeapon *weapon)
+  {
+    if (lastActiveSlotIndex_ = stationSize_ - 1)
+      return false;
+
+    // this is ugly, but for the time being, it has to fit.
+    slots_[++lastActiveSlotIndex_] = weapon;
+    selectedSlot_ = slots_ + lastActiveSlotIndex_;
+    return true;
+  }
+
+
+  BaseWeapon* WeaponStation::selectWeapon(int slotNumber)
+  {
+    if (slotNumber < lastActiveSlotIndex_)
+      return NULL;
+    return slots_[slotNumber];
+  }
+
+}
+}
Index: code/branches/FICN/src/orxonox/weapon/weapon_station.h
===================================================================
--- code/branches/FICN/src/orxonox/weapon/weapon_station.h	(revision 337)
+++ code/branches/FICN/src/orxonox/weapon/weapon_station.h	(revision 337)
@@ -0,0 +1,69 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef WEAPON_STATION_H
+#define WEAPON_STATION_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+namespace weapon {
+
+  class WeaponStation
+  {
+  public:
+    WeaponStation(int slotSize);
+	  ~WeaponStation();
+
+    bool addWeapon(BaseWeapon*);
+
+    //bool removeCurrentWeapon();
+
+    // TODO: access every weapon by name
+    BaseWeapon* selectWeapon(int slotNumber);
+
+  protected:
+
+  public:
+
+  protected:
+    // slot management
+    BaseWeapon **slots_;
+    BaseWeapon **selectedSlot_;
+    int lastActiveSlotIndex_;
+    int stationSize_;
+
+  };
+
+}
+}
+
+#endif /* WEAPON_STATION_H */
Index: code/branches/FICN/src/orxonox_prerequisites.h
===================================================================
--- code/branches/FICN/src/orxonox_prerequisites.h	(revision 337)
+++ code/branches/FICN/src/orxonox_prerequisites.h	(revision 337)
@@ -0,0 +1,64 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef ORXONOX_PREREQUISITES_H
+#define ORXONOX_PREREQUISITES_H
+
+namespace orxonox {
+
+  class CameraManager;
+  class InertialNode;
+  class OgreControl;
+  class Orxonox;
+  class OrxonoxShip;
+  class OrxonoxScene;
+  class RunManager;
+
+
+  namespace weapon {
+
+    class AmmunitionDump;
+    class Bullet;
+    class BulletManager;
+    class BaseWeapon;
+    class BarrelGun;
+    class WeaponStation;
+
+  }
+
+
+  namespace hud {
+    
+    class HUDOverlay;
+    class TestOverlay;
+
+  }
+
+}
+
+#endif /* ORXONOX_PREREQUISITES_H */
Index: code/branches/FICN/src/orxonox_scene.cc
===================================================================
--- code/branches/FICN/src/orxonox_scene.cc	(revision 337)
+++ code/branches/FICN/src/orxonox_scene.cc	(revision 337)
@@ -0,0 +1,155 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OgreSceneManager.h"
+#include "OgreSceneNode.h"
+#include "OgreEntity.h"
+#include "OgreLight.h"
+#include "OgreBillboard.h"
+#include "OgreBillboardSet.h"
+#include "OgreVector3.h"
+
+#include "orxonox_scene.h"
+
+namespace orxonox {
+  using namespace Ogre;
+
+  /**
+  * The orxonox scene includes everything running in the background like terrain,
+  * static figures, dangling lamp, etc.
+  */
+
+
+  /**
+  * Empty Consructor except the initialiser list.
+  * @param sceneMgr The Scene Manager.
+  */
+  OrxonoxScene::OrxonoxScene(SceneManager *sceneMgr) : sceneMgr_(sceneMgr)
+  {
+  }
+
+  /**
+  * Empty Destructor.
+  */
+  OrxonoxScene::~OrxonoxScene()
+  {
+  }
+
+  /**
+  * Ogre initialisation method.
+  * This function is called by the Run Manager to load the neccessary recources
+  * and to create the scene.
+  * @return False if failed.
+  */
+  bool OrxonoxScene::initialise()
+  {
+	  // Load resources
+	  loadResources();
+
+	  distance_ = 0;
+	  radius_ = 100;
+
+	  createScene();
+
+	  return true;
+  }
+
+
+  /**
+  * Resource loader.
+  * Currently, this method loads everything! TODO: If done this ugly, it should
+  * at least be in the Run Manager.
+  */
+  void OrxonoxScene::loadResources()
+  {
+	  // Initialise, parse scripts etc
+	  ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
+  }
+
+
+  /**
+  * Scene creation.
+  * Currently just a test scene with an ogre head an a surrounding light.
+  */
+  void OrxonoxScene::createScene()
+  {
+	  sceneMgr_->setAmbientLight(ColourValue(0.3,0.3,0.3)*2);
+
+	  //create first entity
+	  Entity *head = sceneMgr_->createEntity("head", "ogrehead.mesh");
+
+	  //create a scene node to attach the head to
+	  SceneNode *node = sceneMgr_->getRootSceneNode()
+          ->createChildSceneNode("OgreHeadNode", Vector3(0,0,0));
+	  //attach the ogre head
+	  node->attachObject(head);
+
+	  // set up skybox
+	  sceneMgr_->setSkyBox(true, "Examples/SceneSkyBox1");
+
+	  // set up one light_ source
+	  light_ = sceneMgr_->createLight("Light1");
+	  light_->setType(Light::LT_POINT);
+	  light_->setPosition(Vector3(0, 0, 0));
+	  light_->setDiffuseColour(1.0, 1.0, 1.0);
+	  light_->setSpecularColour(1.0, 1.0, 1.0);
+
+	  //create billboard
+	  bbs_ = sceneMgr_->createBillboardSet("bb", 1);
+	  bbs_->createBillboard(Vector3::ZERO, ColourValue(1.0, 1.0, 1.0));
+	  bbs_->setMaterialName("Examples/Flare");
+
+	  lightNode_ = sceneMgr_->getRootSceneNode()
+          ->createChildSceneNode("lightNode_", Vector3(0, 100, 0));
+
+	  lightNode_->attachObject(bbs_);
+	  lightNode_->attachObject(light_);
+  }
+
+
+  /**
+  * Compute something between frames if neccessary.
+  * @param time Absolute time.
+  * @param deltaTime Relative time.
+  * @return Return true to continue rendering.
+  */
+  bool OrxonoxScene::tick(unsigned long time, Real deltaTime)
+  {
+	  Real t = time/1000.0;
+
+	  lightNode_->setPosition(radius_*sin(5*t), radius_*cos(5*t), sin(1*t)*distance_);
+  	
+	  light_->setDiffuseColour(sin(1*t), sin(1*t + 2.09), sin(1*t + 2.09*2));
+	  light_->setSpecularColour(sin(1*t), sin(1*t + 2.09), sin(1*t + 2.09*2));
+
+	  bbs_->getBillboard(0)->setColour(ColourValue(sin(1*t),
+          sin(1*t + 2.09), sin(1*t + 2.09*2)));
+    
+    return true;
+  }
+
+}
Index: code/branches/FICN/src/orxonox_scene.h
===================================================================
--- code/branches/FICN/src/orxonox_scene.h	(revision 337)
+++ code/branches/FICN/src/orxonox_scene.h	(revision 337)
@@ -0,0 +1,70 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef ORXONOX_SCENE_H
+#define ORXONOX_SCENE_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+
+  class OrxonoxScene
+  {
+  public:
+    OrxonoxScene(Ogre::SceneManager*);
+
+	  virtual ~OrxonoxScene();
+
+	  virtual bool initialise();
+
+	  virtual bool tick(unsigned long, Ogre::Real);
+
+  protected:
+	  /// method where you can perform resource group loading
+	  virtual void loadResources();
+
+	  /// Define what is in the scene
+	  virtual void createScene();
+
+  protected:
+	  Ogre::SceneManager* sceneMgr_;
+
+	  //specific variables for test purposes
+	  Ogre::Light        *light_;
+	  Ogre::SceneNode    *lightNode_;
+	  Ogre::BillboardSet *bbs_;
+	  Ogre::Real distance_;
+    Ogre::Real radius_;
+  };
+
+}
+
+#endif /* ORXONOX_SCENE_H */
Index: code/branches/FICN/src/orxonox_ship.cc
===================================================================
--- code/branches/FICN/src/orxonox_ship.cc	(revision 337)
+++ code/branches/FICN/src/orxonox_ship.cc	(revision 337)
@@ -0,0 +1,254 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OgreMath.h"
+#include "OgreVector3.h"
+#include "OgreQuaternion.h"
+#include "OgreSceneNode.h"
+#include "OgreEntity.h"
+#include "OgreSceneManager.h"
+#include "OgreParticleSystem.h"
+
+#include "inertial_node.h"
+#include "run_manager.h"
+#include "weapon/bullet.h"
+#include "weapon/bullet_manager.h"
+#include "weapon/weapon_station.h"
+#include "weapon/base_weapon.h"
+#include "weapon/barrel_gun.h"
+#include "weapon/ammunition_dump.h"
+
+#include "orxonox_ship.h"
+
+
+namespace orxonox {
+  using namespace Ogre;
+  using namespace weapon;
+
+  /**
+  * Base class for any kind of flyable ship in Orxonox.
+  * 
+  * The ship offers steering methods (like left, right, etc.) and translates
+  * them into movement. A ship can also hold more than one weapons (where each
+  * of these can be replaced during the game). This means that a ship can have
+  * many WeaponManagers but only one MunitionManager (independant object that
+  * is referenced in each WeaponManager).
+  * Furthermore a ship in Orxonox is responsible for its visualization, which is
+  * why it receives a pointer to the SceneManager.
+  */
+
+
+  /**
+  * Standard constructor, that only initalizes a few variables. Some of them
+  * could be made static, since any new ship would be derived from the BaseShip.
+  * Or even better: write config files for each ship so that manipulating
+  * its properties would be even easier.
+  * @param mSceneMgr The current main SceneManager
+  * @param mNode The scene node which the ship will be attached to later.
+  */
+  OrxonoxShip::OrxonoxShip(SceneNode *node)
+    : sceneMgr_(RunManager::getSingletonPtr()->getSceneManagerPtr()),
+      bulletManager_(RunManager::getSingletonPtr()->getBulletManagerPtr()),
+      baseThrust_(1000), currentThrust_(Vector3::ZERO), objectCounter_(0)
+  {
+    rootNode_ = new InertialNode(node, Vector3::ZERO);
+  }
+
+
+  /**
+  * Standard destructor.
+  * Doesn't have any work to do yet.
+  */
+  OrxonoxShip::~OrxonoxShip()
+  {
+    if (mainWeapon_)
+      delete mainWeapon_;
+    if (railGunStation_)
+      delete railGunStation_;
+    if (rootNode_)
+      delete rootNode_;
+  }
+
+
+  /**
+  * Initialises everything.
+  * Once that ResourceGroups are organised, this method loads them.
+  * It might be an idea to make this function static in order for the
+  * SceneManger to call the initialise method of every needed class (macros..)
+  * @return Returns false when failed.
+  */
+  bool OrxonoxShip::initialise()
+  {
+	  // load all the resources needed (no resource groups yet,
+    // so the allInit is not executed!)
+	  // ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
+
+	  // create the "space ship" (currently a fish..)
+	  // TODO: names must be unique! use static variables..
+	  shipEntity_ = sceneMgr_->createEntity("Ship", "fish.mesh");
+	  InertialNode *fishNode = rootNode_->createChildNode();
+    fishNode->getSceneNode()->yaw(Degree(-90));
+	  fishNode->getSceneNode()->attachObject(shipEntity_);
+	  fishNode->getSceneNode()->setScale(Vector3(10, 10, 10));
+
+    // initialise weapon(s)
+    ammoDump_ = new AmmunitionDump();
+    ammoDump_->setDumpSize("Barrel", 1000);
+    ammoDump_->store("Barrel", 420);
+
+    InertialNode *mainWeaponNode = rootNode_->createChildNode();
+    mainWeapon_ = new BarrelGun(mainWeaponNode, ammoDump_);
+
+    railGunStation_ = new WeaponStation(4);
+    railGunStation_->addWeapon(mainWeapon_);
+    railGunStation_->selectWeapon(0);
+
+    // create some nice effects
+
+    ParticleSystem *particles = RunManager::getSingletonPtr()
+      ->getSceneManagerPtr()->createParticleSystem("asdf", "Examples/Smoke");
+
+    fishNode->getSceneNode()->attachObject(particles);
+
+
+
+
+	  return true;
+  }
+
+
+  /**
+  * Gets the ship to accelerate in the current direction.
+  * The value should be between 0 and 1, with one beeing full thrust and 0 none
+  * @param value Acceleration between 0 and 1
+  */
+  void OrxonoxShip::setMainThrust(const Real value)
+  {
+    currentThrust_.z = value * baseThrust_;
+  }
+
+
+  /**
+  * Gets the ship to accelerate sideways regarding the current direction.
+  * The value should be between 0 and 1, with one beeing full thrust and 0 none
+  * @param value Acceleration between 0 and 1
+  */
+  void OrxonoxShip::setSideThrust(const Real value)
+  {
+    currentThrust_.x = value * baseThrust_;
+  }
+
+
+  /**
+  * Gets the ship to accelerate up and down.
+  * The value should be between 0 and 1, with one beeing full thrust and 0 none
+  * @param value Acceleration between 0 and 1
+  */
+  void OrxonoxShip::setYThrust(const Real value)
+  {
+    currentThrust_.y = value * baseThrust_;
+  }
+
+
+  /**
+  * Rotate the ship along with the camera up and down.
+  * @param angle Pitch value.
+  */
+  void OrxonoxShip::turnUpAndDown(const Radian &angle)
+  {
+    rootNode_->getSceneNode()->pitch(-angle, Node::TS_LOCAL);
+  }
+
+
+  /**
+  * Rotate the ship along with the camera left and right.
+  * @param angle Yaw value.
+  */
+  void OrxonoxShip::turnLeftAndRight(const Radian &angle)
+  {
+    rootNode_->getSceneNode()->yaw(-angle, Node::TS_PARENT);
+  }
+
+
+  /**
+  * Returns the current speed of the ship according to its parent node.
+  * @return The current speed.
+  */
+  Vector3 OrxonoxShip::getSpeed()
+  {
+    return rootNode_->getSpeed();
+  }
+
+  /**
+  * Returns the ship's root SceneNode.
+  * @return The Root Node.
+  */
+  InertialNode* OrxonoxShip::getRootNode()
+  {
+    return rootNode_;
+  }
+
+
+  /**
+  * Fire a bullet (Entity with SceneNode).
+  * This method creates a new Entity plus a SceneNode. But be sure not make
+  * the new Node a child of RootNode_!
+  * @return Bullet containing speed and entity.
+  */
+  BaseWeapon* OrxonoxShip::getMainWeapon()
+  {
+    return mainWeapon_;
+  }
+
+
+  int OrxonoxShip::getAmmoStock()
+  {
+    return ammoDump_->getStockSize("Barrel");
+  }
+
+
+  /**
+  * Standard tick() function.
+  * Currently, only the speed is applied according to the thrust values.
+  * @param time Absolute time.
+  * @param deltaTime Relative time.
+  * @return Return true to continue render
+  */
+  bool OrxonoxShip::tick(unsigned long time, Real deltaTime)
+  {
+    mainWeapon_->tick(time, deltaTime);
+
+    Quaternion quad = rootNode_->getSceneNode()->getOrientation();
+    quad.normalise();
+    rootNode_->addSpeed(quad * (Vector3(-1, -1, -1) * currentThrust_) * deltaTime);
+
+    rootNode_->getSceneNode()->translate(rootNode_->getSpeed() * deltaTime);
+
+	  return true;
+  }
+
+}
Index: code/branches/FICN/src/orxonox_ship.h
===================================================================
--- code/branches/FICN/src/orxonox_ship.h	(revision 337)
+++ code/branches/FICN/src/orxonox_ship.h	(revision 337)
@@ -0,0 +1,86 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef ORXONOX_SHIP_H
+#define ORXONOX_SHIP_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+
+  class OrxonoxShip
+  {
+  public:
+    OrxonoxShip(Ogre::SceneNode*);
+	  virtual ~OrxonoxShip();
+
+	  virtual bool initialise();
+
+	  void setMainThrust(const Ogre::Real);
+	  void setSideThrust(const Ogre::Real);
+    void setYThrust(const Ogre::Real);
+	  void turnUpAndDown(const Ogre::Radian&);
+	  void turnLeftAndRight(const Ogre::Radian&);
+
+    InertialNode* getRootNode();
+    Ogre::Vector3 getSpeed();
+
+    weapon::BaseWeapon* getMainWeapon();
+
+    int getAmmoStock();
+
+	  bool tick(unsigned long, Ogre::Real);
+
+  protected:
+
+  protected:
+	  Ogre::SceneManager *sceneMgr_;
+	  //Ogre::SceneNode *rootNode_;
+    InertialNode *rootNode_;
+	  Ogre::Entity *shipEntity_;
+
+	  //Ogre::Vector3 currentSpeed_;  // relative to space
+	  Ogre::Vector3 currentThrust_; // relative to the ship
+    Ogre::Real baseThrust_;
+	  int objectCounter_;
+
+    weapon::BulletManager *bulletManager_;
+	  //Ogre::Vector3 bulletSpeed_;
+
+    weapon::BaseWeapon *mainWeapon_;
+    weapon::WeaponStation *railGunStation_;
+
+    weapon::AmmunitionDump *ammoDump_;
+  };
+
+}
+
+#endif /* ORXONOX_SHIP_H */
Index: code/branches/FICN/src/run_manager.cc
===================================================================
--- code/branches/FICN/src/run_manager.cc	(revision 337)
+++ code/branches/FICN/src/run_manager.cc	(revision 337)
@@ -0,0 +1,512 @@
+/*
+*   ORXONOX - the hottest 3D action shooter ever to exist
+*
+*
+*   License notice:
+*
+*   This program is free software: you can redistribute it and/or modify
+*   it under the terms of the GNU General Public License as published by
+*   the Free Software Foundation, either version 3 of the License, or
+*   (at your option) any later version.
+*
+*   This program is distributed in the hope that it will be useful,
+*   but WITHOUT ANY WARRANTY; without even the implied warranty of
+*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*   GNU General Public License for more details.
+*
+*   You should have received a copy of the GNU General Public License
+*   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*   Author:
+*      Reto Grieder
+*   Co-authors:
+*      ...
+*/
+
+
+#include "OgreVector3.h"
+#include "OgreStringConverter.h"
+#include "OgreRoot.h"
+#include "OgreSceneManager.h"
+#include "OgreSceneNode.h"
+#include "OgreCamera.h"
+#include "OgreViewport.h"
+#include "OgreRenderWindow.h"
+#include "OgreTextureManager.h"
+#include "OgreMaterialManager.h"
+#include "OgreLogManager.h"
+#include "OgreWindowEventUtilities.h"
+
+//Use this define to signify OIS will be used as a DLL
+//(so that dll import/export macros are in effect)
+#define OIS_DYNAMIC_LIB
+#include <OIS/OIS.h>
+
+#include "ogre_control.h"
+#include "orxonox_scene.h"
+#include "orxonox_ship.h"
+#include "inertial_node.h"
+
+#include "weapon/bullet.h"
+#include "weapon/bullet_manager.h"
+#include "weapon/base_weapon.h"
+
+#include "hud/hud_overlay.h"
+#include "hud/test_overlay.h"
+
+#include "run_manager.h"
+
+
+namespace orxonox {
+  using namespace Ogre;
+  using namespace weapon;
+  using namespace hud;
+
+  /**
+  * RunManager is the basic control object during the game.
+  * 
+  * The RunManger class is designed to actually "run" the main part of the
+  * game. The Idea is, that you could derive from the RunManager in order
+  * to distinguish between a first person shooter or a space craft shooter.
+  * RunManager loads and initialises everything in the scene (like the ship,
+  * the enemies in the scene, any scripts, the physics, window events,
+  * environment, HUD, etc.).
+  * It also captures any input from keyboard, mous, joystick (optional) or
+  * Ogre (window events).
+  */
+
+
+  RunManager* RunManager::singletonPtr_s = NULL;
+
+
+  /**
+  * Contructor only needs the Root object.
+  */
+  RunManager::RunManager()
+        : ogre_(NULL), window_(NULL), screenShotCounter_(0),
+        timeUntilNextToggle_(0), mouseSensitivity_(0.003), inputManager_(0),
+        mouse_(0), keyboard_(0), joystick_(0), statsOn_(true)
+  {
+  }
+
+  /**
+  * @param ogre_ The OgreControl object holding the render window and the Root
+  */
+  void RunManager::initialise(OgreControl *ogre)
+    {
+    ogre_ = ogre;
+    window_ = ogre->getRenderWindow();
+
+    // SETTING UP THE SCENE
+
+    // create one new SceneManger
+    sceneMgr_ = ogre_->getRoot()->createSceneManager(ST_GENERIC, "Orxonox Scene");
+
+    // background scene (world objects, skybox, lights, etc.)
+    backgroundScene_ = new OrxonoxScene(sceneMgr_);
+
+
+    // BULLET LIST FOR THE TEST APPLICATION
+
+    // create a bullet manager
+    bulletManager_ = new BulletManager(sceneMgr_);
+
+
+    // PLAYER SPACESHIP
+
+    // Create a space ship object and its SceneNode.
+    // It should also be considered, that the ship should provide another Node
+    // for a camera to be attached (otherwise the spaceship in front of the
+    // ship would be very static, never moving at all).
+
+    // Construct a new spaceship and give it the node
+    playerShip_ = new OrxonoxShip(sceneMgr_->getRootSceneNode()
+      ->createChildSceneNode("ShipNode", Vector3(20, 20, 20)));
+
+
+    // RESOURCE LOADING (using ResourceGroups if implemented)
+
+    // load all resources and create the entities by calling the initialise()
+    // methods for each object (no constructor initialisations!).
+    backgroundScene_->initialise();
+    playerShip_->initialise();
+
+
+    // CAMERA AND VIEWPORT
+
+    // create camera and viewport
+    createCamera();
+    createViewports();
+
+    // create HUD
+    hud_ = new hud::TestOverlay(window_);
+    hud_->show();
+
+
+    // Set default mipmap level (NB some APIs ignore this)
+    TextureManager::getSingleton().setDefaultNumMipmaps(5);
+
+
+    // HUMAN INTERFACE
+
+    using namespace OIS;    
+
+    LogManager::getSingletonPtr()->logMessage("*** Initializing OIS ***");
+    ParamList pl;
+    size_t windowHnd = 0;
+    std::ostringstream windowHndStr;
+
+    window_->getCustomAttribute("WINDOW", &windowHnd);
+    windowHndStr << windowHnd;
+    pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
+
+    inputManager_ = InputManager::createInputSystem( pl );
+
+    // Create all devices (We only catch joystick exceptions here,
+    // as, most people have Key/Mouse)
+    keyboard_ = static_cast<Keyboard*>(inputManager_
+      ->createInputObject( OISKeyboard, false ));
+    mouse_ = static_cast<Mouse*>(inputManager_
+      ->createInputObject( OISMouse, false ));
+    try {
+      joystick_ = static_cast<JoyStick*>(inputManager_
+        ->createInputObject( OISJoyStick, false ));
+    }
+    catch(...) {
+      joystick_ = 0;
+    }
+
+    //Set initial mouse clipping size
+    windowResized(window_);
+
+    //showDebugOverlay(true);
+
+    // REGISTER THIS OBJECT AS A WINDOW EVENT LISTENER IN OGRE
+    // It will then receive events liek windowClosed, windowResized, etc.
+    WindowEventUtilities::addWindowEventListener(window_, this);
+  }
+
+  /**
+  * Standard destructor.
+  * Removes this object as a window event listener and deletes all created
+  * variables.
+  */
+  RunManager::~RunManager()
+  {
+    //Remove ourself as a Window listener
+    WindowEventUtilities::removeWindowEventListener(window_, this);
+    windowClosed(window_);
+
+    if (backgroundScene_)
+      delete backgroundScene_;
+    if (playerShip_)
+      delete playerShip_;
+    if (bulletManager_)
+      delete bulletManager_;
+    if (hud_)
+      delete hud_;
+  }
+
+
+  /**
+  * Method to compute anything between 2 frames.
+  * 
+  * Everything that needs to be computed during the games happens right here.
+  * The only exception are the listeners (which should only set variables,
+  * not actually do something).
+  * 
+  * @param time Absolute play time
+  * @param deltaTime Time passed since last frame
+  * @return Return false to end rendering
+  */
+  bool RunManager::tick(unsigned long time, float deltaTime)
+  {
+    // synchronize with internal class timer
+    totalTime_ = time;
+
+    // Call tick() for every object
+    // This could be done by registering (needs a factory..)
+    backgroundScene_->tick(time, deltaTime);
+    playerShip_->tick(time, deltaTime);
+
+
+    // Update the HUD
+    Ogre::String tempStr = " | Speed = "
+      + StringConverter::toString(playerShip_->getSpeed())
+      + " | Left Ammo = "
+      + StringConverter::toString(playerShip_
+      ->getMainWeapon()->getAmmoState())
+      + " | Ammo stock = "
+      + StringConverter::toString(playerShip_->getAmmoStock());
+    hud_->setDebugText(tempStr);
+
+    hud_->tick(time, deltaTime);
+
+    // update the bullet positions
+    bulletManager_->tick(time, deltaTime);
+
+
+    // HUMAN INTERFACE
+
+    using namespace OIS;
+
+    if(window_->isClosed())	return false;
+
+    //Need to capture/update each device
+    keyboard_->capture();
+    mouse_->capture();
+    if( joystick_ ) joystick_->capture();
+
+    bool buffJ = (joystick_) ? joystick_->buffered() : true;
+
+    //Check if one of the devices is not buffered
+    if( !mouse_->buffered() || !keyboard_->buffered() || !buffJ )
+    {
+      // one of the input modes is immediate, so setup what
+      // is needed for immediate movement
+      if (timeUntilNextToggle_ >= 0)
+        timeUntilNextToggle_ -= deltaTime;
+    }
+
+    // handle HID devices
+    if( processUnbufferedKeyInput() == false )
+        return false;
+    if( processUnbufferedMouseInput() == false )
+        return false;
+
+    // keep rendering
+    return true;
+  }
+
+
+  SceneManager& RunManager::getSceneManager()
+  {
+    return *sceneMgr_;
+  }
+
+  SceneManager* RunManager::getSceneManagerPtr()
+  {
+    return sceneMgr_;
+  }
+
+  BulletManager* RunManager::getBulletManagerPtr()
+  {
+    return bulletManager_;
+  }
+
+  int RunManager::getAmmunitionID(const Ogre::String &ammoName)
+  {
+    Ogre::String ammoTypes[] = { "Energy Cell", "Barrel", "Lead Shot" };
+    int ammoTypesLength = 3;
+
+    for (int i = 0; i < ammoTypesLength; i++)
+    {
+      if (ammoTypes[i] == ammoName)
+        return i;
+    }
+    return -1;
+  }
+
+  int RunManager::getNumberOfAmmos()
+  {
+    return 3;
+  }
+
+
+  /**
+  * Adjust mouse clipping area.
+  * This method is called by Ogre without regards of tick()!
+  * Avoid doing too much in this call.
+  * @param rw render window
+  */
+  void RunManager::windowResized(RenderWindow* rw)
+  {
+    unsigned int width, height, depth;
+    int left, top;
+    rw->getMetrics(width, height, depth, left, top);
+
+    const OIS::MouseState &ms = mouse_->getMouseState();
+    ms.width = width;
+    ms.height = height;
+  }
+
+
+  /**
+  * Unattach OIS before window shutdown (very important under Linux).
+  * Again, avoid computing a lot in this function.
+  * @param rw Render Window
+  */
+  void RunManager::windowClosed(RenderWindow* rw)
+  {
+    //Only close for window that created OIS (the main window in these demos)
+    if( rw == window_ )
+    {
+      if( inputManager_ )
+      {
+        inputManager_->destroyInputObject( mouse_ );
+        inputManager_->destroyInputObject( keyboard_ );
+        inputManager_->destroyInputObject( joystick_ );
+
+        OIS::InputManager::destroyInputSystem(inputManager_);
+        inputManager_ = 0;
+      }
+    }
+  }
+
+  /**
+  * Processes the Keyboard input.
+  * TODO: Use listeners to improve performance.
+  * A lookup table should be implemented to bind any key to a specific action.
+  * @return Return true to keep rendering
+  */
+  bool RunManager::processUnbufferedKeyInput()
+  {
+    using namespace OIS;
+
+    if(keyboard_->isKeyDown(KC_A) || keyboard_->isKeyDown(KC_LEFT))
+      playerShip_->setSideThrust(1);
+    else if(keyboard_->isKeyDown(KC_D) || keyboard_->isKeyDown(KC_RIGHT))
+      playerShip_->setSideThrust(-1);
+    else
+      playerShip_->setSideThrust(0);
+
+    if(keyboard_->isKeyDown(KC_UP) || keyboard_->isKeyDown(KC_W) )
+      playerShip_->setMainThrust(1);
+    else if(keyboard_->isKeyDown(KC_DOWN) || keyboard_->isKeyDown(KC_S) )
+      playerShip_->setMainThrust(-1);
+    else
+      playerShip_->setMainThrust(0);
+
+    if (keyboard_->isKeyDown(KC_C))
+      playerShip_->setYThrust(1);
+    else if (keyboard_->isKeyDown(KC_SPACE))
+      playerShip_->setYThrust(-1);
+    else
+      playerShip_->setYThrust(0);
+
+    if (keyboard_->isKeyDown(KC_G))
+      playerShip_->getMainWeapon()->addAction(BaseWeapon::RELOAD);
+
+    if( keyboard_->isKeyDown(KC_ESCAPE) || keyboard_->isKeyDown(KC_Q) )
+      return false;
+
+    if( keyboard_->isKeyDown(KC_F) && timeUntilNextToggle_ <= 0 )
+    {
+      statsOn_ = !statsOn_;
+      timeUntilNextToggle_ = 1;
+    }
+
+    if(keyboard_->isKeyDown(KC_SYSRQ) && timeUntilNextToggle_ <= 0)
+    {
+      std::ostringstream ss;
+      ss << "screenshot_" << ++screenShotCounter_ << ".png";
+      window_->writeContentsToFile(ss.str());
+      timeUntilNextToggle_ = 0.5;
+    }
+
+    // Return true to continue rendering
+    return true;
+  }
+
+
+  /**
+  * Processes the Mouse input.
+  * TODO: Use listeners to improve performance.
+  * A lookup table should be implemented to bind ANY button or movement
+  * to a specific action.
+  * @return Return true to keep rendering
+  */
+  bool RunManager::processUnbufferedMouseInput()
+  {
+    using namespace OIS;
+
+    const MouseState &ms = mouse_->getMouseState();
+
+    if (ms.buttonDown(MB_Left))
+      playerShip_->getMainWeapon()->primaryFireRequest();
+
+    if (ms.buttonDown(MB_Right))
+      playerShip_->getMainWeapon()->secondaryFireRequest();
+
+    playerShip_->turnUpAndDown(Radian(ms.Y.rel * mouseSensitivity_));
+    playerShip_->turnLeftAndRight(Radian(ms.X.rel * mouseSensitivity_));
+
+    // keep rendering
+    return true;
+  }
+
+  /**
+  * Show an overlay desired.
+  * @param show Whether or not to show the debug overlay
+  */
+  void RunManager::showDebugOverlay(bool show)
+  {
+    if (hud_)
+    {
+      if (show)
+        hud_->show();
+      else
+        hud_->hide();
+    }
+  }
+
+
+  /**
+  * Simple camera creator.
+  * playerShip_Node->attachObject(camera_) should not be here! This is what
+  * the camera manager is for. Right now, this method should do just fine,
+  * setting the cam behind the ship.
+  */
+  void RunManager::createCamera()
+  {
+    camera_ = sceneMgr_->createCamera("PlayerCam");
+    playerShip_->getRootNode()->getSceneNode()->attachObject(camera_);
+    camera_->setNearClipDistance(5);
+    camera_->setPosition(Vector3(0,10,500));
+    camera_->lookAt(Vector3(0,0,0));
+  }
+
+  /**
+  * Simple viewport creator.
+  * For now the viewport uses the entire render window and is based on the one
+  * camera created so far.
+  */
+  void RunManager::createViewports()
+  {
+    // Create one viewport, entire window
+    Viewport* vp = window_->addViewport(camera_);
+    vp->setBackgroundColour(ColourValue(0,0,0));
+
+    // Alter the camera aspect ratio to match the viewport
+    camera_->setAspectRatio(
+      Real(vp->getActualWidth()) / Real(vp->getActualHeight()));
+  }
+
+
+  RunManager* RunManager::createSingleton()
+  {
+    if (singletonPtr_s)
+      return NULL;
+    singletonPtr_s = new RunManager();
+    return singletonPtr_s;
+  }
+
+  void RunManager::destroySingleton()
+  {
+    if (singletonPtr_s)
+      delete singletonPtr_s;
+  }
+
+
+  RunManager& RunManager::getSingleton()
+  {
+    return *singletonPtr_s;
+  }
+
+  RunManager* RunManager::getSingletonPtr()
+  {
+    return singletonPtr_s;
+  }
+
+}
Index: code/branches/FICN/src/run_manager.h
===================================================================
--- code/branches/FICN/src/run_manager.h	(revision 337)
+++ code/branches/FICN/src/run_manager.h	(revision 337)
@@ -0,0 +1,142 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef RUN_MANAGER_H
+#define RUN_MANAGER_H
+
+#include "OgrePrerequisites.h"
+#include "OgreWindowEventUtilities.h"
+//#include "OgreTextureManager.h"
+
+#include <OIS/OISPrereqs.h>
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+
+  // let the class inherit from WindowEventListener in order for the RunMgr
+  // to act as the central point of all the calcuations in Orxonox
+  class RunManager : public Ogre::WindowEventListener
+  {
+  public:
+    virtual ~RunManager();
+    
+    void initialise(OgreControl*);
+
+    bool tick(unsigned long, Ogre::Real);
+
+    Ogre::SceneManager& getSceneManager();
+
+    Ogre::SceneManager* getSceneManagerPtr();
+
+    weapon::BulletManager* getBulletManagerPtr();
+
+    int getAmmunitionID(const Ogre::String&);
+
+    int getNumberOfAmmos();
+
+    static RunManager* createSingleton();
+
+    static void destroySingleton();
+
+    static RunManager& getSingleton(void);
+
+    static RunManager* getSingletonPtr(void);
+
+
+  protected:
+    RunManager();
+
+	  void createCamera(void);
+
+	  void createViewports(void);
+
+
+	  /** EVENT HANDLING **/
+
+	  //Adjust mouse clipping area
+	  void windowResized(Ogre::RenderWindow*);
+
+	  //Unattach OIS before window shutdown (very important under Linux)
+	  void windowClosed(Ogre::RenderWindow*);
+
+
+	  /** INPUT PROCESSING **/
+	  bool processUnbufferedKeyInput();
+
+	  bool processUnbufferedMouseInput();
+
+
+	  /** OUTPUT **/
+
+	  void showDebugOverlay(bool);
+
+  protected:
+    // directly Ogre related fields
+	  Ogre::SceneManager *sceneMgr_;
+	  Ogre::RenderWindow *window_;
+	  Ogre::Camera       *camera_;
+
+
+    // self made orxonox fields
+	  OgreControl  *ogre_;
+	  OrxonoxScene *backgroundScene_;
+	  OrxonoxShip  *playerShip_;
+    hud::TestOverlay *hud_;
+
+    // Bullet manager
+    weapon::BulletManager *bulletManager_;
+
+    const Ogre::Real mouseSensitivity_;
+
+	  // previously elapsed render time
+	  unsigned long totalTime_;
+
+
+    // fields from the example framework
+	  bool statsOn_;
+
+	  unsigned int screenShotCounter_;
+	  // just to stop toggles flipping too fast
+	  Ogre::Real timeUntilNextToggle_;
+
+	  //OIS Input devices
+	  OIS::InputManager* inputManager_;
+	  OIS::Mouse*    mouse_;
+	  OIS::Keyboard* keyboard_;
+	  OIS::JoyStick* joystick_;
+
+    // singleton pointer
+    static RunManager *singletonPtr_s;
+
+  };
+
+}
+
+#endif /* RUN_MANAGER_H */
