Index: orxonox/branches/levelloader/src/INSTALL
===================================================================
--- orxonox/branches/levelloader/src/INSTALL	(revision 3604)
+++ orxonox/branches/levelloader/src/INSTALL	(revision 3605)
@@ -3,10 +3,32 @@
 =====================================
 
-Installing an using orx is very simple: Just type:
+INSTALLATION
+============
 
-cd ../orxonox/trunk
-./configure
-make
-./bin/orxonox
+To make it quite easy for those of you who just want to install orxonox:
+
+1. ./configure
+2. make
+3. make install
+
+DEPENDENCIES
+============
+
+There are some dependencies for orxonox you have to install:
+
+1. SDL           (http://www.libsdl.org)
+2. OPENGL        (http://www.opengl.org)
+3. SDL_mixer     (http://www.libsdl.org/projects/SDL_mixer)
+4. SDL_image     (http://www.libsdl.org/projects/SDL_image)
+5. SDL_ttf       (http://www.libsdl.org/projects/SDL_ttf)
+ a) needs libttf (http://www.freetype.org/)
+
+Nice to Have:
+6. Doxygen       (http://www.stack.nl/~dimitri/doxygen/)
+7. Automake	 (http://www.gnu.org/software/automake/)
+8. Autoconf      (http://www.gnu.org/software/autoconf/)
+
+Windows Users also need the following:
+9. mingw         (http://mingw.org/)
 
 
Index: orxonox/branches/levelloader/src/Makefile.am
===================================================================
--- orxonox/branches/levelloader/src/Makefile.am	(revision 3604)
+++ orxonox/branches/levelloader/src/Makefile.am	(revision 3605)
@@ -6,5 +6,5 @@
 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/coord
 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/data
-AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/gaphics
+AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/graphics
 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/graphics/font
 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/graphics/importer
@@ -34,5 +34,6 @@
 		 camera.cc \
 		 track_manager.cc \
-		 light.cc \
+		 track_node.cc \
+		 simple_animation.cc \
 		 factory.cc \
 		 story_entities/story_entity.cc \
@@ -43,4 +44,9 @@
 		 world_entities/environment.cc \
 		 world_entities/skysphere.cc \
+		 world_entities/terrain.cc \
+		 world_entities/primitive.cc \
+		 world_entities/weapon.cc \
+		 world_entities/projectile.cc \
+		 world_entities/character_attributes.cc \
 		 ai/ai.cc \
 		 lib/coord/p_node.cc \
@@ -48,4 +54,5 @@
 		 lib/coord/helper_parent.cc \
 		 lib/data/data_tank.cc \
+		 lib/graphics/light.cc \
 		 lib/graphics/font/fontset.cc \
 		 lib/graphics/importer/array.cc \
@@ -60,5 +67,4 @@
 		 lib/util/substring.cc \
 		 lib/math/vector.cc \
-		 lib/math/matrix.cc \
 		 lib/math/curve.cc \
 		 lib/xmlparser/tinystr.cc \
@@ -77,5 +83,7 @@
 		 command_node.h \
 		 message_structures.h \
-		 light.h \
+		 track_manager.h \
+		 track_node.h \
+		 simple_animation.h \
 		 story_entities/story_entity.h \
 		 story_entities/story_def.h \
@@ -87,7 +95,10 @@
 		 world_entities/environment.h \
 		 world_entities/skysphere.h \
-		 world_entities/shoot_laser.h \
-		 world_entities/shoot_rocket.h \
 		 world_entities/power_up.h \
+		 world_entities/terrain.h \
+		 world_entities/primitive.h \
+		 world_entities/weapon.h \
+		 world_entities/projectile.h \
+		 world_entities/character_attributes.h \
 		 ai/ai.h \
 		 network/synchronisable.h \
@@ -99,4 +110,5 @@
 		 lib/coord/null_parent.h \
 		 lib/coord/helper_parent.h \
+		 lib/graphics/light.h \
 		 lib/graphics/font/fontset.h \
 		 lib/data/data_tank.h \
@@ -110,5 +122,4 @@
 		 lib/xmlparser/tinystr.h \
 		 lib/math/vector.h \
-		 lib/math/matrix.h \
 		 lib/math/curve.h \
 		 glmenu/glmenu_imagescreen.h 
@@ -119,5 +130,5 @@
 
 if SUB_PROJECTS
-  SUB_PROGS = lib
+  SUB_PROGS = lib subprojects
 else
   SUB_PROGS = 
Index: orxonox/branches/levelloader/src/Makefile.in
===================================================================
--- orxonox/branches/levelloader/src/Makefile.in	(revision 3604)
+++ orxonox/branches/levelloader/src/Makefile.in	(revision 3605)
@@ -1,3 +1,3 @@
-# Makefile.in generated by automake 1.8.2 from Makefile.am.
+# Makefile.in generated by automake 1.8.5 from Makefile.am.
 # @configure_input@
 
@@ -50,19 +50,22 @@
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
-am__installdirs = $(DESTDIR)$(bindir)
+am__installdirs = "$(DESTDIR)$(bindir)"
 binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 PROGRAMS = $(bin_PROGRAMS)
 am_orxonox_OBJECTS = orxonox.$(OBJEXT) game_loader.$(OBJEXT) \
 	command_node.$(OBJEXT) keynames.$(OBJEXT) camera.$(OBJEXT) \
-	track_manager.$(OBJEXT) light.$(OBJEXT) factory.$(OBJEXT) \
+	track_manager.$(OBJEXT) track_node.$(OBJEXT) \
+	simple_animation.$(OBJEXT) factory.$(OBJEXT) \
 	story_entity.$(OBJEXT) campaign.$(OBJEXT) world.$(OBJEXT) \
 	world_entity.$(OBJEXT) player.$(OBJEXT) environment.$(OBJEXT) \
-	skysphere.$(OBJEXT) ai.$(OBJEXT) p_node.$(OBJEXT) \
+	skysphere.$(OBJEXT) terrain.$(OBJEXT) primitive.$(OBJEXT) \
+	weapon.$(OBJEXT) projectile.$(OBJEXT) \
+	character_attributes.$(OBJEXT) ai.$(OBJEXT) p_node.$(OBJEXT) \
 	null_parent.$(OBJEXT) helper_parent.$(OBJEXT) \
-	data_tank.$(OBJEXT) fontset.$(OBJEXT) array.$(OBJEXT) \
-	objModel.$(OBJEXT) model.$(OBJEXT) material.$(OBJEXT) \
-	texture.$(OBJEXT) base_entity.$(OBJEXT) base_object.$(OBJEXT) \
-	ini_parser.$(OBJEXT) list.$(OBJEXT) substring.$(OBJEXT) \
-	vector.$(OBJEXT) matrix.$(OBJEXT) curve.$(OBJEXT) \
+	data_tank.$(OBJEXT) light.$(OBJEXT) fontset.$(OBJEXT) \
+	array.$(OBJEXT) objModel.$(OBJEXT) model.$(OBJEXT) \
+	material.$(OBJEXT) texture.$(OBJEXT) base_entity.$(OBJEXT) \
+	base_object.$(OBJEXT) ini_parser.$(OBJEXT) list.$(OBJEXT) \
+	substring.$(OBJEXT) vector.$(OBJEXT) curve.$(OBJEXT) \
 	tinystr.$(OBJEXT) tinyxml.$(OBJEXT) tinyxmlerror.$(OBJEXT) \
 	tinyxmlparser.$(OBJEXT) glmenu_imagescreen.$(OBJEXT)
@@ -76,4 +79,5 @@
 @AMDEP_TRUE@	./$(DEPDIR)/base_object.Po ./$(DEPDIR)/camera.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/campaign.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/character_attributes.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/command_node.Po ./$(DEPDIR)/curve.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/data_tank.Po \
@@ -84,16 +88,20 @@
 @AMDEP_TRUE@	./$(DEPDIR)/ini_parser.Po ./$(DEPDIR)/keynames.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/light.Po ./$(DEPDIR)/list.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/material.Po ./$(DEPDIR)/matrix.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/model.Po ./$(DEPDIR)/null_parent.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/objModel.Po ./$(DEPDIR)/orxonox.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/p_node.Po ./$(DEPDIR)/player.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/material.Po ./$(DEPDIR)/model.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/null_parent.Po ./$(DEPDIR)/objModel.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/orxonox.Po ./$(DEPDIR)/p_node.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/player.Po ./$(DEPDIR)/primitive.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/projectile.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/simple_animation.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/skysphere.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/story_entity.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/substring.Po ./$(DEPDIR)/texture.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/tinystr.Po ./$(DEPDIR)/tinyxml.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/tinyxmlerror.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/substring.Po ./$(DEPDIR)/terrain.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/texture.Po ./$(DEPDIR)/tinystr.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/tinyxml.Po ./$(DEPDIR)/tinyxmlerror.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/tinyxmlparser.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/track_manager.Po ./$(DEPDIR)/vector.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/world.Po ./$(DEPDIR)/world_entity.Po
+@AMDEP_TRUE@	./$(DEPDIR)/track_manager.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/track_node.Po ./$(DEPDIR)/vector.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/weapon.Po ./$(DEPDIR)/world.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/world_entity.Po
 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
@@ -112,5 +120,5 @@
 ETAGS = etags
 CTAGS = ctags
-DIST_SUBDIRS = . lib
+DIST_SUBDIRS = . lib subprojects
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
@@ -136,4 +144,6 @@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DOCUMENTATION_FALSE = @DOCUMENTATION_FALSE@
+DOCUMENTATION_TRUE = @DOCUMENTATION_TRUE@
 DOXYGEN = @DOXYGEN@
 DOXYGEN_FALSE = @DOXYGEN_FALSE@
@@ -221,5 +231,5 @@
 target_vendor = @target_vendor@
 MAINSRCDIR = .
-AM_CXXFLAGS = -I$(MAINSRCDIR) -I$(MAINSRCDIR)/world_entities -I$(MAINSRCDIR)/story_entities -I$(MAINSRCDIR)/lib -I$(MAINSRCDIR)/lib/coord -I$(MAINSRCDIR)/lib/data -I$(MAINSRCDIR)/lib/gaphics -I$(MAINSRCDIR)/lib/graphics/font -I$(MAINSRCDIR)/lib/graphics/importer -I$(MAINSRCDIR)/lib/gui -I$(MAINSRCDIR)/lib/lang -I$(MAINSRCDIR)/lib/util -I$(MAINSRCDIR)/lib/math -I$(MAINSRCDIR)/lib/xmlparser -I$(MAINSRCDIR)/defs -I$(MAINSRCDIR)/font -I$(MAINSRCDIR)/network -I$(MAINSRCDIR)/glmenu -I$(MAINSRCDIR)/ai
+AM_CXXFLAGS = -I$(MAINSRCDIR) -I$(MAINSRCDIR)/world_entities -I$(MAINSRCDIR)/story_entities -I$(MAINSRCDIR)/lib -I$(MAINSRCDIR)/lib/coord -I$(MAINSRCDIR)/lib/data -I$(MAINSRCDIR)/lib/graphics -I$(MAINSRCDIR)/lib/graphics/font -I$(MAINSRCDIR)/lib/graphics/importer -I$(MAINSRCDIR)/lib/gui -I$(MAINSRCDIR)/lib/lang -I$(MAINSRCDIR)/lib/util -I$(MAINSRCDIR)/lib/math -I$(MAINSRCDIR)/lib/xmlparser -I$(MAINSRCDIR)/defs -I$(MAINSRCDIR)/font -I$(MAINSRCDIR)/network -I$(MAINSRCDIR)/glmenu -I$(MAINSRCDIR)/ai
 AM_LDFLAGS = $(MWINDOWS)
 orxonox_SOURCES = orxonox.cc \
@@ -229,5 +239,6 @@
 		 camera.cc \
 		 track_manager.cc \
-		 light.cc \
+		 track_node.cc \
+		 simple_animation.cc \
 		 factory.cc \
 		 story_entities/story_entity.cc \
@@ -238,4 +249,9 @@
 		 world_entities/environment.cc \
 		 world_entities/skysphere.cc \
+		 world_entities/terrain.cc \
+		 world_entities/primitive.cc \
+		 world_entities/weapon.cc \
+		 world_entities/projectile.cc \
+		 world_entities/character_attributes.cc \
 		 ai/ai.cc \
 		 lib/coord/p_node.cc \
@@ -243,4 +259,5 @@
 		 lib/coord/helper_parent.cc \
 		 lib/data/data_tank.cc \
+		 lib/graphics/light.cc \
 		 lib/graphics/font/fontset.cc \
 		 lib/graphics/importer/array.cc \
@@ -255,5 +272,4 @@
 		 lib/util/substring.cc \
 		 lib/math/vector.cc \
-		 lib/math/matrix.cc \
 		 lib/math/curve.cc \
 		 lib/xmlparser/tinystr.cc \
@@ -272,5 +288,7 @@
 		 command_node.h \
 		 message_structures.h \
-		 light.h \
+		 track_manager.h \
+		 track_node.h \
+		 simple_animation.h \
 		 story_entities/story_entity.h \
 		 story_entities/story_def.h \
@@ -282,7 +300,10 @@
 		 world_entities/environment.h \
 		 world_entities/skysphere.h \
-		 world_entities/shoot_laser.h \
-		 world_entities/shoot_rocket.h \
 		 world_entities/power_up.h \
+		 world_entities/terrain.h \
+		 world_entities/primitive.h \
+		 world_entities/weapon.h \
+		 world_entities/projectile.h \
+		 world_entities/character_attributes.h \
 		 ai/ai.h \
 		 network/synchronisable.h \
@@ -294,4 +315,5 @@
 		 lib/coord/null_parent.h \
 		 lib/coord/helper_parent.h \
+		 lib/graphics/light.h \
 		 lib/graphics/font/fontset.h \
 		 lib/data/data_tank.h \
@@ -305,5 +327,4 @@
 		 lib/xmlparser/tinystr.h \
 		 lib/math/vector.h \
-		 lib/math/matrix.h \
 		 lib/math/curve.h \
 		 glmenu/glmenu_imagescreen.h 
@@ -311,5 +332,5 @@
 EXTRA_DIST = orxonox.conf
 @SUB_PROJECTS_FALSE@SUB_PROGS = 
-@SUB_PROJECTS_TRUE@SUB_PROGS = lib
+@SUB_PROJECTS_TRUE@SUB_PROGS = lib subprojects
 SUBDIRS = . \
 	  $(SUB_PROGS)
@@ -328,7 +349,7 @@
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/Makefile'; \
 	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu  src/Makefile
+	  $(AUTOMAKE) --foreign  src/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@@ -350,5 +371,5 @@
 install-binPROGRAMS: $(bin_PROGRAMS)
 	@$(NORMAL_INSTALL)
-	$(mkdir_p) $(DESTDIR)$(bindir)
+	test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
 	@list='$(bin_PROGRAMS)'; for p in $$list; do \
 	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
@@ -356,6 +377,6 @@
 	  ; then \
 	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
-	   echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \
-	   $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
 	  else :; fi; \
 	done
@@ -365,6 +386,6 @@
 	@list='$(bin_PROGRAMS)'; for p in $$list; do \
 	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
-	  echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
-	  rm -f $(DESTDIR)$(bindir)/$$f; \
+	  echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(bindir)/$$f"; \
 	done
 
@@ -387,4 +408,5 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/camera.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/campaign.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/character_attributes.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/command_node.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/curve.Po@am__quote@
@@ -401,5 +423,4 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/material.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matrix.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/model.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/null_parent.Po@am__quote@
@@ -408,7 +429,11 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/p_node.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/player.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/primitive.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/projectile.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/simple_animation.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/skysphere.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/story_entity.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/substring.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/terrain.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/texture.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tinystr.Po@am__quote@
@@ -417,5 +442,7 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tinyxmlparser.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/track_manager.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/track_node.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/weapon.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/world.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/world_entity.Po@am__quote@
@@ -549,4 +576,84 @@
 @am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o skysphere.obj `if test -f 'world_entities/skysphere.cc'; then $(CYGPATH_W) 'world_entities/skysphere.cc'; else $(CYGPATH_W) '$(srcdir)/world_entities/skysphere.cc'; fi`
 
+terrain.o: world_entities/terrain.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT terrain.o -MD -MP -MF "$(DEPDIR)/terrain.Tpo" -c -o terrain.o `test -f 'world_entities/terrain.cc' || echo '$(srcdir)/'`world_entities/terrain.cc; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/terrain.Tpo" "$(DEPDIR)/terrain.Po"; else rm -f "$(DEPDIR)/terrain.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='world_entities/terrain.cc' object='terrain.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/terrain.Po' tmpdepfile='$(DEPDIR)/terrain.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o terrain.o `test -f 'world_entities/terrain.cc' || echo '$(srcdir)/'`world_entities/terrain.cc
+
+terrain.obj: world_entities/terrain.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT terrain.obj -MD -MP -MF "$(DEPDIR)/terrain.Tpo" -c -o terrain.obj `if test -f 'world_entities/terrain.cc'; then $(CYGPATH_W) 'world_entities/terrain.cc'; else $(CYGPATH_W) '$(srcdir)/world_entities/terrain.cc'; fi`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/terrain.Tpo" "$(DEPDIR)/terrain.Po"; else rm -f "$(DEPDIR)/terrain.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='world_entities/terrain.cc' object='terrain.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/terrain.Po' tmpdepfile='$(DEPDIR)/terrain.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o terrain.obj `if test -f 'world_entities/terrain.cc'; then $(CYGPATH_W) 'world_entities/terrain.cc'; else $(CYGPATH_W) '$(srcdir)/world_entities/terrain.cc'; fi`
+
+primitive.o: world_entities/primitive.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT primitive.o -MD -MP -MF "$(DEPDIR)/primitive.Tpo" -c -o primitive.o `test -f 'world_entities/primitive.cc' || echo '$(srcdir)/'`world_entities/primitive.cc; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/primitive.Tpo" "$(DEPDIR)/primitive.Po"; else rm -f "$(DEPDIR)/primitive.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='world_entities/primitive.cc' object='primitive.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/primitive.Po' tmpdepfile='$(DEPDIR)/primitive.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o primitive.o `test -f 'world_entities/primitive.cc' || echo '$(srcdir)/'`world_entities/primitive.cc
+
+primitive.obj: world_entities/primitive.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT primitive.obj -MD -MP -MF "$(DEPDIR)/primitive.Tpo" -c -o primitive.obj `if test -f 'world_entities/primitive.cc'; then $(CYGPATH_W) 'world_entities/primitive.cc'; else $(CYGPATH_W) '$(srcdir)/world_entities/primitive.cc'; fi`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/primitive.Tpo" "$(DEPDIR)/primitive.Po"; else rm -f "$(DEPDIR)/primitive.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='world_entities/primitive.cc' object='primitive.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/primitive.Po' tmpdepfile='$(DEPDIR)/primitive.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o primitive.obj `if test -f 'world_entities/primitive.cc'; then $(CYGPATH_W) 'world_entities/primitive.cc'; else $(CYGPATH_W) '$(srcdir)/world_entities/primitive.cc'; fi`
+
+weapon.o: world_entities/weapon.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT weapon.o -MD -MP -MF "$(DEPDIR)/weapon.Tpo" -c -o weapon.o `test -f 'world_entities/weapon.cc' || echo '$(srcdir)/'`world_entities/weapon.cc; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/weapon.Tpo" "$(DEPDIR)/weapon.Po"; else rm -f "$(DEPDIR)/weapon.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='world_entities/weapon.cc' object='weapon.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/weapon.Po' tmpdepfile='$(DEPDIR)/weapon.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o weapon.o `test -f 'world_entities/weapon.cc' || echo '$(srcdir)/'`world_entities/weapon.cc
+
+weapon.obj: world_entities/weapon.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT weapon.obj -MD -MP -MF "$(DEPDIR)/weapon.Tpo" -c -o weapon.obj `if test -f 'world_entities/weapon.cc'; then $(CYGPATH_W) 'world_entities/weapon.cc'; else $(CYGPATH_W) '$(srcdir)/world_entities/weapon.cc'; fi`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/weapon.Tpo" "$(DEPDIR)/weapon.Po"; else rm -f "$(DEPDIR)/weapon.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='world_entities/weapon.cc' object='weapon.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/weapon.Po' tmpdepfile='$(DEPDIR)/weapon.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o weapon.obj `if test -f 'world_entities/weapon.cc'; then $(CYGPATH_W) 'world_entities/weapon.cc'; else $(CYGPATH_W) '$(srcdir)/world_entities/weapon.cc'; fi`
+
+projectile.o: world_entities/projectile.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT projectile.o -MD -MP -MF "$(DEPDIR)/projectile.Tpo" -c -o projectile.o `test -f 'world_entities/projectile.cc' || echo '$(srcdir)/'`world_entities/projectile.cc; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/projectile.Tpo" "$(DEPDIR)/projectile.Po"; else rm -f "$(DEPDIR)/projectile.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='world_entities/projectile.cc' object='projectile.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/projectile.Po' tmpdepfile='$(DEPDIR)/projectile.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o projectile.o `test -f 'world_entities/projectile.cc' || echo '$(srcdir)/'`world_entities/projectile.cc
+
+projectile.obj: world_entities/projectile.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT projectile.obj -MD -MP -MF "$(DEPDIR)/projectile.Tpo" -c -o projectile.obj `if test -f 'world_entities/projectile.cc'; then $(CYGPATH_W) 'world_entities/projectile.cc'; else $(CYGPATH_W) '$(srcdir)/world_entities/projectile.cc'; fi`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/projectile.Tpo" "$(DEPDIR)/projectile.Po"; else rm -f "$(DEPDIR)/projectile.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='world_entities/projectile.cc' object='projectile.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/projectile.Po' tmpdepfile='$(DEPDIR)/projectile.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o projectile.obj `if test -f 'world_entities/projectile.cc'; then $(CYGPATH_W) 'world_entities/projectile.cc'; else $(CYGPATH_W) '$(srcdir)/world_entities/projectile.cc'; fi`
+
+character_attributes.o: world_entities/character_attributes.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT character_attributes.o -MD -MP -MF "$(DEPDIR)/character_attributes.Tpo" -c -o character_attributes.o `test -f 'world_entities/character_attributes.cc' || echo '$(srcdir)/'`world_entities/character_attributes.cc; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/character_attributes.Tpo" "$(DEPDIR)/character_attributes.Po"; else rm -f "$(DEPDIR)/character_attributes.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='world_entities/character_attributes.cc' object='character_attributes.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/character_attributes.Po' tmpdepfile='$(DEPDIR)/character_attributes.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o character_attributes.o `test -f 'world_entities/character_attributes.cc' || echo '$(srcdir)/'`world_entities/character_attributes.cc
+
+character_attributes.obj: world_entities/character_attributes.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT character_attributes.obj -MD -MP -MF "$(DEPDIR)/character_attributes.Tpo" -c -o character_attributes.obj `if test -f 'world_entities/character_attributes.cc'; then $(CYGPATH_W) 'world_entities/character_attributes.cc'; else $(CYGPATH_W) '$(srcdir)/world_entities/character_attributes.cc'; fi`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/character_attributes.Tpo" "$(DEPDIR)/character_attributes.Po"; else rm -f "$(DEPDIR)/character_attributes.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='world_entities/character_attributes.cc' object='character_attributes.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/character_attributes.Po' tmpdepfile='$(DEPDIR)/character_attributes.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o character_attributes.obj `if test -f 'world_entities/character_attributes.cc'; then $(CYGPATH_W) 'world_entities/character_attributes.cc'; else $(CYGPATH_W) '$(srcdir)/world_entities/character_attributes.cc'; fi`
+
 ai.o: ai/ai.cc
 @am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ai.o -MD -MP -MF "$(DEPDIR)/ai.Tpo" -c -o ai.o `test -f 'ai/ai.cc' || echo '$(srcdir)/'`ai/ai.cc; \
@@ -629,4 +736,20 @@
 @am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o data_tank.obj `if test -f 'lib/data/data_tank.cc'; then $(CYGPATH_W) 'lib/data/data_tank.cc'; else $(CYGPATH_W) '$(srcdir)/lib/data/data_tank.cc'; fi`
 
+light.o: lib/graphics/light.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT light.o -MD -MP -MF "$(DEPDIR)/light.Tpo" -c -o light.o `test -f 'lib/graphics/light.cc' || echo '$(srcdir)/'`lib/graphics/light.cc; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/light.Tpo" "$(DEPDIR)/light.Po"; else rm -f "$(DEPDIR)/light.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='lib/graphics/light.cc' object='light.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/light.Po' tmpdepfile='$(DEPDIR)/light.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o light.o `test -f 'lib/graphics/light.cc' || echo '$(srcdir)/'`lib/graphics/light.cc
+
+light.obj: lib/graphics/light.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT light.obj -MD -MP -MF "$(DEPDIR)/light.Tpo" -c -o light.obj `if test -f 'lib/graphics/light.cc'; then $(CYGPATH_W) 'lib/graphics/light.cc'; else $(CYGPATH_W) '$(srcdir)/lib/graphics/light.cc'; fi`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/light.Tpo" "$(DEPDIR)/light.Po"; else rm -f "$(DEPDIR)/light.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='lib/graphics/light.cc' object='light.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/light.Po' tmpdepfile='$(DEPDIR)/light.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o light.obj `if test -f 'lib/graphics/light.cc'; then $(CYGPATH_W) 'lib/graphics/light.cc'; else $(CYGPATH_W) '$(srcdir)/lib/graphics/light.cc'; fi`
+
 fontset.o: lib/graphics/font/fontset.cc
 @am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT fontset.o -MD -MP -MF "$(DEPDIR)/fontset.Tpo" -c -o fontset.o `test -f 'lib/graphics/font/fontset.cc' || echo '$(srcdir)/'`lib/graphics/font/fontset.cc; \
@@ -820,20 +943,4 @@
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o vector.obj `if test -f 'lib/math/vector.cc'; then $(CYGPATH_W) 'lib/math/vector.cc'; else $(CYGPATH_W) '$(srcdir)/lib/math/vector.cc'; fi`
-
-matrix.o: lib/math/matrix.cc
-@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT matrix.o -MD -MP -MF "$(DEPDIR)/matrix.Tpo" -c -o matrix.o `test -f 'lib/math/matrix.cc' || echo '$(srcdir)/'`lib/math/matrix.cc; \
-@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/matrix.Tpo" "$(DEPDIR)/matrix.Po"; else rm -f "$(DEPDIR)/matrix.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='lib/math/matrix.cc' object='matrix.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/matrix.Po' tmpdepfile='$(DEPDIR)/matrix.TPo' @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o matrix.o `test -f 'lib/math/matrix.cc' || echo '$(srcdir)/'`lib/math/matrix.cc
-
-matrix.obj: lib/math/matrix.cc
-@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT matrix.obj -MD -MP -MF "$(DEPDIR)/matrix.Tpo" -c -o matrix.obj `if test -f 'lib/math/matrix.cc'; then $(CYGPATH_W) 'lib/math/matrix.cc'; else $(CYGPATH_W) '$(srcdir)/lib/math/matrix.cc'; fi`; \
-@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/matrix.Tpo" "$(DEPDIR)/matrix.Po"; else rm -f "$(DEPDIR)/matrix.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='lib/math/matrix.cc' object='matrix.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/matrix.Po' tmpdepfile='$(DEPDIR)/matrix.TPo' @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o matrix.obj `if test -f 'lib/math/matrix.cc'; then $(CYGPATH_W) 'lib/math/matrix.cc'; else $(CYGPATH_W) '$(srcdir)/lib/math/matrix.cc'; fi`
 
 curve.o: lib/math/curve.cc
@@ -1007,12 +1114,14 @@
 	tags=; \
 	here=`pwd`; \
-	if (etags --etags-include --version) >/dev/null 2>&1; then \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
 	  include_option=--etags-include; \
+	  empty_fix=.; \
 	else \
 	  include_option=--include; \
+	  empty_fix=; \
 	fi; \
 	list='$(SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
-	    test -f $$subdir/TAGS && \
+	    test ! -f $$subdir/TAGS || \
 	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
 	  fi; \
@@ -1024,7 +1133,9 @@
 	  $(AWK) '    { files[$$0] = 1; } \
 	       END { for (i in files) print i; }'`; \
-	test -z "$(ETAGS_ARGS)$$tags$$unique" \
-	  || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	     $$tags $$unique
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
 ctags: CTAGS
 CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
@@ -1051,5 +1162,5 @@
 
 distdir: $(DISTFILES)
-	$(mkdir_p) $(distdir)/ai $(distdir)/defs $(distdir)/glmenu $(distdir)/lib/coord $(distdir)/lib/data $(distdir)/lib/graphics/font $(distdir)/lib/lang $(distdir)/lib/math $(distdir)/lib/util $(distdir)/lib/xmlparser $(distdir)/network $(distdir)/story_entities $(distdir)/world_entities
+	$(mkdir_p) $(distdir)/ai $(distdir)/defs $(distdir)/glmenu $(distdir)/lib/coord $(distdir)/lib/data $(distdir)/lib/graphics $(distdir)/lib/graphics/font $(distdir)/lib/lang $(distdir)/lib/math $(distdir)/lib/util $(distdir)/lib/xmlparser $(distdir)/network $(distdir)/story_entities $(distdir)/world_entities
 	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
 	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
@@ -1096,5 +1207,7 @@
 installdirs: installdirs-recursive
 installdirs-am:
-	$(mkdir_p) $(DESTDIR)$(bindir)
+	for dir in "$(DESTDIR)$(bindir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
 install: install-recursive
 install-exec: install-exec-recursive
Index: orxonox/branches/levelloader/src/ability.h
===================================================================
--- orxonox/branches/levelloader/src/ability.h	(revision 3604)
+++ orxonox/branches/levelloader/src/ability.h	(revision 3605)
@@ -10,5 +10,5 @@
  public:
   Ability ();
-  ~Ability ();
+  virtual ~Ability ();
 
 };
Index: orxonox/branches/levelloader/src/ai/ai.h
===================================================================
--- orxonox/branches/levelloader/src/ai/ai.h	(revision 3604)
+++ orxonox/branches/levelloader/src/ai/ai.h	(revision 3605)
@@ -9,5 +9,5 @@
  public:
   AI ();
-  ~AI ();
+  virtual ~AI ();
 
 };
Index: orxonox/branches/levelloader/src/camera.cc
===================================================================
--- orxonox/branches/levelloader/src/camera.cc	(revision 3604)
+++ orxonox/branches/levelloader/src/camera.cc	(revision 3605)
@@ -51,4 +51,7 @@
 Camera::~Camera ()
 {
+  this->bound = NULL;
+  this->world = NULL;
+
 }
 
@@ -60,5 +63,5 @@
    as smooth camera movement or swaying).
 */
-void Camera::timeSlice (Uint32 deltaT)
+void Camera::tick (Uint32 deltaT)
 {
   if( this->t <= deltaTime)
@@ -198,5 +201,5 @@
   // TO DO: implement options for frustum generation
   //glFrustum(-1.0, 1.0, -1.0, 1.0, 1.5, 250.0);
-  gluPerspective(60, 1.2f, 0.1, 250);
+  gluPerspective(60, 1.2f, 0.1, 2000);
   
   //Vector up(0,0,1);
@@ -276,11 +279,2 @@
 
 
-/**
-   \brief destroy, reset the camera so that it doesn't perform anything anymore
-
-*/
-void Camera::destroy()
-{
-  this->bound = NULL;
-  this->world = NULL;
-}
Index: orxonox/branches/levelloader/src/camera.h
===================================================================
--- orxonox/branches/levelloader/src/camera.h	(revision 3604)
+++ orxonox/branches/levelloader/src/camera.h	(revision 3605)
@@ -7,7 +7,5 @@
 #define _CAMERA_H
 
-#include "stdincl.h"
 #include "world_entity.h"
-
 
 class World;
@@ -56,10 +54,9 @@
  public:
   Camera (World* world);
-  ~Camera ();
+  virtual ~Camera ();
   
-  void timeSlice (Uint32 deltaT);
+  void tick (Uint32 deltaT);
   void apply ();
   void bind (WorldEntity* entity);
-  void destroy();
 
   void setWorld(World* world);  
Index: orxonox/branches/levelloader/src/command_node.cc
===================================================================
--- orxonox/branches/levelloader/src/command_node.cc	(revision 3604)
+++ orxonox/branches/levelloader/src/command_node.cc	(revision 3605)
@@ -14,4 +14,5 @@
 */
 
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_COMMAND_NODE
 
 #include "command_node.h"
@@ -112,5 +113,5 @@
   FILE* stream;
   
-  printf("Loading key bindings from %s\n", filename);
+  PRINTF(4)("Loading key bindings from %s\n", filename);
   
   if( filename == NULL) filename = DEFAULT_KEYBIND_FILE;
@@ -127,5 +128,5 @@
   if( parser.getSection ("Bindings") == -1)
     {
-      printf("Could not find key bindings in %s\n", filename);
+      PRINTF(1)("Could not find key bindings in %s\n", filename);
       return;
     }
@@ -145,9 +146,9 @@
 	{
 	case 0:
-	  printf("Key binding %d(%s) set to %s\n", index[1], SDLKToKeyname( index[1]), valuebuf);
+	  PRINTF(4)("Key binding %d(%s) set to %s\n", index[1], SDLKToKeyname( index[1]), valuebuf);
 	  strcpy (aliases->keys[index[1]], valuebuf);
 	  break;
 	case 1:
-	  printf("Button binding %d(%s) set to %s\n", index[1], SDLBToButtonname( index[1]), valuebuf);
+	  PRINTF(4)("Button binding %d(%s) set to %s\n", index[1], SDLBToButtonname( index[1]), valuebuf);
 	  strcpy (aliases->buttons[index[1]], valuebuf);
 	  break;
@@ -214,4 +215,5 @@
   while( SDL_PollEvent (&event))
     {
+      PRINTF(3)("CommandNode::processLocal() =========================got Event\n");
       memset (cmd.cmd, 0, CMD_LENGHT); 
       switch( event.type)
@@ -267,5 +269,4 @@
 void CommandNode::relay (Command* cmd)
 {
-
   Orxonox *orx = Orxonox::getInstance();
   if( orx->systemCommand (cmd)) return;
@@ -281,5 +282,5 @@
   while( entity != NULL)
     {
-      entity->command (cmd);
+      entity->command (cmd); /*no absorbtion of command! strange*/
       entity = bound->nextElement();
     }
Index: orxonox/branches/levelloader/src/defs/debug.h
===================================================================
--- orxonox/branches/levelloader/src/defs/debug.h	(revision 3604)
+++ orxonox/branches/levelloader/src/defs/debug.h	(revision 3605)
@@ -17,4 +17,8 @@
     \file debug.h
     \brief Handles output to console for different Verbose-Modes.
+
+    There are two main modes HARD and SOFT. HARD is precessed during compileTime where SOFT is for runtime.
+    \li HARD: One can choose between different modes. see: // DEFINE_MODULES \\
+    \li SOFT: If you want each module can have its own variable for processing. just pass it to DEBUG_MODULE_SOFT
 */ 
 
@@ -28,8 +32,5 @@
 #include <stdio.h>
 
-#ifndef DEBUG
-#define DEBUG 4
-#endif
-
+// DEFINE ERROR MODES
 #define NO              0
 #define ERR             1
@@ -37,25 +38,62 @@
 #define INFO            3
 #define DEBUGING        4
-
+#define vDEBUGING       5
+
+extern int verbose;
+
+//definitions
+#ifndef MODULAR_DEBUG
+#define HARD_DEBUG_LEVEL DEBUG
+#define SOFT_DEBUG_LEVEL verbose
+#else /* MODULAR_DEBUG */
+#ifndef DEBUG_MODULE_SOFT 
+#define SOFT_DEBUG_LEVEL verbose
+#else /* DEBUG_MODULE_SOFT */
+#define SOFT_DEBUG_LEVEL DEBUG_MODULE_SOFT
+#endif /* DEBUG_MODULE_SOFT */
+
+#ifndef DEBUG_SPECIAL_MODULE
+#define HARD_DEBUG_LEVEL DEBUG
+#else /* DEBUG_SPECIAL_MODULE */
+// DEFINE MODULES \\
+#define DEBUG_MODULE_ORXONOX            0
+#define DEBUG_MODULE_WORLD              0
+#define DEBUG_MODULE_PNODE              2
+#define DEBUG_MODULE_WORLD_ENTITY       0
+#define DEBUG_MODULE_COMMAND_NODE       0
+
+#define DEBUG_MODULE_IMPORTER           0
+#define DEBUG_MODULE_TRACK_MANAGER      0
+#define DEBUG_MODULE_LIGHT              3
+#define DEBUG_MODULE_PLAYER             0
+#define DEBUG_MODULE_MATH               0
+
+#define DEBUG_MODULE_NULL_PARENT        0
+
+
+#define HARD_DEBUG_LEVEL DEBUG_SPECIAL_MODULE
+#endif /* DEBUG_SPECIAL_MODULE */
+#endif /* MODULAR_DEBUG */
 ///////////////////////////////////////////////////
 /// PRINTF: prints with filename and linenumber ///
 ///////////////////////////////////////////////////
+
 #ifdef DEBUG
-extern int verbose;
+
 #define PRINTF(x) \
            PRINTF ## x
-           
-#if DEBUG >= ERR
+
+#if HARD_DEBUG_LEVEL >= ERR
 #define PRINTF1 \
-    if (verbose >= ERR) \
-      printf("%s:%d::ERROR:", __FILE__, __LINE__) && printf
+    if (SOFT_DEBUG_LEVEL >= ERR) \
+      printf("ERROR::%s:%d:", __FILE__, __LINE__) && printf
 #else 
 #define PRINTF1 if (NO)
 #endif
      
-#if DEBUG >= WARN
+#if HARD_DEBUG_LEVEL >= WARN
 #define PRINTF2 \
-     if (verbose >= WARN) \
-       printf("%s:%d::WARNING:", __FILE__, __LINE__) && printf
+     if (SOFT_DEBUG_LEVEL >= WARN) \
+       printf("WARNING::%s:%d:", __FILE__, __LINE__) && printf
          
 #else 
@@ -63,21 +101,28 @@
 #endif
      
-#if DEBUG >= INFO
+#if HARD_DEBUG_LEVEL >= INFO
 #define PRINTF3 \
-     if (verbose >= INFO) \
-       printf("%s:%d::INFO:", __FILE__, __LINE__) && printf
+     if (SOFT_DEBUG_LEVEL >= INFO) \
+       printf("INFO::%s:%d:", __FILE__, __LINE__) && printf
 #else 
 #define PRINTF3 if (NO)
 #endif
      
-#if DEBUG >= DEBUGING
+#if HARD_DEBUG_LEVEL >= DEBUGING
 #define PRINTF4 \
-     if (verbose >= DEBUGING) \
-       printf("%s:%d::DEBUG:", __FILE__, __LINE__) && printf
+     if (SOFT_DEBUG_LEVEL >= DEBUGING) \
+       printf("DEBUG::%s:%d:", __FILE__, __LINE__) && printf
 #else 
 #define PRINTF4 if (NO)
 #endif
      
-     
+#if HARD_DEBUG_LEVEL >= vDEBUGING
+#define PRINTF5 \
+     if (SOFT_DEBUG_LEVEL >= vDEBUGING) \
+       printf("VERYDEBUG::%s:%d:", __FILE__, __LINE__) && printf
+#else 
+#define PRINTF5 if (NO)
+#endif
+    
 #else  
 #define PRINTF(x) if (NO)
@@ -92,11 +137,10 @@
 ///////////////////////////////////////////////////
 #ifdef  DEBUG
-extern int verbose;
 #define PRINT(x) \
   PRINT ## x
-  
-#if DEBUG >= ERR
+
+#if HARD_DEBUG_LEVEL >= ERR
 #define PRINT1	\
-  if (verbose >= ERR)	\
+  if (SOFT_DEBUG_LEVEL >= ERR)	\
     printf
 #else 
@@ -104,7 +148,7 @@
 #endif
 
-#if DEBUG >= WARN
+#if HARD_DEBUG_LEVEL >= WARN
 #define PRINT2 \
-  if (verbose >= WARN) \
+  if (SOFT_DEBUG_LEVEL >= WARN) \
     printf
 
@@ -113,7 +157,7 @@
 #endif
 
-#if DEBUG >= INFO
+#if HARD_DEBUG_LEVEL >= INFO
 #define PRINT3 \
-  if (verbose >= INFO) \
+  if (SOFT_DEBUG_LEVEL >= INFO) \
     printf
 #else 
@@ -121,10 +165,18 @@
 #endif
 
-#if DEBUG >= DEBUGING
+#if HARD_DEBUG_LEVEL >= DEBUGING
 #define PRINT4 \
-  if (verbose >= DEBUGING) \
+  if (SOFT_DEBUG_LEVEL >= DEBUGING) \
     printf
 #else 
 #define PRINT4 if (NO)
+#endif
+
+#if HARD_DEBUG_LEVEL >= vDEBUGING
+#define PRINT5 \
+     if (SOFT_DEBUG_LEVEL >= vDEBUGING) \
+       printf("VERYDEBUG::%s:%d:", __FILE__, __LINE__) && printf
+#else 
+#define PRINT5 if (NO)
 #endif
 
@@ -144,7 +196,7 @@
            COUT ## x
 
-#if DEBUG >= 1
+#if HARD_DEBUG_LEVEL >= 1
 #define COUT1 \
-    if (verbose >= 1 ) \
+    if (SOFT_DEBUG_LEVEL >= 1 ) \
       cout
 #else 
@@ -152,7 +204,7 @@
 #endif
      
-#if DEBUG >= 2
+#if HARD_DEBUG_LEVEL >= 2
 #define COUT2 \
-     if (verbose >= 2 ) \
+     if (SOFT_DEBUG_LEVEL >= 2 ) \
        cout
 
@@ -161,7 +213,7 @@
 #endif
      
-#if DEBUG >= 3
+#if HARD_DEBUG_LEVEL >= 3
 #define COUT3 \
-     if (verbose >= 3 ) \
+     if (SOFT_DEBUG_LEVEL >= 3 ) \
        cout
 #else
@@ -169,7 +221,7 @@
 #endif
      
-#if DEBUG >= 4
+#if HARD_DEBUG_LEVEL >= 4
 #define COUT4 \
-     if (verbose >= 4 ) \
+     if (SOFT_DEBUG_LEVEL >= 4 ) \
        cout
 #else 
Index: orxonox/branches/levelloader/src/glmenu/glmenu_imagescreen.cc
===================================================================
--- orxonox/branches/levelloader/src/glmenu/glmenu_imagescreen.cc	(revision 3604)
+++ orxonox/branches/levelloader/src/glmenu/glmenu_imagescreen.cc	(revision 3605)
@@ -19,4 +19,5 @@
 #include "glmenu_imagescreen.h"
 
+#include "stdincl.h"
 #include "material.h"
 
@@ -27,5 +28,5 @@
 GLMenuImageScreen* GLMenuImageScreen::getInstance()
 {
-  if( singletonRef == NULL)
+  if(!singletonRef)
     singletonRef = new GLMenuImageScreen ();
   return singletonRef;
@@ -45,5 +46,4 @@
 /**
    \brief standard deconstructor
-
    \todo this deconstructor is not jet implemented - do it
 */
@@ -53,5 +53,4 @@
     delete backMat;
 }
-
 
 /**
@@ -171,5 +170,4 @@
   glDisable(GL_LIGHTING);
 
-  backMat->select();
   glBegin(GL_QUADS);
   glColor3f(0.96, 0.84, 0.34);
@@ -210,5 +208,5 @@
   glEnd();
 
-  glEnable(GL_TEXTURE_2D);
+  backMat->select();
   glBegin(GL_QUADS);
   glTexCoord2i(0, 0); glVertex2i(offsetX, offsetY);
Index: orxonox/branches/levelloader/src/glmenu/glmenu_imagescreen.h
===================================================================
--- orxonox/branches/levelloader/src/glmenu/glmenu_imagescreen.h	(revision 3604)
+++ orxonox/branches/levelloader/src/glmenu/glmenu_imagescreen.h	(revision 3605)
@@ -8,6 +8,6 @@
 #define _GLMENU_IMAGESCREEN_H
 
-#include "stdincl.h"
-class Texture;
+#include "base_object.h"
+
 class Material;
 
@@ -18,6 +18,6 @@
 
  public:
-  ~GLMenuImageScreen ();
-
+  virtual ~GLMenuImageScreen ();
+  
   static GLMenuImageScreen* getInstance();
 
Index: orxonox/branches/levelloader/src/keynames.cc
===================================================================
--- orxonox/branches/levelloader/src/keynames.cc	(revision 3604)
+++ orxonox/branches/levelloader/src/keynames.cc	(revision 3605)
@@ -15,4 +15,6 @@
 
 #include "keynames.h"
+
+#include "stdincl.h"
 
 #include <string.h>
Index: orxonox/branches/levelloader/src/keynames.h
===================================================================
--- orxonox/branches/levelloader/src/keynames.h	(revision 3604)
+++ orxonox/branches/levelloader/src/keynames.h	(revision 3605)
@@ -7,15 +7,4 @@
 #ifndef _KEYNAMES_H
 #define _KEYNAMES_H
-
-
-#ifdef __WIN32__
-#include <windows.h>
-#endif
-
-#ifndef __APPLE__
-#include <SDL/SDL.h>
-#else
-#include <SDL.h>
-#endif
 
 /**
Index: orxonox/branches/levelloader/src/lib/Makefile.in
===================================================================
--- orxonox/branches/levelloader/src/lib/Makefile.in	(revision 3604)
+++ orxonox/branches/levelloader/src/lib/Makefile.in	(revision 3605)
@@ -1,3 +1,3 @@
-# Makefile.in generated by automake 1.8.2 from Makefile.am.
+# Makefile.in generated by automake 1.8.5 from Makefile.am.
 # @configure_input@
 
@@ -78,4 +78,6 @@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DOCUMENTATION_FALSE = @DOCUMENTATION_FALSE@
+DOCUMENTATION_TRUE = @DOCUMENTATION_TRUE@
 DOXYGEN = @DOXYGEN@
 DOXYGEN_FALSE = @DOXYGEN_FALSE@
@@ -181,7 +183,7 @@
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/lib/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/lib/Makefile'; \
 	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu  src/lib/Makefile
+	  $(AUTOMAKE) --foreign  src/lib/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@@ -276,12 +278,14 @@
 	tags=; \
 	here=`pwd`; \
-	if (etags --etags-include --version) >/dev/null 2>&1; then \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
 	  include_option=--etags-include; \
+	  empty_fix=.; \
 	else \
 	  include_option=--include; \
+	  empty_fix=; \
 	fi; \
 	list='$(SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
-	    test -f $$subdir/TAGS && \
+	    test ! -f $$subdir/TAGS || \
 	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
 	  fi; \
@@ -293,7 +297,9 @@
 	  $(AWK) '    { files[$$0] = 1; } \
 	       END { for (i in files) print i; }'`; \
-	test -z "$(ETAGS_ARGS)$$tags$$unique" \
-	  || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	     $$tags $$unique
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
 ctags: CTAGS
 CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
Index: orxonox/branches/levelloader/src/lib/coord/helper_parent.cc
===================================================================
--- orxonox/branches/levelloader/src/lib/coord/helper_parent.cc	(revision 3604)
+++ orxonox/branches/levelloader/src/lib/coord/helper_parent.cc	(revision 3605)
@@ -39,4 +39,6 @@
    \todo this deconstructor is not jet implemented - do it
 */
-HelperParent::~HelperParent () {}
+HelperParent::~HelperParent () 
+{
 
+}
Index: orxonox/branches/levelloader/src/lib/coord/helper_parent.h
===================================================================
--- orxonox/branches/levelloader/src/lib/coord/helper_parent.h	(revision 3604)
+++ orxonox/branches/levelloader/src/lib/coord/helper_parent.h	(revision 3605)
@@ -17,6 +17,5 @@
  public:
   HelperParent ();
-  ~HelperParent ();
-
+  virtual ~HelperParent ();
 
 };
Index: orxonox/branches/levelloader/src/lib/coord/null_parent.cc
===================================================================
--- orxonox/branches/levelloader/src/lib/coord/null_parent.cc	(revision 3604)
+++ orxonox/branches/levelloader/src/lib/coord/null_parent.cc	(revision 3605)
@@ -16,4 +16,5 @@
 */
 
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_NULL_PARENT
 
 #include "null_parent.h"
@@ -26,5 +27,5 @@
 NullParent* NullParent::getInstance ()
 {
-  if( singletonRef == NULL)
+  if(!singletonRef)
     singletonRef = new NullParent ();
   return singletonRef;
@@ -36,16 +37,20 @@
    \todo this constructor is not jet implemented - do it
 */
-NullParent::NullParent () 
+NullParent::NullParent () : PNode (new Vector(0,0,0), NULL)
 {
+  PRINTF(4)("NullParent::NullParent() - making new NullParent, there can only be one..\n");
   this->parent = this;
-  this->mode = ALL;
+  this->mode = PNODE_ALL;
+  this->setName("NullParent");
 }
 
 
-NullParent::NullParent (Vector* absCoordinate)
+NullParent::NullParent (Vector* absCoordinate) : PNode (new Vector(0,0,0), NULL)
 {
+  singletonRef = this;
   this->parent = this;
-  this->mode = ALL;
+  this->mode = PNODE_ALL;
   this->absCoordinate = *absCoordinate;
+  this->setName("NullParent");
 }
 
@@ -58,10 +63,7 @@
 NullParent::~NullParent () 
 {
-  delete singletonRef;
+  //delete singletonRef;
   singletonRef = NULL;
 }
-
-
-
 
 /**
@@ -72,6 +74,8 @@
    worry, normaly...
 */
-void NullParent::update (float timeStamp)
+void NullParent::update ()
 {
+
+  PRINTF(4)("NullParent::update - (%f, %f, %f)\n", this->absCoordinate.x, this->absCoordinate.y, this->absCoordinate.z);
   this->absCoordinate = this->relCoordinate;
   this->absDirection = parent->getAbsDir () * this->relDirection;
@@ -85,5 +89,5 @@
       if( this->bRelDirChanged || this->bAbsDirChanged)
 	pn->parentDirChanged ();
-      pn->update (timeStamp);
+      pn->update ();
       pn = this->children->nextElement ();
     }
Index: orxonox/branches/levelloader/src/lib/coord/null_parent.h
===================================================================
--- orxonox/branches/levelloader/src/lib/coord/null_parent.h	(revision 3604)
+++ orxonox/branches/levelloader/src/lib/coord/null_parent.h	(revision 3605)
@@ -16,13 +16,13 @@
  public:
   static NullParent* getInstance ();
-  ~NullParent ();
-  
-  static NullParent* singletonRef;
+  virtual ~NullParent ();
 
-  virtual void update (float timeStamp);
+
+  virtual void update ();
 
  private:
   NullParent ();
   NullParent (Vector* absCoordinate);
+  static NullParent* singletonRef;
 
 };
Index: orxonox/branches/levelloader/src/lib/coord/p_node.cc
===================================================================
--- orxonox/branches/levelloader/src/lib/coord/p_node.cc	(revision 3604)
+++ orxonox/branches/levelloader/src/lib/coord/p_node.cc	(revision 3605)
@@ -13,14 +13,15 @@
    ### File Specific:
    main-programmer: Patrick Boenzli
-   co-programmer: ...
-
-   \todo Null-Parent => center of the coord system - singleton
+   co-programmer: 
+
    \todo Smooth-Parent: delay, speed
-   \todo destroy the stuff again, delete...
-*/
-
+*/
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_PNODE
 
 #include "p_node.h"
 
+#include "null_parent.h"
+#include "vector.h"
 
 using namespace std;
@@ -34,10 +35,8 @@
 PNode::PNode () 
 {
-  this->children = new tList<PNode>();
-  this->bRelCoorChanged = true;
-  this->bAbsCoorChanged = false;
-  this->bRelDirChanged = true;
-  this->bAbsDirChanged = false;
-  this->parent = NULL;
+  init(NULL);
+
+  NullParent* np = NullParent::getInstance();
+  np->addChild(this);
   this->objectName = NULL;
 }
@@ -51,18 +50,15 @@
 PNode::PNode (Vector* absCoordinate, PNode* parent )
 {
+  this->init(parent);
+
   this->absCoordinate = *absCoordinate;
-  this->relCoordinate = this->absCoordinate - parent->getAbsCoor ();
-  
-  this->children = new tList<PNode>();
-  this->bRelCoorChanged = true;
-  this->bAbsCoorChanged = false;
-  this->bRelDirChanged = true;
-  this->bAbsDirChanged = false;
-  this->parent = parent;
-  this->objectName = NULL;
-  
-  parent->addChild (this);
-}
-
+  if (parent != NULL)
+    {
+      this->relCoordinate = this->absCoordinate - parent->getAbsCoor ();
+      parent->addChild (this);
+    }
+  else 
+    this->relCoordinate = Vector(0,0,0);
+}
 
 /**
@@ -80,9 +76,32 @@
   delete &this->absDirection;
   */
-  this->parent = NULL;
+  //this->parent = NULL;
   if( this->objectName) delete this->objectName;
   /* there is currently a problem with cleaning up - fix*/
-}
-
+
+  PNode* pn = this->children->enumerate();
+  while( pn != NULL) 
+    { 
+      delete pn;
+      pn = this->children->nextElement();
+
+    }
+   
+  /* this deletes all children in the list */
+  delete this->children;
+
+  delete []this->objectName;
+}
+
+void PNode::init(PNode* parent)
+{
+  this->children = new tList<PNode>();
+  this->bRelCoorChanged = true;
+  this->bAbsCoorChanged = false;
+  this->bRelDirChanged = true;
+  this->bAbsDirChanged = false;
+  this->parent = parent; 
+  this->objectName = NULL;
+}
 
 /**
@@ -91,4 +110,5 @@
    cleans up all pnodes
 */
+/*
 void PNode::destroy ()
 {
@@ -99,7 +119,10 @@
       pn = this->children->nextElement();
     } 
+  // this deletes all children in the list 
   this->children->destroy ();
-}
-
+
+  static_cast<BaseObject*>(this)->destroy();
+}
+*/
 
 /**
@@ -262,6 +285,4 @@
 {}
 
-
-
 /**
    \brief adds a child and makes this node to a parent
@@ -283,9 +304,14 @@
    use this to add a child to this node.
 */
-void PNode::addChild (PNode* pNode, parentingMode mode)
-{
-  pNode->mode = mode;
+void PNode::addChild (PNode* pNode, int parentingMode)
+{
+  if( pNode->parent != NULL )
+    {
+      PRINTF(2)("PNode::addChild() - reparenting node: removing it and adding it again\n");
+      pNode->parent->children->remove(pNode);
+    }
+  pNode->mode = parentingMode;
   pNode->parent = this;
-  this->children->add (pNode);
+  this->children->add(pNode);
 }
 
@@ -294,8 +320,30 @@
    \brief removes a child from the node
    \param pNode the child to remove from this pNode.
+
+   Children from pNode will not be lost, they are referenced to NullPointer
 */
 void PNode::removeChild (PNode* pNode)
 {
+  pNode->remove();
   this->children->remove (pNode);
+  pNode->parent = NULL;
+}
+
+
+/**
+   \brief remove this pnode from the tree and adds all following to NullParent
+
+   this can be the case, if an entity in the world is been destroyed.
+*/
+void PNode::remove()
+{
+  NullParent* np = NullParent::getInstance();
+  PNode* pn = this->children->enumerate();
+  while( pn != NULL) 
+    { 
+      this->children->remove(pn);
+      np->addChild(pn, pn->getMode());
+      pn = this->children->nextElement();
+    }
 }
 
@@ -307,6 +355,7 @@
 void PNode::setParent (PNode* parent)
 {
-  this->parent = parent;
-}
+  parent->addChild(this);
+}
+
 
 /**
@@ -314,7 +363,17 @@
    \param mode the mode of the bind-type.
 */
-void PNode::setMode (parentingMode mode)
-{
-  this->mode = mode;
+void PNode::setMode (int parentingMode)
+{
+  this->mode = parentingMode;
+}
+
+
+/**
+   \brief gets the mode of this parent manualy
+   \return the mode of the bind-type.
+*/
+int PNode::getMode()
+{
+  return this->mode;
 }
 
@@ -351,42 +410,59 @@
    worry, normaly...
 */
-void PNode::update (float timeStamp)
-{
-  printf ("PNode::update - %s - (%f, %f, %f)\n", this->objectName, this->absCoordinate.x, this->absCoordinate.y, this->absCoordinate.z);
-
-      if( this->mode == MOVEMENT || this->mode == ALL)
+void PNode::update ()
+{
+  PRINTF(2)("PNode::update - %s - (%f, %f, %f)\n", this->objectName, this->absCoordinate.x, this->absCoordinate.y, this->absCoordinate.z);
+  // printf("%s", this->objectName);
+  if(this->mode & PNODE_MOVEMENT )
+    {
+      if( this->bAbsCoorChanged /*&& this->timeStamp != DataTank::timeStamp*/)
 	{
-	  if( this->bAbsCoorChanged /*&& this->timeStamp != DataTank::timeStamp*/)
+	  /* if you have set the absolute coordinates this overrides all other changes */
+	  this->relCoordinate = this->absCoordinate - parent->getAbsCoor ();
+	}
+      else if( this->bRelCoorChanged /*&& this->timeStamp != DataTank::timeStamp*/)
+	{
+	  /*this is bad style... must be deleted later - just for testing*/
+	  if( this->parent == NULL)
 	    {
-	      printf("PNode::update () - this->bAbsCoorChanged = true\n");
-	      /* if you have set the absolute coordinates this overrides all other changes */
-	      this->relCoordinate = this->absCoordinate - parent->getAbsCoor ();
+	      this->absCoordinate = this->relCoordinate;
 	    }
-	  else if( this->bRelCoorChanged /*&& this->timeStamp != DataTank::timeStamp*/)
-	    {
-	      /*this is bad style... must be deleted later - just for testing*/
-	      if( this->parent == NULL)
-		{
-		this->absCoordinate = this->relCoordinate;
-		}
-	      else
-		this->absCoordinate = parent->getAbsCoor () + this->relCoordinate;	      /* update the current absCoordinate */
-	    }
+	  else
+	    this->absCoordinate = parent->getAbsCoor() + this->relCoordinate;	      /* update the current absCoordinate */
 	}
-      
-      if( this->mode == ROTATION && this->mode == ALL)
+    }
+  
+  if( this->mode & PNODE_LOCAL_ROTATE)
+    {
+      if( this->bAbsDirChanged /*&& this->timeStamp != DataTank::timeStamp*/)
 	{
-	  if( this->bAbsDirChanged /*&& this->timeStamp != DataTank::timeStamp*/)
-	    {
-	      /* if you have set the absolute coordinates this overrides all other changes */
-	      this->relDirection = this->absDirection - parent->getAbsDir ();
-	    }
-	  else if( this->bRelDirChanged /*&& this->timeStamp != DataTank::timeStamp*/)
-	    {
-	      /* update the current absDirection - remember * means rotation around sth.*/
-	      this->absDirection = parent->getAbsDir () * this->relDirection;
-	    }
-	}    
-      // }
+	  /* if you have set the absolute coordinates this overrides all other changes */
+	  this->relDirection = this->absDirection - parent->getAbsDir();
+	}
+      else if( this->bRelDirChanged /*&& this->timeStamp != DataTank::timeStamp*/)
+	{
+	  /* update the current absDirection - remember * means rotation around sth.*/
+	  this->absDirection = parent->getAbsDir() * this->relDirection;
+	}
+    }
+  
+  if( this->mode & PNODE_ROTATE_MOVEMENT)
+    {
+      if( this->bAbsCoorChanged /*&& this->timeStamp != DataTank::timeStamp*/)
+	{
+	  /* if you have set the absolute coordinates this overrides all other changes */
+	  this->relCoordinate = this->absCoordinate - parent->getAbsCoor ();
+	}
+      else if( this->bRelCoorChanged /*&& this->timeStamp != DataTank::timeStamp*/)
+	{
+	  /*this is bad style... must be deleted later - just for testing*/
+	  if( this->parent == NULL)
+	    this->absCoordinate = this->relCoordinate;
+	  else
+	    this->absCoordinate = parent->getAbsCoor() + parent->getAbsDir().apply(this->relCoordinate);	      /* update the current absCoordinate */
+	}
+    }
+  
+  
   PNode* pn = this->children->enumerate();
   while( pn != NULL) 
@@ -397,5 +473,5 @@
       if( this->bRelDirChanged || this->bAbsDirChanged)
 	pn->parentDirChanged ();
-      pn->update(timeStamp);
+      pn->update();
       pn = this->children->nextElement();
     }
@@ -415,5 +491,5 @@
 void PNode::processTick (float dt)
 {
-  this->tick (dt);
+  //this->tick (dt);
   PNode* pn = this->children->enumerate();
   while( pn != NULL) 
@@ -424,9 +500,4 @@
 }
 
-/**
-   \param dt time to tick
-*/
-void PNode::tick (float dt)
-{}
 
 /**
@@ -435,5 +506,5 @@
 void PNode::debug()
 {
-  printf("PNode::debug() - absCoord: (%f, %f, %f)\n", 
+  PRINTF(2)("PNode::debug() - absCoord: (%f, %f, %f)\n", 
 	 this->absCoordinate.x, 
 	 this->absCoordinate.y,
@@ -451,16 +522,8 @@
 void PNode::setName (const char* newName)
 {
-	int l = strlen( newName);
-	
-	if( this->objectName != NULL) delete this->objectName;
-	this->objectName = NULL;
-	
-	if( newName != NULL)
-	{
-		this->objectName = new char[l+1];
-		
-		for( int i = 0; i < l+1; i++)
-			this->objectName[i] = newName[i];
-	}
+  if (this->objectName)
+    delete []this->objectName;
+  this->objectName = new char[strlen(newName)+1];
+  strcpy(this->objectName,newName);
 }
 
@@ -473,2 +536,3 @@
   return this->objectName;
 }
+
Index: orxonox/branches/levelloader/src/lib/coord/p_node.h
===================================================================
--- orxonox/branches/levelloader/src/lib/coord/p_node.h	(revision 3604)
+++ orxonox/branches/levelloader/src/lib/coord/p_node.h	(revision 3605)
@@ -22,12 +22,23 @@
 #define _P_NODE_H
 
-#include "stdincl.h"
+#include "base_object.h"
 
+// FORWARD DEFINITION \\
 class PNode; /* forward decleration, so that parentEntry has access to PNode */
+class Quaternion;
+class Vector;
 
 //! enumeration for the different translation-binding-types
-typedef enum parentingMode {MOVEMENT = 0, ROTATION, ALL};
+//typedef enum parentingMode {PNODE_LOCAL_ROTATE, PNODE_ROTATE_MOVEMENT, PNODE_ALL, PNODE_MOVEMENT, PNODE_ROTATE_AND_MOVE};
+// linkage modes
+#define PNODE_LOCAL_ROTATE       1    //!< Rotates all the children around their centers.
+#define PNODE_ROTATE_MOVEMENT    2    //!< Moves all the children around the center of their parent, without the rotation around their own centers.
+#define PNODE_MOVEMENT           4    //!< Moves all children along with the parent.
+// special linkage modes
+#define PNODE_ALL                3    //!< Moves all children around the center of their parent, and also rotates their centers
+#define PNODE_ROTATE_AND_MOVE    5    //!< Rotates all children around their axis, and moves them as the Parent Moves, but does not rotate around the center of their parent.
+
 //! The default mode of the translation-binding.
-#define DEFAULT_MODE ALL
+#define DEFAULT_MODE PNODE_ALL
 
 //! Patent Node is a Engine to calculate the position of an Object in respect to the position of its parent.
@@ -39,10 +50,8 @@
   virtual ~PNode ();
 
-  void destroy ();
-
   PNode* parent;            //!< a pointer to the parent node
   tList<PNode>* children;   //!< list of the children
 
-  parentingMode mode;       //!< the mode of the binding
+
 
   Vector getRelCoor ();
@@ -62,14 +71,17 @@
 
   void addChild (PNode* pNode);
-  void addChild (PNode* pNode, parentingMode mode);
+  void addChild (PNode* pNode, int parentingMode);
   void removeChild (PNode* pNode);
+  void remove();
+
+
   void setParent (PNode* parent);
   void parentCoorChanged ();
   void parentDirChanged ();
-  void setMode (parentingMode mode);
+  void setMode (int parentingMode);
+  int getMode();
 
-  virtual void update (float timeStamp);
+  virtual void update ();
   void processTick (float dt);
-  virtual void tick (float dt);
 
   void setName (const char* newName);
@@ -79,4 +91,8 @@
   void debug ();
 
+ private:
+  void init(PNode* parent);
+
+ protected:
   float timeStamp;         //!< this the timeStamp of when the abs{Coordinat, Direction} has been calculated
   char* objectName;        //!< The name of the Object
@@ -91,5 +107,8 @@
   Quaternion absDirection; //!< absolute direvtion in the world ( from (0,0,1) )
 
+  int mode;                //!< the mode of the binding
+
 };
 
 #endif /* _P_NODE_H */
+ 
Index: orxonox/branches/levelloader/src/lib/graphics/Makefile.in
===================================================================
--- orxonox/branches/levelloader/src/lib/graphics/Makefile.in	(revision 3604)
+++ orxonox/branches/levelloader/src/lib/graphics/Makefile.in	(revision 3605)
@@ -1,3 +1,3 @@
-# Makefile.in generated by automake 1.8.2 from Makefile.am.
+# Makefile.in generated by automake 1.8.5 from Makefile.am.
 # @configure_input@
 
@@ -78,4 +78,6 @@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DOCUMENTATION_FALSE = @DOCUMENTATION_FALSE@
+DOCUMENTATION_TRUE = @DOCUMENTATION_TRUE@
 DOXYGEN = @DOXYGEN@
 DOXYGEN_FALSE = @DOXYGEN_FALSE@
@@ -175,7 +177,7 @@
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/lib/graphics/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/lib/graphics/Makefile'; \
 	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu  src/lib/graphics/Makefile
+	  $(AUTOMAKE) --foreign  src/lib/graphics/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@@ -270,12 +272,14 @@
 	tags=; \
 	here=`pwd`; \
-	if (etags --etags-include --version) >/dev/null 2>&1; then \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
 	  include_option=--etags-include; \
+	  empty_fix=.; \
 	else \
 	  include_option=--include; \
+	  empty_fix=; \
 	fi; \
 	list='$(SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
-	    test -f $$subdir/TAGS && \
+	    test ! -f $$subdir/TAGS || \
 	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
 	  fi; \
@@ -287,7 +291,9 @@
 	  $(AWK) '    { files[$$0] = 1; } \
 	       END { for (i in files) print i; }'`; \
-	test -z "$(ETAGS_ARGS)$$tags$$unique" \
-	  || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	     $$tags $$unique
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
 ctags: CTAGS
 CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
Index: orxonox/branches/levelloader/src/lib/graphics/font/fontset.cc
===================================================================
--- orxonox/branches/levelloader/src/lib/graphics/font/fontset.cc	(revision 3604)
+++ orxonox/branches/levelloader/src/lib/graphics/font/fontset.cc	(revision 3605)
@@ -45,5 +45,6 @@
 #include <stdarg.h>
 
-#include "../importer/texture.h"
+#include "texture.h"
+#include <string.h>
 
 /** 
Index: orxonox/branches/levelloader/src/lib/graphics/importer/Makefile.in
===================================================================
--- orxonox/branches/levelloader/src/lib/graphics/importer/Makefile.in	(revision 3604)
+++ orxonox/branches/levelloader/src/lib/graphics/importer/Makefile.in	(revision 3605)
@@ -1,3 +1,3 @@
-# Makefile.in generated by automake 1.8.2 from Makefile.am.
+# Makefile.in generated by automake 1.8.5 from Makefile.am.
 # @configure_input@
 
@@ -42,5 +42,5 @@
 subdir = src/lib/graphics/importer
 DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
-	$(srcdir)/Makefile.in TODO
+	$(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
@@ -50,5 +50,5 @@
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
-am__installdirs = $(DESTDIR)$(bindir)
+am__installdirs = "$(DESTDIR)$(bindir)"
 binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 PROGRAMS = $(bin_PROGRAMS)
@@ -98,4 +98,6 @@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DOCUMENTATION_FALSE = @DOCUMENTATION_FALSE@
+DOCUMENTATION_TRUE = @DOCUMENTATION_TRUE@
 DOXYGEN = @DOXYGEN@
 DOXYGEN_FALSE = @DOXYGEN_FALSE@
@@ -215,7 +217,7 @@
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/lib/graphics/importer/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/lib/graphics/importer/Makefile'; \
 	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu  src/lib/graphics/importer/Makefile
+	  $(AUTOMAKE) --foreign  src/lib/graphics/importer/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@@ -237,5 +239,5 @@
 install-binPROGRAMS: $(bin_PROGRAMS)
 	@$(NORMAL_INSTALL)
-	$(mkdir_p) $(DESTDIR)$(bindir)
+	test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
 	@list='$(bin_PROGRAMS)'; for p in $$list; do \
 	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
@@ -243,6 +245,6 @@
 	  ; then \
 	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
-	   echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \
-	   $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
 	  else :; fi; \
 	done
@@ -252,6 +254,6 @@
 	@list='$(bin_PROGRAMS)'; for p in $$list; do \
 	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
-	  echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
-	  rm -f $(DESTDIR)$(bindir)/$$f; \
+	  echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(bindir)/$$f"; \
 	done
 
@@ -330,7 +332,9 @@
 	  $(AWK) '    { files[$$0] = 1; } \
 	       END { for (i in files) print i; }'`; \
-	test -z "$(ETAGS_ARGS)$$tags$$unique" \
-	  || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	     $$tags $$unique
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
 ctags: CTAGS
 CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
@@ -387,5 +391,7 @@
 all-am: Makefile $(PROGRAMS) $(HEADERS)
 installdirs:
-	$(mkdir_p) $(DESTDIR)$(bindir)
+	for dir in "$(DESTDIR)$(bindir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
 install: install-am
 install-exec: install-exec-am
Index: orxonox/branches/levelloader/src/lib/graphics/importer/array.cc
===================================================================
--- orxonox/branches/levelloader/src/lib/graphics/importer/array.cc	(revision 3604)
+++ orxonox/branches/levelloader/src/lib/graphics/importer/array.cc	(revision 3605)
@@ -13,4 +13,6 @@
    co-programmer: ...
 */
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_IMPORTER
 
 #include "array.h"
@@ -30,5 +32,5 @@
 Array::~Array()
 {
-  PRINTF(2)("deleting array\n");
+  PRINTF(4)("deleting array\n");
   Entry* walker = this->firstEntry;
   Entry* previous;
@@ -49,5 +51,5 @@
 void Array::initializeArray ()
 {
-  PRINTF(2)("crating new Array\n");
+  PRINTF(4)("crating new Array\n");
   this->firstEntry = new Entry;
   this->firstEntry->next =NULL;
@@ -64,5 +66,5 @@
 void Array::finalizeArray (void)
 {
-  PRINTF(3)("Finalizing array. Length: %i\n", entryCount);  
+  PRINTF(4)("Finalizing array. Length: %i\n", entryCount);  
   //  if ((array = (GLfloat*)malloc( entryCount* sizeof(GLfloat))) == NULL)
   if (!(this->array = new GLfloat [this->entryCount]))
@@ -87,5 +89,5 @@
   if (!this->finalized)
     {
-      PRINTF(3)("adding new Entry to Array: %f\n", entry);
+      PRINTF(5)("adding new Entry to Array: %f\n", entry);
       
       this->currentEntry->value = entry;
@@ -96,5 +98,5 @@
     }
   else 
-    PRINTF(1)("adding failed, because list has been finalized\n");
+    PRINTF(2)("adding failed, because list has been finalized\n");
 }
 
@@ -131,4 +133,4 @@
 void Array::debug ()
 {
-  PRINTF(0)("entryCount=%i, address=%p\n", this->entryCount, this->array);
+  PRINT(0)("entryCount=%i, address=%p\n", this->entryCount, this->array);
 }
Index: orxonox/branches/levelloader/src/lib/graphics/importer/array.h
===================================================================
--- orxonox/branches/levelloader/src/lib/graphics/importer/array.h	(revision 3604)
+++ orxonox/branches/levelloader/src/lib/graphics/importer/array.h	(revision 3605)
@@ -8,6 +8,4 @@
 #ifndef _ARRAY_H
 #define _ARRAY_H
-
-extern int verbose; //!< will be obsolete soon
 
 #include "stdincl.h"
Index: orxonox/branches/levelloader/src/lib/graphics/importer/material.cc
===================================================================
--- orxonox/branches/levelloader/src/lib/graphics/importer/material.cc	(revision 3604)
+++ orxonox/branches/levelloader/src/lib/graphics/importer/material.cc	(revision 3605)
@@ -15,7 +15,10 @@
 */
 
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_IMPORTER
+
 #include "material.h"
 
 #include "texture.h"
+#include "debug.h"
 #include <stdlib.h>
 #include <string.h>
@@ -51,5 +54,5 @@
 Material::~Material()
 {
-  PRINTF(2)("delete Material %s.\n", this->name);
+  PRINTF(4)("delete Material %s.\n", this->name);
   if (this->name)
     delete []this->name;
@@ -67,5 +70,5 @@
 Material* Material::addMaterial(char* mtlName)
 {
-  PRINTF(2)("adding Material %s.\n", mtlName);
+  PRINTF(4)("adding Material %s.\n", mtlName);
    Material* tmpMat = this;
   while (tmpMat->nextMat != NULL)
@@ -83,5 +86,5 @@
 void Material::init(void)
 {
-  PRINTF(2)("initializing new Material.\n");
+  PRINTF(4)("initializing new Material.\n");
   this->nextMat = NULL;
   this->name ="";
@@ -112,17 +115,17 @@
 Material* Material::search(char* mtlName)
 {
-  PRINTF(2)("Searching for material %s", mtlName);
+  PRINTF(5)("Searching for material %s", mtlName);
   Material* searcher = this;
   while (searcher != NULL)
     {
-      PRINT(2)(".");
+      PRINT(5)(".");
       if (!strcmp (searcher->getName(), mtlName))
 	{
-	  PRINT(2)("found.\n");
+	  PRINT(5)("found.\n");
 	  return searcher;
 	}
       searcher = searcher->nextMat;
     }
-  PRINT(2)("not found\n");
+  PRINT(2)("material %s not found\n", mtlName);
   return NULL;
 }
@@ -153,8 +156,13 @@
 
   if (this->diffuseTextureSet)
-    glBindTexture(GL_TEXTURE_2D, this->diffuseTexture->getTexture());
+    {
+      glEnable(GL_TEXTURE_2D);
+      glBindTexture(GL_TEXTURE_2D, this->diffuseTexture->getTexture());
+    }
   else
-    glBindTexture(GL_TEXTURE_2D, 0);
-  
+    {
+      glDisable(GL_TEXTURE_2D);
+      glBindTexture(GL_TEXTURE_2D, 0);
+    }
 }
 
@@ -166,5 +174,5 @@
 void Material::setName (char* mtlName)
 {
-  PRINTF(3)("setting Material Name to %s.\n", this->name);
+  PRINTF(4)("setting Material Name to %s.\n", this->name);
   this->name = new char [strlen(mtlName)+1];
   strcpy(this->name, mtlName);
@@ -185,7 +193,6 @@
 void Material::setIllum (int illum)
 {
-  PRINTF(3)("setting illumModel of Material %s to %i\n", this->name, illum);
+  PRINTF(4)("setting illumModel of Material %s to %i\n", this->name, illum);
   this->illumModel = illum;
-  //  PRINTF(3)("setting illumModel to: %i\n", illumModel);
 }
 /**
@@ -205,5 +212,5 @@
 void Material::setDiffuse (float r, float g, float b)
 {
-  PRINTF(3)("setting Diffuse Color of Material %s to r=%f g=%f b=%f.\n", this->name, r, g, b);
+  PRINTF(4)("setting Diffuse Color of Material %s to r=%f g=%f b=%f.\n", this->name, r, g, b);
   this->diffuse[0] = r;
   this->diffuse[1] = g;
@@ -231,5 +238,5 @@
 void Material::setAmbient (float r, float g, float b)
 {
-  PRINTF(3)("setting Ambient Color of Material %s to r=%f g=%f b=%f.\n", this->name, r, g, b);
+  PRINTF(4)("setting Ambient Color of Material %s to r=%f g=%f b=%f.\n", this->name, r, g, b);
   this->ambient[0] = r;
   this->ambient[1] = g;
@@ -256,5 +263,5 @@
 void Material::setSpecular (float r, float g, float b)
 {
-  PRINTF(3)("setting Specular Color of Material %s to r=%f g=%f b=%f.\n", this->name, r, g, b);
+  PRINTF(4)("setting Specular Color of Material %s to r=%f g=%f b=%f.\n", this->name, r, g, b);
   this->specular[0] = r;
   this->specular[1] = g;
@@ -296,5 +303,5 @@
 void Material::setTransparency (float trans)
 {
-  PRINTF(3)("setting Transparency of Material %s to %f.\n", this->name, trans);
+  PRINTF(4)("setting Transparency of Material %s to %f.\n", this->name, trans);
   this->transparency = trans;
 }
@@ -325,5 +332,5 @@
 void Material::setDiffuseMap(char* dMap)
 {
-  PRINTF(3)("setting Diffuse Map %s\n", dMap);
+  PRINTF(4)("setting Diffuse Map %s\n", dMap);
   diffuseTexture = new Texture();
   this->diffuseTextureSet = diffuseTexture->loadImage(dMap);
Index: orxonox/branches/levelloader/src/lib/graphics/importer/material.h
===================================================================
--- orxonox/branches/levelloader/src/lib/graphics/importer/material.h	(revision 3604)
+++ orxonox/branches/levelloader/src/lib/graphics/importer/material.h	(revision 3605)
@@ -9,7 +9,4 @@
 #define _MATERIAL_H
 
-
-
-extern int verbose; //!< will be obsolete soon.
 
 #if HAVE_CONFIG_H 
Index: orxonox/branches/levelloader/src/lib/graphics/importer/model.cc
===================================================================
--- orxonox/branches/levelloader/src/lib/graphics/importer/model.cc	(revision 3604)
+++ orxonox/branches/levelloader/src/lib/graphics/importer/model.cc	(revision 3605)
@@ -13,4 +13,6 @@
    co-programmer: ...
 */
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_IMPORTER
 
 #include "model.h"
@@ -80,14 +82,14 @@
 Model::~Model(void)
 {
-  PRINTF(3)("Deleting Model ");
+  PRINTF(4)("Deleting Model ");
   if (this->name)
     {
-      PRINT(3)("%s\n", this->name);
+      PRINT(4)("%s\n", this->name);
       delete []this->name;
     }
   else
-      PRINT(3)("\n");
-
-  PRINTF(3)("Deleting display Lists.\n");
+      PRINT(4)("\n");
+
+  PRINTF(4)("Deleting display Lists.\n");
   Group* walker = this->firstGroup;
   while (walker != NULL)
@@ -99,5 +101,5 @@
     }
 
-  PRINTF(3)("Deleting Materials.\n");
+  PRINTF(4)("Deleting Materials.\n");
   if (this->material)
     delete this->material;
@@ -122,9 +124,9 @@
 void Model::draw (void) const
 {
-  PRINTF(2)("drawing the 3D-Models\n"); 
+  PRINTF(4)("drawing the 3D-Models\n"); 
   Group* walker = this->firstGroup;
   while (walker != NULL)
     {
-      PRINTF(3)("Drawing model %s\n", walker->name);
+      PRINTF(5)("Drawing model %s\n", walker->name);
       glCallList (walker->listNumber);
       walker = walker->next;
@@ -142,8 +144,8 @@
   if (groupNumber >= this->groupCount)
     {
-      PRINTF(1)("You requested model number %i, but this File only contains of %i Models.\n", groupNumber-1, this->groupCount);
+      PRINTF(2)("You requested model number %i, but this File only contains of %i Models.\n", groupNumber-1, this->groupCount);
       return;
     }
-  PRINTF(2)("drawing the requested 3D-Models if found.\n"); 
+  PRINTF(4)("drawing the requested 3D-Models if found.\n"); 
   Group* walker = this->firstGroup;
   int counter = 0;
@@ -152,5 +154,5 @@
       if (counter == groupNumber)
 	{
-	  PRINTF(2)("Drawing model number %i named %s\n", counter, walker->name);
+	  PRINTF(4)("Drawing model number %i named %s\n", counter, walker->name);
 	  glCallList (walker->listNumber);
 	  return;
@@ -159,5 +161,5 @@
       walker = walker->next;
     }
-  PRINTF(1)("Model number %i in %s not Found.\n", groupNumber, this->name);
+  PRINTF(2)("Model number %i in %s not Found.\n", groupNumber, this->name);
   return;
 
@@ -172,5 +174,5 @@
 void Model::draw (char* groupName) const
 {
-  PRINTF(2)("drawing the requested 3D-Models if found.\n"); 
+  PRINTF(4)("drawing the requested 3D-Models if found.\n"); 
   Group* walker = this->firstGroup;
   while (walker != NULL)
@@ -178,5 +180,5 @@
       if (!strcmp(walker->name, groupName))
 	{
-	  PRINTF(2)("Drawing model %s\n", walker->name);
+	  PRINTF(4)("Drawing model %s\n", walker->name);
 	  glCallList (walker->listNumber);
 	  return;
@@ -184,5 +186,5 @@
       walker = walker->next;
     }
-  PRINTF(1)("Model Named %s in %s not Found.\n", groupName, this->name);
+  PRINTF(2)("Model Named %s in %s not Found.\n", groupName, this->name);
   return;
 }
@@ -204,5 +206,5 @@
 bool Model::initialize (void)
 {
-  PRINTF(2)("new 3D-Model is being created\n"); 
+  PRINTF(4)("new 3D-Model is being created\n"); 
 
   this->name = NULL;
@@ -243,5 +245,5 @@
 bool Model::initGroup(Group* group)
 {
-  PRINTF(3)("Adding new Group\n");
+  PRINTF(4)("Adding new Group\n");
   group->name = "";
   group->faceMode = -1;
@@ -277,5 +279,5 @@
 bool Model::cleanup(void)
 {
-  PRINTF(3)("cleaning up the 3D-Model to save Memory.\n");
+  PRINTF(4)("cleaning up the 3D-Model to save Memory.\n");
 
   if (this->vertices)
@@ -296,5 +298,5 @@
 bool Model::cleanupGroup (Group* group)
 {
-  PRINTF(3)("Cleaning up group\n");
+  PRINTF(5)("Cleaning up group\n");
   if (group->firstFace != NULL)
     {
@@ -314,5 +316,5 @@
 bool Model::cleanupFace (Face* face)
 {
-  PRINTF(3)("Cleaning up Face\n");
+  PRINTF(5)("Cleaning up Face\n");
 
   if (face->materialString != NULL)
@@ -355,5 +357,5 @@
 bool Model::addGroup (char* groupString)
 {
-  PRINTF(3)("Read Group: %s.\n", groupString);
+  PRINTF(5)("Read Group: %s.\n", groupString);
   if (this->groupCount != 0 && this->currentGroup->faceCount>0)
     {
@@ -384,5 +386,5 @@
   float subbuffer3;
   sscanf (vertexString, "%f %f %f", &subbuffer1, &subbuffer2, &subbuffer3);
-  PRINTF(3)("reading in a vertex: %f %f %f\n", &subbuffer1, &subbuffer2, &subbuffer3);
+  PRINTF(5)("reading in a vertex: %f %f %f\n", &subbuffer1, &subbuffer2, &subbuffer3);
   this->vertices->addEntry(subbuffer1*scaleFactor, subbuffer2*scaleFactor, subbuffer3*scaleFactor);
   return true;
@@ -398,5 +400,5 @@
 bool Model::addVertex(const float x, const float y, const float z)
 {
-  PRINTF(4)("reading in a vertex: %f %f %f\n", x, y, z);
+  PRINTF(5)("reading in a vertex: %f %f %f\n", x, y, z);
   this->vertices->addEntry(x*scaleFactor, y*scaleFactor, z*scaleFactor);
   return true;
@@ -513,5 +515,5 @@
   float subbuffer3;
   sscanf (normalString, "%f %f %f", &subbuffer1, &subbuffer2, &subbuffer3);
-  PRINTF(3)("found vertex-Normal %f, %f, %f\n", &subbuffer1,&subbuffer2,&subbuffer3);
+  PRINTF(5)("found vertex-Normal %f, %f, %f\n", &subbuffer1,&subbuffer2,&subbuffer3);
   this->normals->addEntry(subbuffer1, subbuffer2, subbuffer3);
   return true;
@@ -544,5 +546,5 @@
   float subbuffer2;
   sscanf (vTextureString, "%f %f", &subbuffer1, &subbuffer2);
-  PRINTF(3)("found vertex-Texture %f, %f\n", &subbuffer1, &subbuffer2);
+  PRINTF(5)("found vertex-Texture %f, %f\n", &subbuffer1, &subbuffer2);
   this->vTexture->addEntry(subbuffer1);
   this->vTexture->addEntry(subbuffer2);
@@ -610,5 +612,5 @@
       if ((this->currentGroup->listNumber = glGenLists(1)) == 0)
 	{
-	  PRINTF(1)("list could not be created for this Model\n");
+	  PRINTF(2)("glList could not be created for this Model\n");
 	  return false;
 	}
@@ -628,8 +630,8 @@
 		{
 		  tmpMat->select();
-		  PRINTF(2)("using material %s for coming Faces.\n", tmpFace->materialString);
+		  PRINTF(5)("using material %s for coming Faces.\n", tmpFace->materialString);
 		}
 	      else 
-		PRINTF(1)("material %s not found.\n", tmpFace->materialString);
+		PRINTF(2)("material %s not found.\n", tmpFace->materialString);
 
 
@@ -646,5 +648,5 @@
 	      
 	      this->currentGroup->faceMode = 3;
-	      PRINTF(3)("found triag.\n");
+	      PRINTF(5)("found triag.\n");
 	    }
 	  
@@ -658,5 +660,5 @@
 		}
 	      this->currentGroup->faceMode = 4;
-	      PRINTF(3)("found quad.\n");
+	      PRINTF(5)("found quad.\n");
 	    }
 	  
@@ -666,5 +668,5 @@
 		glEnd();
 	      glBegin(GL_POLYGON);
-	      PRINTF(3)("Polygon with %i faces found.", tmpFace->vertexCount);
+	      PRINTF(5)("Polygon with %i faces found.", tmpFace->vertexCount);
 	      this->currentGroup->faceMode = tmpFace->vertexCount;
 	    }
@@ -698,5 +700,5 @@
 bool Model::addGLElement (FaceElement* elem)
 {
-  PRINTF(3)("importing grafical Element to openGL.\n");
+  PRINTF(5)("importing grafical Element to openGL.\n");
 
   if (elem->texCoordNumber != -1)
@@ -721,5 +723,5 @@
 {
   
-  PRINTF(2)("Normals are being calculated.\n");
+  PRINTF(4)("Normals are being calculated.\n");
 
   Vector* normArray = new Vector [vertices->getCount()/3];
@@ -778,5 +780,5 @@
     {
       normArray[i].normalize();
-      PRINTF(3)("Found Normale number %d: (%f; %f, %f).\n", i, normArray[i].x, normArray[i].y, normArray[i].z);
+      PRINTF(5)("Found Normale number %d: (%f; %f, %f).\n", i, normArray[i].x, normArray[i].y, normArray[i].z);
       
       this->normals->addEntry(normArray[i].x, normArray[i].y, normArray[i].z);
@@ -881,5 +883,5 @@
 	//printf ("%f %f\n", vz, sin (vz));
 	if (i==0.0)
-		  printf("%f, %f\n", j/df*2.0*PI, cos(j/df*PI));
+	  PRINTF(0)("%f, %f\n", j/df*2.0*PI, cos(j/df*PI));
       }
     }
Index: orxonox/branches/levelloader/src/lib/graphics/importer/objModel.cc
===================================================================
--- orxonox/branches/levelloader/src/lib/graphics/importer/objModel.cc	(revision 3604)
+++ orxonox/branches/levelloader/src/lib/graphics/importer/objModel.cc	(revision 3605)
@@ -13,4 +13,6 @@
    co-programmer: ...
 */
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_IMPORTER
 
 #include "objModel.h"
@@ -86,5 +88,5 @@
 bool OBJModel::importFile (const char* fileName)
 {
-  PRINTF(3)("preparing to read in file: %s\n", fileName);
+  PRINTF(4)("preparing to read in file: %s\n", fileName);
 
 
@@ -107,9 +109,8 @@
   strncpy(this->objPath, fileName, name-fileName);
   this->objPath[name-fileName] = '\0';
-  if (verbose>=2)
-    if (strlen(objPath)> 0)
-      PRINTF(0)("Resolved file %s to folder: %s.\n", name, objPath);
-    else
-      PRINTF(0)("Resolved file %s.\n", name);
+  if (strlen(objPath)> 0)
+    PRINTF(5)("Resolved file %s to folder: %s.\n", name, objPath);
+  else
+    PRINTF(5)("Resolved file %s.\n", name);
   
   this->setName(name);
@@ -144,10 +145,10 @@
       return false;
     }
-  PRINTF(2)("Reading from opened file %s\n", fileName);
+  PRINTF(4)("Reading from opened file %s\n", fileName);
   char Buffer[10000];
   while(!OBJ_FILE->eof())
     {
       OBJ_FILE->getline(Buffer, 10000);
-      PRINTF(3)("Read input line: %s\n", Buffer);
+      PRINTF(5)("Read input line: %s\n", Buffer);
       
 
@@ -192,6 +193,5 @@
       else if (!strncmp(Buffer, "s ", 2)) //! \todo smoothing groups have to be implemented
 	{
-	  if (verbose >= 2)
-	    PRINTF(2)("smoothing groups not supportet yet. line: %s\n", Buffer);
+	  PRINTF(3)("smoothing groups not supportet yet. line: %s\n", Buffer);
 	}
     }
@@ -221,10 +221,10 @@
   
 
-  PRINTF(3)("Opening mtlFile: %s\n", fileName);
+  PRINTF(4)("Opening mtlFile: %s\n", fileName);
 
   ifstream* MTL_FILE = new ifstream (fileName);
   if (MTL_FILE->fail())
     {
-      PRINTF(1)("unable to open file: %s\n", fileName);
+      PRINTF(2)("unable to open file: %s\n", fileName);
       MTL_FILE->close();
       delete []fileName;
@@ -237,5 +237,5 @@
     {
       MTL_FILE->getline(Buffer, 500);
-      PRINTF(4)("found line in mtlFile: %s\n", Buffer);
+      PRINTF(5)("found line in mtlFile: %s\n", Buffer);
       
 
Index: orxonox/branches/levelloader/src/lib/graphics/importer/texture.cc
===================================================================
--- orxonox/branches/levelloader/src/lib/graphics/importer/texture.cc	(revision 3604)
+++ orxonox/branches/levelloader/src/lib/graphics/importer/texture.cc	(revision 3605)
@@ -17,4 +17,6 @@
 */
 
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_IMPORTER
 
 #include "texture.h"
@@ -87,5 +89,5 @@
   if (pName[0] == '\0')
     {
-      PRINTF(3)("not Adding empty Path to the List.\n");
+      PRINTF(2)("not Adding empty Path to the List.\n");
       return;
     }
@@ -99,5 +101,5 @@
       if (status.st_mode & S_IFDIR)
 	{
-	  PRINTF(2)("Adding Path %s to the PathList.\n", pName);
+	  PRINTF(4)("Adding Path %s to the PathList.\n", pName);
 	  PathList* tmpPathList = this;
 	  while (tmpPathList->next)
@@ -193,5 +195,5 @@
 bool Texture::loadTexToGL (Image* pImage)
 {
-  PRINTF(2)("Loading texture to OpenGL-Environment.\n");
+  PRINTF(4)("Loading texture to OpenGL-Environment.\n");
   glGenTextures(1, &this->texture);
   glBindTexture(GL_TEXTURE_2D, this->texture);
@@ -229,5 +231,4 @@
 	pImage->format = GL_RGBA;
 	  
-      PRINTF(0)("Bits Per Pixel: %d\n", pImage->bpp);
       if( !IMG_isPNG(SDL_RWFromFile(imgNameWithPath, "rb")) && !IMG_isJPG(SDL_RWFromFile(imgNameWithPath, "rb")))
 	for (int i=0;i<map->h * map->w *3;i+=3)
@@ -249,5 +250,5 @@
   else
     {
-      PRINTF(1)("Image not Found: %s\n", imgNameWithPath);
+      PRINTF(2)("Image not Found: %s\n", imgNameWithPath);
       return false;
     }
@@ -268,5 +269,5 @@
       if (!strncmp(imgNameWithPath+strlen(imgNameWithPath)-4, ".bmp", 4))
 	{
-	  PRINTF(3)("Requested bmp-image. Trying to Import.\n");
+	  PRINTF(4)("Requested bmp-image. Trying to Import.\n");
 	  return this->loadBMP(imgNameWithPath);
 	}
@@ -274,20 +275,20 @@
       else if (!strncmp(imgNameWithPath+strlen(imgNameWithPath)-4, ".jpg", 4) || !strncmp(imgNameWithPath+strlen(imgNameWithPath)-5, ".jpg", 5))
 	{
-	  PRINTF(3)("Requested jpeg-image. Trying to Import\n");
+	  PRINTF(4)("Requested jpeg-image. Trying to Import\n");
 	  return this->loadJPG(imgNameWithPath);
 	}
       else if (!strncmp(imgNameWithPath+strlen(imgNameWithPath)-4, ".tga", 4))
 	{
-	  PRINTF(3)("Requested tga-image. Trying to Import\n");
+	  PRINTF(4)("Requested tga-image. Trying to Import\n");
 	  return this->loadTGA(imgNameWithPath);
 	}
       else if (!strncmp(imgNameWithPath+strlen(imgNameWithPath)-4, ".png", 4))
 	{
-	  PRINTF(3)("Requested png-image. Trying to Import\n");
+	  PRINTF(4)("Requested png-image. Trying to Import\n");
 	  return this->loadPNG(imgNameWithPath);
 	}
       else
 	{
-	  PRINTF(1)("Requested Image was not recognized in its type. (Maybe a type-Cast-error.)\n FileName: %s", imgNameWithPath);
+	  PRINTF(2)("Requested Image was not recognized in its type. (Maybe a type-Cast-error.)\n FileName: %s", imgNameWithPath);
 	  return false;
 	}
@@ -295,5 +296,5 @@
   else
     {
-      PRINTF(1)("Image not Found: %s\n", imgNameWithPath);
+      PRINTF(2)("Image not Found: %s\n", imgNameWithPath);
       return false;
     }
@@ -316,5 +317,5 @@
   if ((file = fopen(bmpName, "rb"))==NULL)
     {
-      PRINTF(1)("File Not Found : %s\n",bmpName);
+      PRINTF(2)("File Not Found : %s\n",bmpName);
       return false;
     }
@@ -325,5 +326,5 @@
   if ((i = fread(&pImage->width, 4, 1, file)) != 1) 
     {
-      PRINTF(1)("Error reading width from %s.\n", bmpName);
+      PRINTF(2)("Error reading width from %s.\n", bmpName);
       return false;
     }
@@ -331,5 +332,5 @@
   if ((i = fread(&pImage->height, 4, 1, file)) != 1) 
     {
-      PRINTF(1)("Error reading height from %s.\n", bmpName);
+      PRINTF(2)("Error reading height from %s.\n", bmpName);
       return false;
     }
@@ -341,5 +342,5 @@
   if ((fread(&planes, 2, 1, file)) != 1) 
     {
-      PRINTF(1)("Error reading planes from %s.\n", bmpName);
+      PRINTF(2)("Error reading planes from %s.\n", bmpName);
       return false;
     }
@@ -353,10 +354,10 @@
   if ((i = fread(&bpp, 2, 1, file)) != 1) 
     {
-      PRINTF(1)("Error reading bpp from %s.\n", bmpName);
+      PRINTF(2)("Error reading bpp from %s.\n", bmpName);
       return false;
     }
   if (bpp != 24) 
     {
-      PRINTF(1)("Bpp from %s is not 24: %u\n", bmpName, bpp);
+      PRINTF(2)("Bpp from %s is not 24: %u\n", bmpName, bpp);
       return false;
     }
@@ -369,5 +370,5 @@
   if (pImage->data == NULL) 
     {
-      PRINTF(1)("Error allocating memory for color-corrected image data");
+      PRINTF(2)("Error allocating memory for color-corrected image data");
       return false;	
     }
@@ -375,5 +376,5 @@
   if ((i = fread(pImage->data, size, 1, file)) != 1) 
     {
-      PRINTF(1)("Error reading image data from %s.\n", bmpName);
+      PRINTF(2)("Error reading image data from %s.\n", bmpName);
       return false;
     }
@@ -418,5 +419,5 @@
     {
       // Display an error message saying the file was not found, then return NULL
-      PRINTF(1)("Unable to load JPG File %s.\n", jpgName);
+      PRINTF(2)("Unable to load JPG File %s.\n", jpgName);
       return false;
     }
@@ -521,5 +522,5 @@
   if(fTGA == NULL)
     {
-      PRINTF(1)("Error could not open texture file: %s\n", tgaName);
+      PRINTF(2)("Error could not open texture file: %s\n", tgaName);
       return false;
     }
@@ -527,5 +528,5 @@
   if(fread(&tgaHeader, sizeof(TGAHeader), 1, fTGA) == 0)
     {
-      PRINTF(1)("Error could not read file header of %s\n", tgaName);
+      PRINTF(2)("Error could not read file header of %s\n", tgaName);
       if(fTGA != NULL)
 	{
@@ -549,5 +550,5 @@
   else
     {
-      PRINTF(1)("Error TGA file be type 2 or type 10\n");
+      PRINTF(2)("Error TGA file be type 2 or type 10\n");
       if (fTGA)
 	fclose(fTGA);
@@ -576,5 +577,5 @@
   if(fread(header, sizeof(header), 1, fTGA) == 0)
     {
-      PRINTF(1)("Error could not read info header\n");
+      PRINTF(2)("Error could not read info header\n");
       return false;
     }
@@ -586,5 +587,5 @@
   if((pImage->width <= 0) || (pImage->height <= 0) || ((pImage->bpp != 24) && (pImage->bpp !=32)))
     {
-      PRINTF(1)("Error invalid texture information\n");
+      PRINTF(2)("Error invalid texture information\n");
       return false;
     }
@@ -605,5 +606,5 @@
   if(pImage->data == NULL)
     {
-      PRINTF(1)("Error could not allocate memory for image\n");
+      PRINTF(2)("Error could not allocate memory for image\n");
       return false;
     }
@@ -611,5 +612,5 @@
   if(fread(pImage->data, 1, imageSize, fTGA) != imageSize)
     {
-      PRINTF(1)("Error could not read image data\n");
+      PRINTF(2)("Error could not read image data\n");
       if(pImage->data != NULL)
 	{
@@ -648,5 +649,5 @@
   if(fread(header, sizeof(header), 1, fTGA) == 0)
     {
-      PRINTF(1)("Error could not read info header\n");
+      PRINTF(2)("Error could not read info header\n");
       return false;
     }
@@ -664,5 +665,5 @@
   if((pImage->width <= 0) || (pImage->height <= 0) || ((pImage->bpp != 24) && (pImage->bpp !=32)))
     {
-      PRINTF(1)("Error Invalid pImage information\n");
+      PRINTF(2)("Error Invalid pImage information\n");
       return false;
     }
@@ -674,5 +675,5 @@
   if(pImage->data == NULL)
     {
-      PRINTF(1)("Error could not allocate memory for image\n");
+      PRINTF(2)("Error could not allocate memory for image\n");
       return false;
     }
@@ -684,5 +685,5 @@
       if(fread(&chunkheader, sizeof(GLubyte), 1, fTGA) == 0)
 	{
-	  PRINTF(1)("Error could not read RLE header\n");
+	  PRINTF(2)("Error could not read RLE header\n");
 	  if(pImage->data != NULL)
 	    {
@@ -702,5 +703,5 @@
 	      if(fread(colorbuffer, 1, bytesPerPixel, fTGA) != bytesPerPixel)
 		{
-		  PRINTF(1)("Error could not read image data\n");
+		  PRINTF(2)("Error could not read image data\n");
 		  if(colorbuffer != NULL)
 		    {
@@ -732,5 +733,5 @@
 	      if(currentpixel > pixelcount)	
 		{
-		  PRINTF(1)("Error too many pixels read\n");
+		  PRINTF(2)("Error too many pixels read\n");
 		  if(colorbuffer != NULL)
 		    {
@@ -754,5 +755,5 @@
 	  if(fread(colorbuffer, 1, bytesPerPixel, fTGA) != bytesPerPixel) // Attempt to read following color values 
 	    {
-	      PRINTF(1)("Error could not read from file");
+	      PRINTF(2)("Error could not read from file");
 	      if(colorbuffer != NULL)
 		{
@@ -785,5 +786,5 @@
 	      if(currentpixel > pixelcount)
 		{
-		  PRINTF(1)("Error too many pixels read\n");
+		  PRINTF(2)("Error too many pixels read\n");
 		  if(colorbuffer != NULL)
 		    {
Index: orxonox/branches/levelloader/src/lib/graphics/importer/texture.h
===================================================================
--- orxonox/branches/levelloader/src/lib/graphics/importer/texture.h	(revision 3604)
+++ orxonox/branches/levelloader/src/lib/graphics/importer/texture.h	(revision 3605)
@@ -10,5 +10,8 @@
 #define _TEXTURE_H
 
-#include "stdincl.h"
+#include "glincl.h"
+
+#include "debug.h"
+
 #ifdef HAVE_SDL_SDL_IMAGE_H
 #include <SDL/SDL_image.h>
Index: orxonox/branches/levelloader/src/lib/graphics/importer/windowHandler.h
===================================================================
--- orxonox/branches/levelloader/src/lib/graphics/importer/windowHandler.h	(revision 3604)
+++ orxonox/branches/levelloader/src/lib/graphics/importer/windowHandler.h	(revision 3605)
@@ -7,6 +7,4 @@
 #ifndef _WINDOWHANDLER_H
 #define _WINDOWHANDLER_H
-
-extern int verbose;
 
 #include "stdincl.h"
Index: orxonox/branches/levelloader/src/lib/graphics/light.cc
===================================================================
--- orxonox/branches/levelloader/src/lib/graphics/light.cc	(revision 3605)
+++ orxonox/branches/levelloader/src/lib/graphics/light.cc	(revision 3605)
@@ -0,0 +1,524 @@
+
+
+/* 
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   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 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Benjamin Grauer
+   co-programmer: ...
+*/
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_LIGHT
+
+#include "light.h"
+
+#include "glincl.h"
+
+using namespace std;
+
+//! Definition of the Lights
+int lightsV[] = {GL_LIGHT0, GL_LIGHT1, GL_LIGHT2, GL_LIGHT3, GL_LIGHT4, GL_LIGHT5, GL_LIGHT6, GL_LIGHT7};
+
+
+/**
+   \param lightNumber the Light Number to initiate
+*/
+Light::Light(int lightNumber)
+{
+  this->setClassName("Light");
+  char tmpName[7];
+  sprintf(tmpName, "Light%d", lightNumber);
+  this->setName(tmpName);
+
+  PRINTF(4)("initializing Light number %d.\n", lightNumber);
+  // enable The light
+  glEnable(lightsV[lightNumber]); // postSpawn
+  
+  // set values (defaults)
+  this->lightNumber = lightNumber;
+  this->setPosition(0.0, 0.0, 0.0);
+  this->setDiffuseColor(1.0, 1.0, 1.0);
+  this->setSpecularColor(1.0, 1.0, 1.0);
+}
+
+/**
+   \brief destroys a Light
+*/
+Light::~Light(void)
+{
+  glDisable(lightsV[this->lightNumber]);
+}
+
+/**
+   \brief Sets a Position for the Light.
+   \param position The new position of the Light.
+   \todo patrick: is it ok to set a Light Position even if it is derived from p_node??
+*/
+void Light::setPosition(Vector position)
+{
+  this->lightPosition[0] = position.x;
+  this->lightPosition[1] = position.y;
+  this->lightPosition[2] = position.z;
+  this->lightPosition[3] = 0.0;
+
+  this->setAbsCoor(&position);
+
+  glLightfv (lightsV[this->lightNumber], GL_POSITION, this->lightPosition);
+}
+
+/**
+   \brief Sets a Position of this Light.
+   \param x the x-coordinate
+   \param y the y-coordinate
+   \param z the z-coordinate
+*/
+void Light::setPosition(GLfloat x, GLfloat y, GLfloat z)
+{
+  this->setPosition(Vector(x, y, z));
+}
+
+/**
+   \brief sets an emitting Diffuse color of this Light
+   \param r red
+   \param g green
+   \param b blue
+*/
+void Light::setDiffuseColor(GLfloat r, GLfloat g, GLfloat b)
+{
+  this->diffuseColor[0] = r;
+  this->diffuseColor[1] = g;
+  this->diffuseColor[2] = b;
+  this->diffuseColor[3] = 1.0;
+
+  glLightfv (lightsV[this->lightNumber], GL_DIFFUSE, this->diffuseColor);
+}
+
+/**
+   \brief sets an emitting Specular color of this Light
+   \param r red
+   \param g green
+   \param b blue
+*/
+void Light::setSpecularColor(GLfloat r, GLfloat g, GLfloat b)
+{
+  this->specularColor[0] = r;
+  this->specularColor[1] = g;
+  this->specularColor[2] = b;
+  this->specularColor[3] = 1.0;
+
+  glLightfv (lightsV[this->lightNumber], GL_SPECULAR, this->specularColor);
+}
+
+/**
+   \brief Sets the AttenuationType of this Light Source
+   \param constantAttenuation The Constant Attenuation of the Light
+   \param linearAttenuation The Linear Attenuation of the Light
+   \param quadraticAttenuation The Quadratic Attenuation of the Light
+*/
+void Light::setAttenuation(float constantAttenuation, float linearAttenuation, float quadraticAttenuation)
+{
+  this->constantAttenuation  = constantAttenuation;
+  this->linearAttenuation    = linearAttenuation;
+  this->quadraticAttenuation = quadraticAttenuation;
+
+  glLightf(lightsV[this->lightNumber], GL_CONSTANT_ATTENUATION,  constantAttenuation);
+  glLightf(lightsV[this->lightNumber], GL_LINEAR_ATTENUATION,    linearAttenuation);
+  glLightf(lightsV[this->lightNumber], GL_QUADRATIC_ATTENUATION, quadraticAttenuation);
+}
+
+/**
+   \brief stets the direction of the Spot Light.
+   \param direction The direction of the Spot Light.
+*/
+void Light::setSpotDirection(Vector direction)
+{
+  this->spotDirection[0] = direction.x;
+  this->spotDirection[1] = direction.y;
+  this->spotDirection[2] = direction.z;
+
+  glLightfv(lightsV[this->lightNumber], GL_SPOT_DIRECTION, this->spotDirection);
+}
+
+/**
+   \brief sets the cutoff angle of the Light.
+   \param cutoff The cutoff angle.
+*/
+void Light::setSpotCutoff(GLfloat cutoff)
+{
+  this->spotCutoff = cutoff;
+  glLightf(lightsV[this->lightNumber], GL_SPOT_CUTOFF, cutoff);
+}
+
+/**
+   \returns the Position of the Light
+*/
+Vector Light::getPosition() const
+{
+  return Vector(this->lightPosition[0], this->lightPosition[1], this->lightPosition[2]);
+}
+
+/**
+   \brief draws this Light. Being a World-entity the possibility to do this lies at hand.
+*/ 
+void Light::draw()
+{
+  float pos[4] = {this->getAbsCoor().x, this->getAbsCoor().y, this->getAbsCoor().z, 1.0};
+  PRINTF(4)("Drawing The Lights new Position at %f %f %f\n", pos[0], pos[1], pos[2]);
+  glLightfv(lightsV[this->lightNumber], GL_POSITION, pos);
+}
+
+/**
+   \brief Prints out some nice formated debug information about the Light
+*/
+void Light::debug(void) const
+{
+  PRINT(0)(":: %d ::  -- reference %p\n", this->lightNumber, this);
+  PRINT(0)(" GL-state: ");
+  GLboolean param; 
+  glGetBooleanv(lightsV[this->lightNumber], &param);
+  if (param)
+    PRINT(0)("ON\n");
+  else
+    PRINT(0)("OFF\n");
+  
+  PRINT(0)(" Position:      %f/%f/%f\n", this->lightPosition[0], this->lightPosition[1], this->lightPosition[2]);
+  PRINT(0)(" DiffuseColor:  %f/%f/%f\n", this->diffuseColor[0], this->diffuseColor[1], this->diffuseColor[2]);
+  PRINT(0)(" SpecularColor: %f/%f/%f\n", this->specularColor[0], this->specularColor[1], this->specularColor[2]);
+  PRINT(0)(" Attenuation: constant=%f linear=%f quadratic=%f\n", this->constantAttenuation, this->linearAttenuation, this->quadraticAttenuation);
+}
+
+
+/******************
+** LIGHT-MANAGER **
+******************/
+/**
+   \brief standard constructor for a Light
+*/
+LightManager::LightManager () 
+{
+  this->setClassName ("LightManager");
+
+  glEnable (GL_LIGHTING);
+  this->setAmbientColor(.3, .3, .3);
+  this->lights = new Light*[NUMBEROFLIGHTS];
+  for (int i = 0; i < NUMBEROFLIGHTS; i++)
+    lights[i] = NULL;
+  this->currentLight = NULL;
+}
+
+/**
+   \brief standard deconstructor
+   
+   first disables Lighting
+
+   then deletes the rest of the allocated memory
+   and in the end sets the singleton Reference to zero.
+*/
+LightManager::~LightManager () 
+{
+  glDisable(GL_LIGHTING);
+  
+  // this will be done either by worldEntity, or by pNode as each light is one of them
+  //  for (int i = 0; i < NUMBEROFLIGHTS; i++)
+  //    this->deleteLight(i);
+  delete lights;
+  LightManager::singletonRef = NULL;
+}
+
+/**
+   \brief singleton-Reference to the Light-class
+*/
+LightManager* LightManager::singletonRef = NULL;
+
+/**
+   \returns The Instance of the Lights
+*/
+LightManager* LightManager::getInstance(void)
+{
+  if (!singletonRef)
+    LightManager::singletonRef = new LightManager();
+  return singletonRef;
+}
+
+/**
+   \brief initializes a new Light with default values, and enables GL_LIGHTING
+*/
+void LightManager::initLight(int lightNumber)
+{
+  lights[lightNumber] = new Light(lightNumber);
+}
+
+/**
+   \brief Adds a new Light, by selecting the First free slot.
+
+   if no slot is free error
+*/
+int LightManager::addLight(void)
+{
+  for (int i = 0; i < NUMBEROFLIGHTS; i++)
+    if (!this->lights[i])
+      return addLight(i); 
+  PRINTF(1)("no more light slots availiable. All %d already taken\n", NUMBEROFLIGHTS);
+  return -1;
+}
+
+/**
+   \brief Adds a new Light
+   \param lightNumber The number of the light to add.
+
+   if the Number is not free: warn, automatically choose another slot.
+*/
+int LightManager::addLight(int lightNumber)
+{
+  if (this->lights[lightNumber])
+    {
+      PRINTF(2)("Lightslot %d is allready taken, trying another one\n", lightNumber);
+      return this->addLight();
+    }
+  this->initLight(lightNumber);
+  this->currentLight = this->lights[lightNumber];
+  return lightNumber;
+}
+
+/**
+   \brief select the light to work with
+   \param lightNumber the light to work with
+*/
+void LightManager::editLightNumber(int lightNumber)
+{
+  if (!this->currentLight)
+    { 
+      PRINTF(2)("no Light defined yet. Please define at least one light first befor editing.\n");
+      return;
+    }
+  this->currentLight = lights[lightNumber];
+}
+
+/**
+   \brief Delete the current Light
+*/
+void LightManager::deleteLight(void)
+{
+  if (!this->currentLight)
+    { 
+      PRINTF(1)("no Light defined yet. So you cannot delete any Light right now.\n");
+      return;
+    }
+
+  this->deleteLight(this->currentLight->getLightNumber());
+}
+
+/**
+   \brief delete light.
+   \param lightNumber the number of the light to delete
+*/
+void LightManager::deleteLight(int lightNumber)
+{
+  if (this->lights[lightNumber])
+    {
+      PRINTF(4)("deleting Light number %d\n", lightNumber);
+      delete this->lights[lightNumber];
+      this->lights[lightNumber] = NULL;
+    }
+}
+
+/**
+   \brief draws all the Lights in their appropriate position
+*/
+void LightManager::draw()
+{
+  glMatrixMode(GL_MODELVIEW);
+  glLoadIdentity();
+  PRINTF(4)("Drawing the Lights\n");
+  for (int i = 0; i < NUMBEROFLIGHTS; i++)
+    if (this->lights[i])
+      lights[i]->draw();
+}
+
+
+
+// set Attributes
+/**
+   \brief sets the ambient Color of the Scene
+   \param r red
+   \param g green
+   \param b blue
+*/
+void LightManager::setAmbientColor(GLfloat r, GLfloat g, GLfloat b)
+{
+  this->ambientColor[0] = r;
+  this->ambientColor[1] = g;
+  this->ambientColor[2] = b;
+  this->ambientColor[3] = 1.0;
+
+  glLightfv (GL_LIGHT0, GL_AMBIENT, this->ambientColor);
+}
+
+/**
+   \brief sets The Position of the currently selected Light
+   \param position the new Position
+*/
+void LightManager::setPosition(Vector position)
+{
+  this->currentLight->setPosition(position);
+}
+
+/**
+   \brief Sets a Position for the currently selected Light.
+   \param x the x-coordinate
+   \param y the y-coordinate
+   \param z the z-coordinate
+*/
+void LightManager::setPosition(GLfloat x, GLfloat y, GLfloat z)
+{
+  if (!this->currentLight)
+    { 
+      PRINTF(2)("no Light defined yet. Please define at least one light first befor editing.\n");
+      return;
+    }
+  this->currentLight->setPosition(x, y, z);
+}
+
+/**
+   \brief sets an emitting Diffuse color of the currently selected Light
+   \param r red
+   \param g green
+   \param b blue
+*/
+void LightManager::setDiffuseColor(GLfloat r, GLfloat g, GLfloat b)
+{
+  if (!this->currentLight)
+    { 
+      PRINTF(2)("no Light defined yet. Please define at least one light first befor editing.\n");
+      return;
+    }
+  this->currentLight->setDiffuseColor(r,g,b);
+}
+
+/**
+   \brief sets an emitting Specular color of the currently selected Light
+   \param r red
+   \param g green
+   \param b blue
+*/
+void LightManager::setSpecularColor(GLfloat r, GLfloat g, GLfloat b)
+{
+  if (!this->currentLight)
+    { 
+      PRINTF(2)("no Light defined yet. Please define at least one light first befor editing.\n");
+      return;
+    }
+  this->currentLight->setSpecularColor(r, g, b);
+}
+
+/**
+   \brief Sets the AttenuationType of th currently selecte LightSource Light Source
+   \param constantAttenuation The Constant Attenuation of the Light
+   \param linearAttenuation The Linear Attenuation of the Light
+   \param quadraticAttenuation The Quadratic Attenuation of the Light
+*/
+void LightManager::setAttenuation(float constantAttenuation, float linearAttenuation, float quadraticAttenuation)
+{
+  if (!this->currentLight)
+    { 
+      PRINTF(2)("no Light defined yet. Please define at least one light first befor editing.\n");
+      return;
+    }
+  this->currentLight->setAttenuation(constantAttenuation, linearAttenuation, quadraticAttenuation);
+}
+
+
+/**
+   \brief stets the direction of the Spot Light.
+   \param direction The direction of the Spot Light.
+*/
+void LightManager::setSpotDirection(Vector direction)
+{
+  if (!this->currentLight)
+    { 
+      PRINTF(2)("no Light defined yet. Please define at least one light first befor editing.\n");
+      return;
+    }
+  this->currentLight->setSpotDirection(direction);
+}
+
+/**
+   \brief sets the cutoff angle of the Light.
+   \param cutoff The cutoff angle.
+*/
+void LightManager::setSpotCutoff(GLfloat cutoff)
+{
+  if (!this->currentLight)
+    { 
+      PRINTF(2)("no Light defined yet. Please define at least one light first befor editing.\n");
+      return;
+    }
+  this->currentLight->setSpotCutoff(cutoff);
+}
+
+// get Attributes
+/**
+   \returns the Position of the Light
+*/
+Vector LightManager::getPosition(void) const
+{
+  if (!this->currentLight)
+    { 
+      PRINTF(2)("no Light defined yet\n");
+      return Vector(.0, .0, .0);
+    }
+  else
+    return this->currentLight->getPosition();
+}
+
+/**
+   \returns the Position of Light 
+   \param lightNumber lightnumber
+*/
+Vector LightManager::getPosition(int lightNumber) const
+{
+  if (!this->lights[lightNumber])
+    {
+      PRINTF(2)("no Light defined yet\n");
+      return Vector(.0,.0,.0);
+    }
+  else
+    return this->lights[lightNumber]->getPosition();
+}
+
+/**
+   \returns a pointer to a Light
+   \param lightNumber The light to request the pointer from
+*/
+Light* LightManager::getLight(int lightNumber) const
+{
+  return this->lights[lightNumber];
+}
+
+/**
+   \brief outputs debug information about the Class and its lights
+*/
+void LightManager::debug(void) const
+{
+  PRINT(0)("=================================\n");
+  PRINT(0)("= DEBUG INFORMATION CLASS LIGHT =\n");
+  PRINT(0)("=================================\n");
+  PRINT(0)("Reference: %p\n", LightManager::singletonRef);
+  if (this->currentLight)
+    PRINT(0)("current Light Nr: %d\n", this->currentLight->getLightNumber());
+  PRINT(0)("Ambient Color: %f:%f:%f\n", this->ambientColor[0], this->ambientColor[0], this->ambientColor[0]);
+  PRINT(0)("=== Lights ===\n");
+  for (int i = 0; i < NUMBEROFLIGHTS; i++)
+    if (this->lights[i])
+      {
+	this->lights[i]->debug();
+      }
+  PRINT(0)("--------------------------------\n");
+}
Index: orxonox/branches/levelloader/src/lib/graphics/light.h
===================================================================
--- orxonox/branches/levelloader/src/lib/graphics/light.h	(revision 3605)
+++ orxonox/branches/levelloader/src/lib/graphics/light.h	(revision 3605)
@@ -0,0 +1,143 @@
+/*! 
+    \file light.h
+    \brief Handles Lights.
+
+    A Light is one of the more important things in a 3D-environment,
+    without it one sees nothing :)
+    It is here for diffuse-, specular- and Bump-Mappings.
+*/
+
+#ifndef _LIGHT_H
+#define _LIGHT_H
+
+#include "world_entity.h"
+#include "glincl.h"
+
+//! The maximum number of Lights this OpenGL-implementation supports.
+#define NUMBEROFLIGHTS GL_MAX_LIGHTS
+
+// FORWARD DEFINITIONS //
+class Vector;
+
+//! A class that handles Lights. The LightManager operates on this.
+class Light : public WorldEntity
+{
+ public:
+  Light(int lightNumber);
+  virtual ~Light(void);
+
+  void setPosition(Vector position);
+  void setPosition(GLfloat x, GLfloat y, GLfloat z);
+  void setDiffuseColor(GLfloat r, GLfloat g, GLfloat b);
+  void setSpecularColor(GLfloat r, GLfloat g, GLfloat b);
+  void setAttenuation(float constantAttenuation, float linearAttenuation, float quadraticAttenuation);
+  void setSpotDirection(Vector direction);
+  void setSpotCutoff(GLfloat cutoff);
+
+  Vector getPosition() const;
+  /** \returns the lightNumber*/
+  int getLightNumber(void) const {return this->lightNumber;}
+  
+  virtual void draw();
+
+  void debug(void) const;
+
+  // attributes
+ private:
+  int lightNumber;            //!< The number of this Light.
+  GLfloat lightPosition[4];   //!< The Position of this Light.
+  GLfloat diffuseColor[4];    //!< The Diffuse Color this Light emmits.
+  GLfloat specularColor[4];   //!< The specular Color of this Light.
+  float constantAttenuation;  //!< The Factor of the the Constant Attenuation.
+  float linearAttenuation;    //!< The Factor of the the Linear Attenuation.
+  float quadraticAttenuation; //!< The Factor of the the Quadratic Attenuation.
+  GLfloat spotDirection[4];   //!< The direction of the Spot Light.
+  GLfloat spotCutoff;         //!< The cutoff Angle of the Light Source
+};
+
+//! A class that handles Lights
+/**
+   A Light is a source that emits light rays (photons)
+
+   <b>Usage:</b>\n
+   First you have to get the Light Manager up and running by using LightManager::getInstance.
+   This automatically initiates the GL_LIGHTING, and sets some default stuff about the light.\n
+   Then you will create a new light using:
+   \li int addLight(void);
+   \li int addLight(int lightNumber);
+
+   now you can operate on the light as follows:
+   \li void setPosition(Vector position);
+   \li void setPosition(GLfloat x, GLfloat y, GLfloat z);
+   \li void setDiffuseColor(GLfloat r, GLfloat g, GLfloat b);
+   \li void setSpecularColor(GLfloat r, GLfloat g, GLfloat b);
+   \li void setAttenuation(float constantAttenuation, float linearAttenuation, float quadraticAttenuation);
+   \li void setSpotDirection(Vector direction);
+   \li void setSpotCutoff(GLfloat cutoff);
+
+   These functions are preatty selv-explaining, but you can read about them below.\n
+   If you want to fetch info, or the a Light use:
+   \li Vector getPosition(void) const;
+   \li Vector getPosition(int lightNumber) const;
+   \li Light* getLight(int LightNumber) const;
+
+   To redraw the light use
+   \li void draw();
+   
+   and to delete one just use
+   \li void deleteLight(void);
+
+   for some nice output just use:
+   \li void debug(void) const;
+
+   You can also operate on the single Lights themselves, by first retreaving them with 
+   \li Light* getLight(int LightNumber);
+   \n
+   and then using the same functions on this to change settings.
+*/
+class LightManager : public BaseObject
+{
+ private:
+  LightManager(void);
+  void initLight(int LightNumber);
+  
+  static LightManager* singletonRef;    //!< This is the LightHandlers Reference.
+  GLfloat ambientColor[4];       //!< The ambient Color of the scene.
+
+  Light** lights;                //!< An array of Lenght NUMBEROFLIGHTS, that holds pointers to all LightValues.
+  Light* currentLight;           //!< The current Light, we are working with.
+  
+ public:
+  static LightManager* getInstance();
+  virtual ~LightManager(void);
+
+  // set Attributes
+  int addLight(void);
+  int addLight(int lightNumber);
+  void editLightNumber(int lightNumber);
+  void deleteLight(void);
+  void deleteLight(int lightNumber);
+
+  void setAmbientColor(GLfloat r, GLfloat g, GLfloat b);
+
+  void draw();
+
+  //set Attributes
+  void setPosition(Vector position);
+  void setPosition(GLfloat x, GLfloat y, GLfloat z);
+  void setDiffuseColor(GLfloat r, GLfloat g, GLfloat b);
+  void setSpecularColor(GLfloat r, GLfloat g, GLfloat b);
+  void setAttenuation(float constantAttenuation, float linearAttenuation, float quadraticAttenuation);
+  void setSpotDirection(Vector direction);
+  void setSpotCutoff(GLfloat cutoff);
+
+  // get Attributes
+  Vector getPosition(void) const;
+  Vector getPosition(int lightNumber) const;
+  
+  Light* getLight(int lightNumber) const;
+  
+  void debug(void) const;
+};
+
+#endif /* _LIGHT_H */
Index: orxonox/branches/levelloader/src/lib/gui/Makefile.in
===================================================================
--- orxonox/branches/levelloader/src/lib/gui/Makefile.in	(revision 3604)
+++ orxonox/branches/levelloader/src/lib/gui/Makefile.in	(revision 3605)
@@ -1,3 +1,3 @@
-# Makefile.in generated by automake 1.8.2 from Makefile.am.
+# Makefile.in generated by automake 1.8.5 from Makefile.am.
 # @configure_input@
 
@@ -78,4 +78,6 @@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DOCUMENTATION_FALSE = @DOCUMENTATION_FALSE@
+DOCUMENTATION_TRUE = @DOCUMENTATION_TRUE@
 DOXYGEN = @DOXYGEN@
 DOXYGEN_FALSE = @DOXYGEN_FALSE@
@@ -177,7 +179,7 @@
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/lib/gui/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/lib/gui/Makefile'; \
 	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu  src/lib/gui/Makefile
+	  $(AUTOMAKE) --foreign  src/lib/gui/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@@ -272,12 +274,14 @@
 	tags=; \
 	here=`pwd`; \
-	if (etags --etags-include --version) >/dev/null 2>&1; then \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
 	  include_option=--etags-include; \
+	  empty_fix=.; \
 	else \
 	  include_option=--include; \
+	  empty_fix=; \
 	fi; \
 	list='$(SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
-	    test -f $$subdir/TAGS && \
+	    test ! -f $$subdir/TAGS || \
 	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
 	  fi; \
@@ -289,7 +293,9 @@
 	  $(AWK) '    { files[$$0] = 1; } \
 	       END { for (i in files) print i; }'`; \
-	test -z "$(ETAGS_ARGS)$$tags$$unique" \
-	  || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	     $$tags $$unique
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
 ctags: CTAGS
 CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
Index: orxonox/branches/levelloader/src/lib/gui/console/Makefile.in
===================================================================
--- orxonox/branches/levelloader/src/lib/gui/console/Makefile.in	(revision 3604)
+++ orxonox/branches/levelloader/src/lib/gui/console/Makefile.in	(revision 3605)
@@ -1,3 +1,3 @@
-# Makefile.in generated by automake 1.8.2 from Makefile.am.
+# Makefile.in generated by automake 1.8.5 from Makefile.am.
 # @configure_input@
 
@@ -50,5 +50,5 @@
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
-am__installdirs = $(DESTDIR)$(bindir)
+am__installdirs = "$(DESTDIR)$(bindir)"
 binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 PROGRAMS = $(bin_PROGRAMS)
@@ -96,4 +96,6 @@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DOCUMENTATION_FALSE = @DOCUMENTATION_FALSE@
+DOCUMENTATION_TRUE = @DOCUMENTATION_TRUE@
 DOXYGEN = @DOXYGEN@
 DOXYGEN_FALSE = @DOXYGEN_FALSE@
@@ -203,7 +205,7 @@
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/lib/gui/console/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/lib/gui/console/Makefile'; \
 	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu  src/lib/gui/console/Makefile
+	  $(AUTOMAKE) --foreign  src/lib/gui/console/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@@ -225,5 +227,5 @@
 install-binPROGRAMS: $(bin_PROGRAMS)
 	@$(NORMAL_INSTALL)
-	$(mkdir_p) $(DESTDIR)$(bindir)
+	test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
 	@list='$(bin_PROGRAMS)'; for p in $$list; do \
 	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
@@ -231,6 +233,6 @@
 	  ; then \
 	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
-	   echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \
-	   $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
 	  else :; fi; \
 	done
@@ -240,6 +242,6 @@
 	@list='$(bin_PROGRAMS)'; for p in $$list; do \
 	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
-	  echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
-	  rm -f $(DESTDIR)$(bindir)/$$f; \
+	  echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(bindir)/$$f"; \
 	done
 
@@ -297,7 +299,9 @@
 	  $(AWK) '    { files[$$0] = 1; } \
 	       END { for (i in files) print i; }'`; \
-	test -z "$(ETAGS_ARGS)$$tags$$unique" \
-	  || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	     $$tags $$unique
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
 ctags: CTAGS
 CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
@@ -354,5 +358,7 @@
 all-am: Makefile $(PROGRAMS) $(HEADERS)
 installdirs:
-	$(mkdir_p) $(DESTDIR)$(bindir)
+	for dir in "$(DESTDIR)$(bindir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
 install: install-am
 install-exec: install-exec-am
Index: orxonox/branches/levelloader/src/lib/gui/gui/Makefile.in
===================================================================
--- orxonox/branches/levelloader/src/lib/gui/gui/Makefile.in	(revision 3604)
+++ orxonox/branches/levelloader/src/lib/gui/gui/Makefile.in	(revision 3605)
@@ -1,3 +1,3 @@
-# Makefile.in generated by automake 1.8.2 from Makefile.am.
+# Makefile.in generated by automake 1.8.5 from Makefile.am.
 # @configure_input@
 
@@ -50,5 +50,5 @@
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
-am__installdirs = $(DESTDIR)$(bindir)
+am__installdirs = "$(DESTDIR)$(bindir)"
 binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 PROGRAMS = $(bin_PROGRAMS)
@@ -105,4 +105,6 @@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
+DOCUMENTATION_FALSE = @DOCUMENTATION_FALSE@
+DOCUMENTATION_TRUE = @DOCUMENTATION_TRUE@
 DOXYGEN = @DOXYGEN@
 DOXYGEN_FALSE = @DOXYGEN_FALSE@
@@ -236,7 +238,7 @@
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/lib/gui/gui/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/lib/gui/gui/Makefile'; \
 	cd $(top_srcdir) && \
-	  $(AUTOMAKE) --gnu  src/lib/gui/gui/Makefile
+	  $(AUTOMAKE) --foreign  src/lib/gui/gui/Makefile
 .PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@@ -258,5 +260,5 @@
 install-binPROGRAMS: $(bin_PROGRAMS)
 	@$(NORMAL_INSTALL)
-	$(mkdir_p) $(DESTDIR)$(bindir)
+	test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
 	@list='$(bin_PROGRAMS)'; for p in $$list; do \
 	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
@@ -264,6 +266,6 @@
 	  ; then \
 	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
-	   echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \
-	   $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
 	  else :; fi; \
 	done
@@ -273,6 +275,6 @@
 	@list='$(bin_PROGRAMS)'; for p in $$list; do \
 	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
-	  echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
-	  rm -f $(DESTDIR)$(bindir)/$$f; \
+	  echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(bindir)/$$f"; \
 	done
 
@@ -336,7 +338,9 @@
 	  $(AWK) '    { files[$$0] = 1; } \
 	       END { for (i in files) print i; }'`; \
-	test -z "$(ETAGS_ARGS)$$tags$$unique" \
-	  || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
-	     $$tags $$unique
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
 ctags: CTAGS
 CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
@@ -393,5 +397,7 @@
 all-am: Makefile $(PROGRAMS) $(HEADERS)
 installdirs:
-	$(mkdir_p) $(DESTDIR)$(bindir)
+	for dir in "$(DESTDIR)$(bindir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
 install: install-am
 install-exec: install-exec-am
Index: orxonox/branches/levelloader/src/lib/gui/gui/orxonox_gui_gtk.h
===================================================================
--- orxonox/branches/levelloader/src/lib/gui/gui/orxonox_gui_gtk.h	(revision 3604)
+++ orxonox/branches/levelloader/src/lib/gui/gui/orxonox_gui_gtk.h	(revision 3605)
@@ -9,7 +9,4 @@
 #include <config.h> 
 #endif
-
-//! verbose level, soon obsolete
-extern int verbose; // soon obsolete here
 
 #include "debug.h"
Index: orxonox/branches/levelloader/src/lib/lang/base_object.cc
===================================================================
--- orxonox/branches/levelloader/src/lib/lang/base_object.cc	(revision 3604)
+++ orxonox/branches/levelloader/src/lib/lang/base_object.cc	(revision 3605)
@@ -26,5 +26,8 @@
    \brief standard constructor
 */
-BaseObject::BaseObject () {}
+BaseObject::BaseObject () 
+{
+  this->className = NULL;
+}
 
 
@@ -32,10 +35,13 @@
    \brief standard deconstructor
 */
-BaseObject::~BaseObject () {}
-
+BaseObject::~BaseObject () 
+{
+  delete []this->className;
+}
 
 void BaseObject::setClassName (char* className)
 {
-  this->className = className;
+  this->className = new char[strlen(className)+1];
+  strcpy(this->className, className);
 }
 
Index: orxonox/branches/levelloader/src/lib/lang/base_object.h
===================================================================
--- orxonox/branches/levelloader/src/lib/lang/base_object.h	(revision 3604)
+++ orxonox/branches/levelloader/src/lib/lang/base_object.h	(revision 3605)
@@ -15,5 +15,5 @@
  public:
   BaseObject ();
-  ~BaseObject ();
+  virtual ~BaseObject ();
 
   void setClassName (char* className);
Index: orxonox/branches/levelloader/src/lib/math/curve.cc
===================================================================
--- orxonox/branches/levelloader/src/lib/math/curve.cc	(revision 3604)
+++ orxonox/branches/levelloader/src/lib/math/curve.cc	(revision 3605)
@@ -19,13 +19,31 @@
      local-Time implementation
      NURBS
+     tList implementation
      
 */
 
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_MATH
+
 #include "curve.h"
-#include "matrix.h"
+
 #include "debug.h"
 
 #include <math.h>
 #include <stdio.h>
+
+
+/** 
+    \brief default constructor for a Curve
+*/
+Curve::Curve(void)
+{
+  nodeCount = 0;
+  firstNode = new PathNode;
+  currentNode = firstNode;
+
+  firstNode->position = Vector (.0, .0, .0);
+  firstNode->number = 0;
+  firstNode->next = 0; // not sure if this really points to NULL!!
+}
 
 /**
@@ -131,5 +149,4 @@
   this->derivation = 0;
   dirCurve = new BezierCurve(1);
-  this->init();
 }
 
@@ -141,5 +158,4 @@
   this->derivation = derivation;
   dirCurve=NULL;
-  this->init();
 }
 
@@ -161,20 +177,4 @@
   if (dirCurve)
     delete dirCurve;
-}
-
-/**
-   \brief Initializes a BezierCurve
-*/
-void BezierCurve::init(void)
-{
-  nodeCount = 0;
-  firstNode = new PathNode;
-  currentNode = firstNode;
-
-  firstNode->position = Vector (.0, .0, .0);
-  firstNode->number = 0;
-  firstNode->next = 0; // not sure if this really points to NULL!!
-
-  return;
 }
 
@@ -285,178 +285,2 @@
   return curvePoint;
 }
-
-
-
-///////////////////////////////////
-//// Uniform Point curve  /////////
-///////////////////////////////////
-/**
-   \brief Creates a new UPointCurve
-*/
-UPointCurve::UPointCurve (void)
-{
-  this->derivation = 0;
-  this->init();
-}
-
-/**
-   \brief Creates a new UPointCurve-Derivation-Curve of deriavation'th degree
-*/
-UPointCurve::UPointCurve (int derivation)
-{
-  this->derivation = derivation;
-  dirCurve=NULL;
-  this->init();
-}
-
-/**
-   \brief Deletes a UPointCurve.
-
-   It does this by freeing all the space taken over from the nodes
-*/
-UPointCurve::~UPointCurve(void)
-{
-  PathNode* tmpNode;
-  currentNode = firstNode;
-  while (tmpNode != 0)
-    {
-      tmpNode = currentNode;
-      currentNode = currentNode->next;
-      delete tmpNode;
-    }
-  if (dirCurve)
-    delete dirCurve;
-}
-
-/**
-   \brief Initializes a UPointCurve
-*/
-void UPointCurve::init(void)
-{
-  nodeCount = 0;
-  firstNode = new PathNode;
-  currentNode = firstNode;
-
-  firstNode->position = Vector (.0, .0, .0);
-  firstNode->number = 0;
-  firstNode->next = 0; // not sure if this really points to NULL!!
-
-  return;
-}
-
-/**
-   \brief Rebuilds a UPointCurve
-   
-   \todo very bad algorithm
-*/
-void UPointCurve::rebuild(void)
-{
-  // rebuilding the Curve itself
-  PathNode* tmpNode = this->firstNode;
-  int i=0;
-  Matrix xTmpMat = Matrix(this->nodeCount, this->nodeCount);
-  Matrix yTmpMat = Matrix(this->nodeCount, this->nodeCount);
-  Matrix zTmpMat = Matrix(this->nodeCount, this->nodeCount);
-  Matrix xValMat = Matrix(this->nodeCount, 3);
-  Matrix yValMat = Matrix(this->nodeCount, 3);
-  Matrix zValMat = Matrix(this->nodeCount, 3);
-  while(tmpNode)
-    {
-      Vector fac = Vector(1,1,1);
-      for (int j = 0; j < this->nodeCount; j++)
-	{
-	  xTmpMat(i,j) = fac.x; fac.x *= (float)i/(float)this->nodeCount;//tmpNode->position.x;
-	  yTmpMat(i,j) = fac.y; fac.y *= (float)i/(float)this->nodeCount;//tmpNode->position.y;
-	  zTmpMat(i,j) = fac.z; fac.z *= (float)i/(float)this->nodeCount;//tmpNode->position.z;
-	}
-      xValMat(i,0) = tmpNode->position.x;
-      yValMat(i,0) = tmpNode->position.y;
-      zValMat(i,0) = tmpNode->position.z;
-      ++i;
-      tmpNode = tmpNode->next;
-    }
-  tmpNode = this->firstNode;
-  xValMat = xTmpMat.Inv() *= xValMat;
-  yValMat = yTmpMat.Inv() *= yValMat;
-  zValMat = zTmpMat.Inv() *= zValMat;
-  i = 0;
-  while(tmpNode)
-    {
-      tmpNode->vFactor.x = xValMat(i,0);
-      tmpNode->vFactor.y = yValMat(i,0);
-      tmpNode->vFactor.z = zValMat(i,0);
-
-      i++;
-      tmpNode = tmpNode->next;
-    }
-}
-
-/**
-   \brief calculates the Position on the curve
-   \param t The position on the Curve (0<=t<=1)
-   \return the Position on the Path
-*/
-Vector UPointCurve::calcPos(float t) 
-{
-  PathNode* tmpNode = firstNode;
-  Vector ret = Vector(0.0,0.0,0.0);
-  float factor = 1.0;
-  while(tmpNode)
-    {
-      ret.x += tmpNode->vFactor.x * factor;
-      ret.y += tmpNode->vFactor.y * factor;
-      ret.z += tmpNode->vFactor.z * factor;
-      factor *= t;
-
-      tmpNode = tmpNode->next;
-    }
-  return ret;
-}
-
-/**
-   \brief Calulates the direction of the Curve at time t.
-   \param The time at which to evaluate the curve.
-   \returns The vvaluated Vector.
-*/
-Vector UPointCurve::calcDir (float t)
-{
-  PathNode* tmpNode = firstNode;
-  Vector ret = Vector(0.0,0.0,0.0);
-  float factor = 1.0/t;
-  int k=0;
-  while(tmpNode)
-    {
-      ret.x += tmpNode->vFactor.x * factor *k;
-      ret.y += tmpNode->vFactor.y * factor *k;
-      ret.z += tmpNode->vFactor.z * factor *k;
-      factor *= t;
-      k++;
-      tmpNode = tmpNode->next;
-    }
-  ret.normalize();
-  return ret;
-}
-
-Vector UPointCurve::calcAcc (float t)
-{
-}
-
-/**
-   \brief Calculates the Quaternion needed for our rotations
-   \param t The time at which to evaluate the cuve.
-   \returns The evaluated Quaternion.
-*/
-Quaternion UPointCurve::calcQuat (float t)
-{
-  return Quaternion (calcDir(t), Vector(0,0,1));
-}
-
-
-/**
-  \brief returns the Position of the point calculated on the Curve
-  \return a Vector to the calculated position
-*/
-Vector UPointCurve::getPos(void) const
-{
-  return curvePoint;
-}
Index: orxonox/branches/levelloader/src/lib/math/curve.h
===================================================================
--- orxonox/branches/levelloader/src/lib/math/curve.h	(revision 3604)
+++ orxonox/branches/levelloader/src/lib/math/curve.h	(revision 3605)
@@ -13,5 +13,5 @@
 
 //! An Enumerator that defines what sort of Curves are availible
-enum CurveType {BEZIERCURVE, UPOINTCURVE};
+enum CurveType {BEZIERCURVE};
 
 
@@ -38,7 +38,10 @@
   PathNode* currentNode; //!< The node we are working with (the Last node).
 
+
  private:
   virtual void rebuild(void) = 0;
  public:
+  Curve(void);
+
   Curve* dirCurve;       //!< The derivation-curve of this Curve.
   void addNode(const Vector& newNode);
@@ -68,6 +71,5 @@
   BezierCurve(void);
   BezierCurve(int derivation);
-  ~BezierCurve(void);
-  void init(void);
+  virtual ~BezierCurve(void);
 
   Vector calcPos(float t);
@@ -91,28 +93,3 @@
 };
 
-//! Uniform Point Curve-class
-/**
-   A UPoint Curve is a A Curve, that flows through all the nodes given it.
-   The Algorithm to buid the curve is rather slow, but Painting and tracing along the curve has high speed, so do not change this curve during the Game.
-
-   This Curve is very erattic, so i do not recommend to use it.
-*/
-class UPointCurve : public Curve
-{
- private:
-  void rebuild(void);
- public:
-  UPointCurve(void);
-  UPointCurve(int derivation);
-  ~UPointCurve(void);
-  void init(void);
-
-  Vector calcPos(float t);
-  Vector calcDir(float t);
-  Vector calcAcc(float t);
-  Quaternion calcQuat(float t);
-  
-  Vector getPos(void) const;
-};
-
 #endif /* _CURVE_H */
Index: orxonox/branches/levelloader/src/lib/math/matrix.cc
===================================================================
--- orxonox/branches/levelloader/src/lib/math/matrix.cc	(revision 3604)
+++ 	(revision )
@@ -1,746 +1,0 @@
-
-/* 
-   orxonox - the future of 3D-vertical-scrollers
-
-   Copyright (C) 2004 orx
-
-   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 2, or (at your option)
-   any later version.
-
-   ### File Specific:
-   main-programmer: Benjamin Grauer
-   co-programmer: ...
-
-   \todo Null-Parent => center of the coord system - singleton
-   \todo Smooth-Parent: delay, speed
-   \todo destroy the stuff again, delete...
-*/
-
-#include "matrix.h"
-
-Matrix::Matrix (size_t row, size_t col)
-{
-  _m = new base_mat( row, col, 0);
-}
-
-// copy constructor
-Matrix::Matrix (const Matrix& m)
-{
-    _m = m._m;
-    _m->Refcnt++;
-}
-
-// Internal copy constructor
-void Matrix::clone ()
-{
-    _m->Refcnt--;
-    _m = new base_mat( _m->Row, _m->Col, _m->Val);
-}
-
-// destructor
-Matrix::~Matrix ()
-{
-   if (--_m->Refcnt == 0) delete _m;
-}
-
-// assignment operator
-Matrix& Matrix::operator = (const Matrix& m) 
-{
-    m._m->Refcnt++;
-    if (--_m->Refcnt == 0) delete _m;
-    _m = m._m;
-    return *this;
-}
-
-//  reallocation method
-void Matrix::realloc (size_t row, size_t col)
-{
-   if (row == _m->RowSiz && col == _m->ColSiz)
-   {
-      _m->Row = _m->RowSiz;
-      _m->Col = _m->ColSiz;
-      return;
-   }
-
-   base_mat *m1 = new base_mat( row, col, NULL);
-   size_t colSize = min(_m->Col,col) * sizeof(float);
-   size_t minRow = min(_m->Row,row);
-
-   for (size_t i=0; i < minRow; i++)
-      memcpy( m1->Val[i], _m->Val[i], colSize);
-
-   if (--_m->Refcnt == 0) 
-       delete _m;
-   _m = m1;
-
-   return;
-}
-
-// public method for resizing Matrix
-void Matrix::SetSize (size_t row, size_t col) 
-{
-   size_t i,j;
-   size_t oldRow = _m->Row;
-   size_t oldCol = _m->Col;
-
-   if (row != _m->RowSiz || col != _m->ColSiz)
-      realloc( row, col);
-
-   for (i=oldRow; i < row; i++)
-      for (j=0; j < col; j++)
-	 _m->Val[i][j] = float(0);
-
-   for (i=0; i < row; i++)                      
-      for (j=oldCol; j < col; j++)
-	 _m->Val[i][j] = float(0);
-
-   return;
-}
-
-// subscript operator to get/set individual elements
-float& Matrix::operator () (size_t row, size_t col) 
-{
-   if (row >= _m->Row || col >= _m->Col)
-      printf( "Matrix::operator(): Index out of range!\n");
-   if (_m->Refcnt > 1) clone();
-   return _m->Val[row][col];
-}
-
-// subscript operator to get/set individual elements
-float Matrix::operator () (size_t row, size_t col) const 
-{
-   if (row >= _m->Row || col >= _m->Col)
-      printf( "Matrix::operator(): Index out of range!\n");
-   return _m->Val[row][col];
-}
-
-// input stream function
-istream& operator >> (istream& istrm, Matrix& m)
-{
-   for (size_t i=0; i < m.RowNo(); i++)
-      for (size_t j=0; j < m.ColNo(); j++)
-      {
-         float x;
-         istrm >> x;
-         m(i,j) = x;
-      }
-   return istrm;
-}
-
-// output stream function
-ostream& operator << (ostream& ostrm, const Matrix& m)
-{
-   for (size_t i=0; i < m.RowNo(); i++)
-   {
-      for (size_t j=0; j < m.ColNo(); j++)
-      {
-         float x = m(i,j);
-         ostrm << x << '\t';
-      }
-      ostrm << endl;
-   }
-   return ostrm;
-}
-
-
-// logical equal-to operator
-bool operator == (const Matrix& m1, const Matrix& m2) 
-{
-   if (m1.RowNo() != m2.RowNo() || m1.ColNo() != m2.ColNo())
-      return false;
-
-   for (size_t i=0; i < m1.RowNo(); i++)
-      for (size_t j=0; j < m1.ColNo(); j++)
-	      if (m1(i,j) != m2(i,j))
-	         return false;
-
-   return true;
-}
-
-// logical no-equal-to operator
-bool operator != (const Matrix& m1, const Matrix& m2) 
-{
-    return (m1 == m2) ? false : true;
-}
-
-// combined addition and assignment operator
-Matrix& Matrix::operator += (const Matrix& m) 
-{
-   if (_m->Row != m._m->Row || _m->Col != m._m->Col)
-     printf("Matrix::operator+= : Inconsistent Matrix sizes in addition!\n");
-   if (_m->Refcnt > 1) clone();
-   for (size_t i=0; i < m._m->Row; i++)
-      for (size_t j=0; j < m._m->Col; j++)
-	 _m->Val[i][j] += m._m->Val[i][j];
-   return *this;
-}
-
-// combined subtraction and assignment operator
-Matrix& Matrix::operator -= (const Matrix& m) 
-{
-   if (_m->Row != m._m->Row || _m->Col != m._m->Col)
-      printf( "Matrix::operator-= : Inconsistent Matrix sizes in subtraction!\n");
-   if (_m->Refcnt > 1) clone();
-   for (size_t i=0; i < m._m->Row; i++)
-      for (size_t j=0; j < m._m->Col; j++)
-	 _m->Val[i][j] -= m._m->Val[i][j];
-   return *this;
-}
-
-// combined scalar multiplication and assignment operator
- Matrix&
-Matrix::operator *= (const float& c) 
-{
-    if (_m->Refcnt > 1) clone();
-    for (size_t i=0; i < _m->Row; i++)
-	for (size_t j=0; j < _m->Col; j++)
-	    _m->Val[i][j] *= c;
-    return *this;
-}
-
-// combined Matrix multiplication and assignment operator
- Matrix&
-Matrix::operator *= (const Matrix& m) 
-{
-   if (_m->Col != m._m->Row)
-      printf( "Matrix::operator*= : Inconsistent Matrix sizes in multiplication!\n");
-
-   Matrix temp(_m->Row,m._m->Col);
-
-   for (size_t i=0; i < _m->Row; i++)
-      for (size_t j=0; j < m._m->Col; j++)
-      {
-         temp._m->Val[i][j] = float(0);
-         for (size_t k=0; k < _m->Col; k++)
-            temp._m->Val[i][j] += _m->Val[i][k] * m._m->Val[k][j];
-      }
-   *this = temp;
-
-   return *this;
-}
-
-// combined scalar division and assignment operator
- Matrix&
-Matrix::operator /= (const float& c) 
-{
-    if (_m->Refcnt > 1) clone();
-    for (size_t i=0; i < _m->Row; i++)
-	for (size_t j=0; j < _m->Col; j++)
-	    _m->Val[i][j] /= c;
-
-    return *this;
-}
-
-// combined power and assignment operator
- Matrix&
-Matrix::operator ^= (const size_t& pow) 
-{
-  Matrix temp(*this);
-
-  for (size_t i=2; i <= pow; i++)
-    *this *=  temp; // changed from *this = *this * temp;
-
-  return *this;
-}
-
-// unary negation operator
- Matrix
-Matrix::operator - () 
-{
-   Matrix temp(_m->Row,_m->Col);
-
-   for (size_t i=0; i < _m->Row; i++)
-      for (size_t j=0; j < _m->Col; j++)
-	 temp._m->Val[i][j] = - _m->Val[i][j];
-
-   return temp;
-}
-
-// binary addition operator
- Matrix
-operator + (const Matrix& m1, const Matrix& m2) 
-{
-   Matrix temp = m1;
-   temp += m2;
-   return temp;
-}
-
-// binary subtraction operator
- Matrix
-operator - (const Matrix& m1, const Matrix& m2) 
-{
-   Matrix temp = m1;
-   temp -= m2;
-   return temp;
-}
-
-// binary scalar multiplication operator
- Matrix
-operator * (const Matrix& m, const float& no) 
-{
-   Matrix temp = m;
-   temp *= no;
-   return temp;
-}
-
-
-// binary scalar multiplication operator
- Matrix
-operator * (const float& no, const Matrix& m) 
-{
-   return (m * no);
-}
-
-// binary Matrix multiplication operator
- Matrix
-operator * (const Matrix& m1, const Matrix& m2) 
-{
-   Matrix temp = m1;
-   temp *= m2;
-   return temp;
-}
-
-// binary scalar division operator
- Matrix
-operator / (const Matrix& m, const float& no) 
-{
-    return (m * (float(1) / no));
-}
-
-
-// binary scalar division operator
- Matrix
-operator / (const float& no, const Matrix& m) 
-{
-    return (!m * no);
-}
-
-// binary Matrix division operator
- Matrix
-operator / (const Matrix& m1, const Matrix& m2) 
-{
-    return (m1 * !m2);
-}
-
-// binary power operator
- Matrix
-operator ^ (const Matrix& m, const size_t& pow) 
-{
-   Matrix temp = m;
-   temp ^= pow;
-   return temp;
-}
-
-// unary transpose operator
- Matrix
-operator ~ (const Matrix& m) 
-{
-   Matrix temp(m.ColNo(),m.RowNo());
-
-   for (size_t i=0; i < m.RowNo(); i++)
-      for (size_t j=0; j < m.ColNo(); j++)
-      {
-         float x = m(i,j);
-	      temp(j,i) = x;
-      }
-   return temp;
-}
-
-// unary inversion operator
- Matrix
-operator ! (const Matrix m) 
-{
-   Matrix temp = m;
-   return temp.Inv();
-}
-
-// inversion function
- Matrix
-Matrix::Inv () 
-{
-   size_t i,j,k;
-   float a1,a2,*rowptr;
-
-   if (_m->Row != _m->Col)
-      printf( "Matrix::operator!: Inversion of a non-square Matrix\n");
-
-   Matrix temp(_m->Row,_m->Col);
-   if (_m->Refcnt > 1) clone();
-
-
-   temp.Unit();
-   for (k=0; k < _m->Row; k++)
-   {
-      int indx = pivot(k);
-      if (indx == -1)
-	      printf( "Matrix::operator!: Inversion of a singular Matrix\n");
-
-      if (indx != 0)
-      {
-	      rowptr = temp._m->Val[k];
-	      temp._m->Val[k] = temp._m->Val[indx];
-	      temp._m->Val[indx] = rowptr;
-      }
-      a1 = _m->Val[k][k];
-      for (j=0; j < _m->Row; j++)
-      {
-	      _m->Val[k][j] /= a1;
-	      temp._m->Val[k][j] /= a1;
-      }
-      for (i=0; i < _m->Row; i++)
-	   if (i != k)
-	   {
-	      a2 = _m->Val[i][k];
-	      for (j=0; j < _m->Row; j++)
-	      {
-	         _m->Val[i][j] -= a2 * _m->Val[k][j];
-	         temp._m->Val[i][j] -= a2 * temp._m->Val[k][j];
-	      }
-	   }
-   }
-   return temp;
-}
-
-// solve simultaneous equation
- Matrix
-Matrix::Solve (const Matrix& v) const 
-{
-   size_t i,j,k;
-   float a1;
-
-   if (!(_m->Row == _m->Col && _m->Col == v._m->Row))
-      printf( "Matrix::Solve():Inconsistent matrices!\n");
-
-   Matrix temp(_m->Row,_m->Col+v._m->Col);
-   for (i=0; i < _m->Row; i++)
-   {
-      for (j=0; j < _m->Col; j++)
-	 temp._m->Val[i][j] = _m->Val[i][j];
-      for (k=0; k < v._m->Col; k++)
-	 temp._m->Val[i][_m->Col+k] = v._m->Val[i][k];
-   }
-   for (k=0; k < _m->Row; k++)
-   {
-      int indx = temp.pivot(k);
-      if (indx == -1)
-	 printf( "Matrix::Solve(): Singular Matrix!\n");
-
-      a1 = temp._m->Val[k][k];
-      for (j=k; j < temp._m->Col; j++)
-	 temp._m->Val[k][j] /= a1;
-
-      for (i=k+1; i < _m->Row; i++)
-      {
-	 a1 = temp._m->Val[i][k];
-	 for (j=k; j < temp._m->Col; j++)
-	   temp._m->Val[i][j] -= a1 * temp._m->Val[k][j];
-      }
-   }
-   Matrix s(v._m->Row,v._m->Col);
-   for (k=0; k < v._m->Col; k++)
-      for (int m=int(_m->Row)-1; m >= 0; m--)
-      {
-	 s._m->Val[m][k] = temp._m->Val[m][_m->Col+k];
-	 for (j=m+1; j < _m->Col; j++)
-	    s._m->Val[m][k] -= temp._m->Val[m][j] * s._m->Val[j][k];
-      }
-   return s;
-}
-
-// set zero to all elements of this Matrix
- void
-Matrix::Null (const size_t& row, const size_t& col) 
-{
-    if (row != _m->Row || col != _m->Col)
-	realloc( row,col);
-
-    if (_m->Refcnt > 1) 
-	clone();
-
-    for (size_t i=0; i < _m->Row; i++)
-	for (size_t j=0; j < _m->Col; j++)
-	    _m->Val[i][j] = float(0);
-    return;
-}
-
-// set zero to all elements of this Matrix
- void
-Matrix::Null() 
-{
-    if (_m->Refcnt > 1) clone();   
-    for (size_t i=0; i < _m->Row; i++)
-	for (size_t j=0; j < _m->Col; j++)
-		_m->Val[i][j] = float(0);
-    return;
-}
-
-// set this Matrix to unity
- void
-Matrix::Unit (const size_t& row) 
-{
-    if (row != _m->Row || row != _m->Col)
-	realloc( row, row);
-	
-    if (_m->Refcnt > 1) 
-	clone();
-
-    for (size_t i=0; i < _m->Row; i++)
-	for (size_t j=0; j < _m->Col; j++)
-	    _m->Val[i][j] = i == j ? float(1) : float(0);
-    return;
-}
-
-// set this Matrix to unity
- void
-Matrix::Unit () 
-{
-    if (_m->Refcnt > 1) clone();   
-    size_t row = min(_m->Row,_m->Col);
-    _m->Row = _m->Col = row;
-
-    for (size_t i=0; i < _m->Row; i++)
-	for (size_t j=0; j < _m->Col; j++)
-	    _m->Val[i][j] = i == j ? float(1) : float(0);
-    return;
-}
-
-// private partial pivoting method
- int
-Matrix::pivot (size_t row)
-{
-  int k = int(row);
-  double amax,temp;
-
-  amax = -1;
-  for (size_t i=row; i < _m->Row; i++)
-    if ( (temp = abs( _m->Val[i][row])) > amax && temp != 0.0)
-     {
-       amax = temp;
-       k = i;
-     }
-  if (_m->Val[k][row] == float(0))
-     return -1;
-  if (k != int(row))
-  {
-     float* rowptr = _m->Val[k];
-     _m->Val[k] = _m->Val[row];
-     _m->Val[row] = rowptr;
-     return k;
-  }
-  return 0;
-}
-
-// calculate the determinant of a Matrix
- float
-Matrix::Det () const 
-{
-   size_t i,j,k;
-   float piv,detVal = float(1);
-
-   if (_m->Row != _m->Col)
-      printf( "Matrix::Det(): Determinant a non-squareMatrix!\n");
-   
-   Matrix temp(*this);
-   if (temp._m->Refcnt > 1) temp.clone();
-
-   for (k=0; k < _m->Row; k++)
-   {
-      int indx = temp.pivot(k);
-      if (indx == -1)
-	 return 0;
-      if (indx != 0)
-	 detVal = - detVal;
-      detVal = detVal * temp._m->Val[k][k];
-      for (i=k+1; i < _m->Row; i++)
-      {
-	 piv = temp._m->Val[i][k] / temp._m->Val[k][k];
-	 for (j=k+1; j < _m->Row; j++)
-	    temp._m->Val[i][j] -= piv * temp._m->Val[k][j];
-      }
-   }
-   return detVal;
-}
-
-// calculate the norm of a Matrix
- float
-Matrix::Norm () 
-{
-   float retVal = float(0);
-
-   for (size_t i=0; i < _m->Row; i++)
-      for (size_t j=0; j < _m->Col; j++)
-	 retVal += _m->Val[i][j] * _m->Val[i][j];
-   retVal = sqrt( retVal);
-
-   return retVal;
-}
-
-// calculate the condition number of a Matrix
- float
-Matrix::Cond () 
-{
-   Matrix inv = ! (*this);
-   return (Norm() * inv.Norm());
-}
-
-// calculate the cofactor of a Matrix for a given element
- float
-Matrix::Cofact (size_t row, size_t col) 
-{
-   size_t i,i1,j,j1;
-
-   if (_m->Row != _m->Col)
-      printf( "Matrix::Cofact(): Cofactor of a non-square Matrix!\n");
-
-   if (row > _m->Row || col > _m->Col)
-      printf( "Matrix::Cofact(): Index out of range!\n");
-
-   Matrix temp (_m->Row-1,_m->Col-1);
-
-   for (i=i1=0; i < _m->Row; i++)
-   {
-      if (i == row)
-	continue;
-      for (j=j1=0; j < _m->Col; j++)
-      {
-	 if (j == col)
-	    continue;
-	 temp._m->Val[i1][j1] = _m->Val[i][j];
-	 j1++;
-      }
-      i1++;
-   }
-   float  cof = temp.Det();
-   if ((row+col)%2 == 1)
-      cof = -cof;
-
-   return cof;
-}
-
-
-// calculate adjoin of a Matrix
- Matrix
-Matrix::Adj () 
-{
-   if (_m->Row != _m->Col)
-      printf( "Matrix::Adj(): Adjoin of a non-square Matrix.\n");
-
-   Matrix temp(_m->Row,_m->Col);
-
-   for (size_t i=0; i < _m->Row; i++)
-      for (size_t j=0; j < _m->Col; j++)
-	  temp._m->Val[j][i] = Cofact(i,j);
-   return temp;
-}
-
-// Determine if the Matrix is singular
- bool
-Matrix::IsSingular () 
-{
-   if (_m->Row != _m->Col)
-      return false;
-   return (Det() == float(0));
-}
-
-// Determine if the Matrix is diagonal
- bool
-Matrix::IsDiagonal () 
-{
-   if (_m->Row != _m->Col)
-      return false;
-   for (size_t i=0; i < _m->Row; i++)
-     for (size_t j=0; j < _m->Col; j++)
-	if (i != j && _m->Val[i][j] != float(0))
-	  return false;
-   return true;
-}
-
-// Determine if the Matrix is scalar
- bool
-Matrix::IsScalar () 
-{
-   if (!IsDiagonal())
-     return false;
-   float v = _m->Val[0][0];
-   for (size_t i=1; i < _m->Row; i++)
-     if (_m->Val[i][i] != v)
-	return false;
-   return true;
-}
-
-// Determine if the Matrix is a unit Matrix
- bool
-Matrix::IsUnit () 
-{
-   if (IsScalar() && _m->Val[0][0] == float(1))
-     return true;
-   return false;
-}
-
-// Determine if this is a null Matrix
- bool
-Matrix::IsNull () 
-{
-   for (size_t i=0; i < _m->Row; i++)
-      for (size_t j=0; j < _m->Col; j++)
-	 if (_m->Val[i][j] != float(0))
-	    return false;
-   return true;
-}
-
-// Determine if the Matrix is symmetric
- bool
-Matrix::IsSymmetric () 
-{
-   if (_m->Row != _m->Col)
-      return false;
-   for (size_t i=0; i < _m->Row; i++)
-      for (size_t j=0; j < _m->Col; j++)
-	 if (_m->Val[i][j] != _m->Val[j][i])
-	    return false;
-   return true;
-}
-	   
-// Determine if the Matrix is skew-symmetric
- bool
-Matrix::IsSkewSymmetric () 
-{
-   if (_m->Row != _m->Col)
-      return false;
-   for (size_t i=0; i < _m->Row; i++)
-      for (size_t j=0; j < _m->Col; j++)
-	 if (_m->Val[i][j] != -_m->Val[j][i])
-	    return false;
-   return true;
-}
-   
-// Determine if the Matrix is upper triangular
- bool
-Matrix::IsUpperTriangular () 
-{
-   if (_m->Row != _m->Col)
-      return false;
-   for (size_t i=1; i < _m->Row; i++)
-      for (size_t j=0; j < i-1; j++)
-	 if (_m->Val[i][j] != float(0))
-	    return false;
-   return true;
-}
-
-// Determine if the Matrix is lower triangular
- bool
-Matrix::IsLowerTriangular () 
-{
-   if (_m->Row != _m->Col)
-      return false;
-
-   for (size_t j=1; j < _m->Col; j++)
-      for (size_t i=0; i < j-1; i++)
-	 if (_m->Val[i][j] != float(0))
-	    return false;
-
-   return true;
-}
-
Index: orxonox/branches/levelloader/src/lib/math/matrix.h
===================================================================
--- orxonox/branches/levelloader/src/lib/math/matrix.h	(revision 3604)
+++ 	(revision )
@@ -1,110 +1,0 @@
-#ifndef _MATRIX_H
-#define _MATRIX_H
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <iostream>
-
-using namespace std;
-
-class Matrix
-{
-public:
-  // Constructors
-  Matrix (const Matrix& m);
-  Matrix (size_t row, size_t col);
-  
-  // Destructor
-  ~Matrix ();
-  
-  // Assignment operators
-  Matrix& operator = (const Matrix& m) ;
-  
-  // Value extraction method
-  size_t RowNo () const { return _m->Row; }
-  size_t ColNo () const { return _m->Col; }
-  
-  // Subscript operator
-  float& operator () (size_t row, size_t col);
-   float  operator () (size_t row, size_t col) const;
-
-   // Unary operators
-   Matrix operator + ()  { return *this; }
-   Matrix operator - () ;
-
-   // Combined assignment - calculation operators
-   Matrix& operator += (const Matrix& m);
-   Matrix& operator -= (const Matrix& m);
-   Matrix& operator *= (const Matrix& m);
-   Matrix& operator *= (const float& c) ;
-   Matrix& operator /= (const float& c) ;
-   Matrix& operator ^= (const size_t& pow);
-
-   // Miscellaneous -methods
-   void Null (const size_t& row, const size_t& col) ;
-   void Null () ;
-   void Unit (const size_t& row) ;
-   void Unit () ;
-   void SetSize (size_t row, size_t col) ;
-
-   // Utility methods
-   Matrix Solve (const Matrix& v) const;
-   Matrix Adj ();
-   Matrix Inv ();
-   float Det () const;
-   float Norm () ;
-   float Cofact (size_t row, size_t col);
-   float Cond () ;
-
-   // Type of matrices
-   bool IsSquare ()  { return (_m->Row == _m->Col); } 
-   bool IsSingular ();
-   bool IsDiagonal ();
-   bool IsScalar ();
-   bool IsUnit ();
-   bool IsNull ();
-   bool IsSymmetric ();
-   bool IsSkewSymmetric ();
-   bool IsUpperTriangular ();
-   bool IsLowerTriangular ();
-
-private:
-   struct base_mat
-    {
-	float **Val;
-	size_t Row, Col, RowSiz, ColSiz;
-	int Refcnt;
-
-	base_mat (size_t row, size_t col, float** v)
-	{
-	    Row = row; RowSiz = row;
-	    Col = col; ColSiz = col;
-	    Refcnt = 1;
-
-	    Val = new float* [row];
-	    size_t rowlen = col * sizeof(float);
-
-	    for (size_t i=0; i < row; i++)
-	    {
-		Val[i] = new float [col];
-		if (v) memcpy( Val[i], v[i], rowlen);
-	    }
-	}
-	~base_mat ()
-	{
-	    for (size_t i=0; i < RowSiz; i++)
-		delete [] Val[i];
-	    delete [] Val;
-	}
-    };
-    base_mat *_m;
-
-    void clone ();
-    void realloc (size_t row, size_t col);
-    int pivot (size_t row);
-};
-
-Matrix operator ! (const Matrix m);
-
-#endif /*_MATRIX_H */
Index: orxonox/branches/levelloader/src/lib/math/vector.cc
===================================================================
--- orxonox/branches/levelloader/src/lib/math/vector.cc	(revision 3604)
+++ orxonox/branches/levelloader/src/lib/math/vector.cc	(revision 3605)
@@ -19,7 +19,8 @@
 */
 
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_MATH
 
 #include "vector.h"
-
+#include "debug.h"
 
 using namespace std;
@@ -201,5 +202,4 @@
 }
 
-
 /**
    \brief calculate the angle between two vectors in radiances
@@ -225,4 +225,16 @@
   f = acos( v1 * v2 / (v1.len() * v2.len()));
   return f * 180 / PI;
+}
+
+
+/**
+   \brief Outputs the values of the Vector
+*/
+void Vector::debug(void)
+{
+  PRINT(0)("Vector Debug information\n");
+  PRINT(0)("x: %f; y: %f; z: %f", x, y, z);
+  PRINT(3)(" lenght: %f", len());
+  PRINT(0)("\n");
 }
 
@@ -581,4 +593,13 @@
 
 /**
+   \brief outputs some nice formated debug information about this quaternion
+*/
+void Quaternion::debug(void)
+{
+  PRINT(0)("Quaternion Debug Information\n");
+  PRINT(0)("real a=%f; imag: x=%f y=%f z=%f\n", w, v.x, v.y, v.z);
+}
+
+/**
    \brief create a rotation from a vector
    \param v: a vector
Index: orxonox/branches/levelloader/src/lib/math/vector.h
===================================================================
--- orxonox/branches/levelloader/src/lib/math/vector.h	(revision 3604)
+++ orxonox/branches/levelloader/src/lib/math/vector.h	(revision 3605)
@@ -41,4 +41,6 @@
   Vector* getNormalized();
   Vector abs();
+
+  void debug();
 };
 
@@ -53,27 +55,28 @@
 {
  public:
-	Vector v;	//!< Imaginary Vector
-	float w;        //!< Real part of the number
-
- 	Quaternion ();
- 	Quaternion (float m[4][4]);
- 	Quaternion (float angle, const Vector& axis);
- 	Quaternion (const Vector& dir, const Vector& up);
- 	Quaternion (float roll, float pitch, float yaw);
- 	
- 	Quaternion operator/ (const float& f) const;
- 	Quaternion operator* (const float& f) const;
- 	Quaternion operator* (const Quaternion& q) const;
-	Quaternion operator+ (const Quaternion& q) const;
-	Quaternion operator- (const Quaternion& q) const;
-	Quaternion conjugate () const;
-	Quaternion inverse () const;
- 	Vector apply (Vector& f) const;
-	float norm () const;
-	void matrix (float m[4][4]) const;
-	void quatSlerp(const Quaternion* from, const Quaternion* to, const float t, Quaternion* res);
-
+  Vector v;	//!< Imaginary Vector
+  float w;        //!< Real part of the number
+  
+  Quaternion ();
+  Quaternion (float m[4][4]);
+  Quaternion (float angle, const Vector& axis);
+  Quaternion (const Vector& dir, const Vector& up);
+  Quaternion (float roll, float pitch, float yaw);
+  
+  Quaternion operator/ (const float& f) const;
+  Quaternion operator* (const float& f) const;
+  Quaternion operator* (const Quaternion& q) const;
+  Quaternion operator+ (const Quaternion& q) const;
+  Quaternion operator- (const Quaternion& q) const;
+  Quaternion conjugate () const;
+  Quaternion inverse () const;
+  Vector apply (Vector& f) const;
+  float norm () const;
+  void matrix (float m[4][4]) const;
+  void quatSlerp(const Quaternion* from, const Quaternion* to, const float t, Quaternion* res);
+  
+  void debug();
  private:
-	float DELTA;      //!< resolution of calculation
+  float DELTA;      //!< resolution of calculation
 
 };
Index: orxonox/branches/levelloader/src/lib/util/list.h
===================================================================
--- orxonox/branches/levelloader/src/lib/util/list.h	(revision 3604)
+++ orxonox/branches/levelloader/src/lib/util/list.h	(revision 3605)
@@ -86,4 +86,5 @@
   T* enumerate();
   T* nextElement();
+  T* nextElement(T* toEntity);
   T* toArray();
   void debug();
@@ -101,9 +102,23 @@
 template<class T>
 tList<T>::~tList () 
-{}
+{
+  this->currentEl = this->first;
+  while(this->currentEl != NULL)
+    {
+      listElement* le = this->currentEl->next;
+      //delete this->currentEl->curr;
+      delete this->currentEl;
+      this->currentEl = le;
+    }
+  this->first = NULL;
+  this->last = NULL;
+  this->size = 0;
+}
+
 
 template<class T>
 void tList<T>::add(T* entity)
 {
+  if( entity == NULL) return;
   listElement* el = new listElement;
   el->prev = this->last;
@@ -113,5 +128,5 @@
   this->last = el;
 
-  if(this->size == 0) this->first = el;
+  if(el->prev == NULL) this->first = el; /* if first element */
   else el->prev->next = el;
   this->size++;
@@ -122,4 +137,5 @@
 void tList<T>::remove(T* entity)
 {
+  if( entity == NULL) return;
   this->currentEl = this->first;
   listElement* te;
@@ -134,7 +150,8 @@
 	  else this->currentEl->next->prev = this->currentEl->prev;
 
-	  te = this->currentEl->next;
+	  te = this->currentEl->next;  // for what am i doing this?
 	  delete this->currentEl;
 	  this->currentEl = te;
+	  this->size--;
 	  return;
 	}
@@ -151,5 +168,5 @@
     {
       listElement* le = this->currentEl->next;
-      delete this->currentEl->curr;
+      //delete this->currentEl->curr;
       delete this->currentEl;
       this->currentEl = le;
@@ -185,4 +202,5 @@
 T* tList<T>::enumerate()
 {
+  //if( this->last == this->first == NULL) return NULL;
   if(this->size == 0) return NULL;
   this->currentEl = this->first;
@@ -194,4 +212,5 @@
 T* tList<T>::nextElement()
 {
+  // if( this->last == this->first == NULL) return NULL;
   if(this->size == 0) return NULL;
   this->currentEl = this->currentEl->next;
@@ -201,4 +220,24 @@
 
 
+/**
+   \brief this returns the next element after toEntity or the first if toEntity is last
+*/
+template<class T>
+T* tList<T>::nextElement(T* toEntity)
+{
+  //if( this->last == this->first == NULL) return NULL;
+  if(this->size == 0) return NULL;
+  if( toEntity == NULL) return this->first->curr;
+  if( toEntity == this->last->curr ) return this->first->curr;
+  this->currentEl = this->first;
+  while(this->currentEl->curr != toEntity && this->currentEl->next != NULL)
+    {
+      this->currentEl = this->currentEl->next;
+    }
+  if(this->currentEl == NULL) return NULL;
+  return this->currentEl->next->curr;
+}
+
+
 template<class T>
 T* tList<T>::toArray()
Index: orxonox/branches/levelloader/src/light.cc
===================================================================
--- orxonox/branches/levelloader/src/light.cc	(revision 3604)
+++ 	(revision )
@@ -1,395 +1,0 @@
-
-
-/* 
-   orxonox - the future of 3D-vertical-scrollers
-
-   Copyright (C) 2004 orx
-
-   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 2, or (at your option)
-   any later version.
-
-   ### File Specific:
-   main-programmer: Benjamin Grauer
-   co-programmer: ...
-*/
-
-
-#include "light.h"
-
-#include "glincl.h"
-
-using namespace std;
-
-//! Definition of the Lights
-int lightsV[] = {GL_LIGHT0, GL_LIGHT1, GL_LIGHT2, GL_LIGHT3, GL_LIGHT4, GL_LIGHT5, GL_LIGHT6, GL_LIGHT7};
-
-
-/**
-   \brief standard constructor for a Light
-*/
-Light::Light () 
-{
-  this->setClassName ("Light");
-
-  glEnable (GL_LIGHTING);
-  this->setAmbientColor(.3, .3, .3);
-  this->lights = new LightValue*[NUMBEROFLIGHTS];
-  for (int i = 0; i < NUMBEROFLIGHTS; i++)
-    lights[i] = NULL;
-  this->currentLight = NULL;
-}
-
-/**
-   \brief standard deconstructor
-   
-   first disables Lighting
-   then deletes all the lights
-   then deletes the rest of the allocated memory
-   and in the end sets the singleton Reference to zero.
-*/
-Light::~Light () 
-{
-  glDisable(GL_LIGHTING);
-  
-  for (int i = 0; i < NUMBEROFLIGHTS; i++)
-    this->deleteLight(i);
-  delete lights;
-  Light::singletonRef = NULL;
-}
-
-/**
-   \brief singleton-Reference to the Light-class
-*/
-Light* Light::singletonRef = NULL;
-
-/**
-   \returns The Instance of the Lights
-*/
-Light* Light::getInstance(void)
-{
-  if (singletonRef)
-    return singletonRef;
-  else
-    return Light::singletonRef = new Light();
-}
-
-/**
-   \brief initializes a new Light with default values, and enables GL_LIGHTING
-*/
-void Light::init(int lightNumber)
-{
-  PRINTF(3)("initializing Light number %d.\n", lightNumber);
-  // enable The light
-  glEnable(lightsV[lightNumber]);
-  this->currentLight = lights[lightNumber] = new LightValue;
-  
-  // set default values
-  this->currentLight->lightNumber = lightNumber;
-  this->setPosition(0.0, 0.0, 0.0);
-  this->setDiffuseColor(1.0, 1.0, 1.0);
-  this->setSpecularColor(1.0, 1.0, 1.0);
-}
-
-/**
-   \brief Adds a new Light, by selecting the First free slot.
-
-   if no slot is free error
-*/
-int Light::addLight(void)
-{
-  for (int i = 0; i < NUMBEROFLIGHTS; i++)
-    if (!this->lights[i])
-      return addLight(i); 
-  PRINTF(1)("no more light slots availiable. All %d already taken\n", NUMBEROFLIGHTS);
-  return -1;
-}
-
-/**
-   \brief Adds a new Light
-   \param lightNumber The number of the light to add.
-
-   if the Number is not free: warn, automatically choose another slot.
-*/
-int Light::addLight(int lightNumber)
-{
-  if (this->lights[lightNumber])
-    {
-      PRINTF(2)("Lightslot %d is allready taken, trying another one\n", lightNumber);
-      return this->addLight();
-    }
-  this->init(lightNumber);
-  this->currentLight = this->lights[lightNumber];
-  return lightNumber;
-}
-
-/**
-   \brief select the light to work with
-   \param lightNumber the light to work with
-*/
-void Light::editLightNumber(int lightNumber)
-{
-  if (!this->currentLight)
-    { 
-      PRINTF(1)("no Light defined yet\n");
-      return;
-    }
-
-  this->currentLight = lights[lightNumber];
-}
-
-/**
-   \brief Delete the current Light
-*/
-void Light::deleteLight(void)
-{
-  if (!this->currentLight)
-    { 
-      PRINTF(1)("no Light defined yet\n");
-      return;
-    }
-
-  this->deleteLight(this->currentLight->lightNumber);
-}
-
-/**
-   \brief delete light.
-   \param lightNumber the number of the light to delete
-*/
-void Light::deleteLight(int lightNumber)
-{
-  if (this->lights[lightNumber])
-    {
-      PRINTF(3)("deleting Light number %d\n", lightNumber);
-      delete this->lights[lightNumber];
-      glDisable(lightsV[lightNumber]);
-      this->lights[lightNumber] = NULL;
-    }
-}
-
-// set Attributes
-/**
-   \brief Sets a Position for the Light.
-   \param position The new position of the Light.
-   \todo patrick: is it ok to set a Light Position even if it is derived from p_node??
-*/
-void Light::setPosition(Vector position)
-{
-  if (!this->currentLight)
-    { 
-      PRINTF(1)("no Light defined yet\n");
-      return;
-    }
-  this->currentLight->lightPosition[0] = position.x;
-  this->currentLight->lightPosition[1] = position.y;
-  this->currentLight->lightPosition[2] = position.z;
-  this->currentLight->lightPosition[3] = 0.0;
-
-  glLightfv (GL_LIGHT0, GL_POSITION, this->currentLight->lightPosition);
-}
-
-/**
-   \brief Sets a Position for the Light.
-   \param x the x-coordinate
-   \param y the y-coordinate
-   \param z the z-coordinate
-*/
-void Light::setPosition(GLfloat x, GLfloat y, GLfloat z)
-{
-  if (!this->currentLight)
-    { 
-      PRINTF(1)("no Light defined yet\n");
-      return;
-    }
-
-  this->currentLight->lightPosition[0] = x;
-  this->currentLight->lightPosition[1] = y;
-  this->currentLight->lightPosition[2] = z;
-  this->currentLight->lightPosition[3] = 0.0;
-
-  glLightfv (GL_LIGHT0, GL_POSITION, this->currentLight->lightPosition);
-}
-
-/**
-   \brief sets an emitting Diffuse color for the Light
-   \param r red
-   \param g green
-   \param b blue
-*/
-void Light::setDiffuseColor(GLfloat r, GLfloat g, GLfloat b)
-{
-  if (!this->currentLight)
-    { 
-      PRINTF(1)("no Light defined yet\n");
-      return;
-    }
-
-  this->currentLight->diffuseColor[0] = r;
-  this->currentLight->diffuseColor[1] = g;
-  this->currentLight->diffuseColor[2] = b;
-  this->currentLight->diffuseColor[3] = 1.0;
-
-  glLightfv (GL_LIGHT0, GL_DIFFUSE, this->currentLight->diffuseColor);
-}
-
-
-/**
-   \brief sets an emitting Ambient color for the Light
-   \param r red
-   \param g green
-   \param b blue
-*/
-void Light::setSpecularColor(GLfloat r, GLfloat g, GLfloat b)
-{
-  if (!this->currentLight)
-    { 
-      PRINTF(1)("no Light defined yet\n");
-      return;
-    }
-
-  this->currentLight->specularColor[0] = r;
-  this->currentLight->specularColor[1] = g;
-  this->currentLight->specularColor[2] = b;
-  this->currentLight->specularColor[3] = 1.0;
-
-  glLightfv (GL_LIGHT0, GL_SPECULAR, this->currentLight->specularColor);
-}
-
-/**
-   \brief Sets the AttenuationType of this Light Source
-   \param type the AttenuationType to set
-   \param factor the Factor to multipy the attenuation with
-
-   this actually just sets the following: glLightf(currentLight, type, factor)
-*/
-void Light::setAttenuation(AttenuationType type, float factor)
-{
-  if (!this->currentLight)
-    { 
-      PRINTF(1)("no Light defined yet\n");
-      return;
-    }
-  this->currentLight->attenuationFactor = factor;
-  this->currentLight->attenuationType = type;
-  switch (type)
-    {
-    case CONSTANT:
-      glLightf(lightsV[this->currentLight->lightNumber], GL_CONSTANT_ATTENUATION, factor);
-      break;
-    case LINEAR:
-      glLightf(lightsV[this->currentLight->lightNumber], GL_LINEAR_ATTENUATION, factor);
-      break;
-    case QUADRATIC:
-      glLightf(lightsV[this->currentLight->lightNumber], GL_QUADRATIC_ATTENUATION, factor);
-      break;
-    }
-}
-
-
-/**
-   \brief sets the ambient Color of the Scene
-   \param r red
-   \param g green
-   \param b blue
-*/
-void Light::setAmbientColor(GLfloat r, GLfloat g, GLfloat b)
-{
-  this->ambientColor[0] = r;
-  this->ambientColor[1] = g;
-  this->ambientColor[2] = b;
-  this->ambientColor[3] = 1.0;
-
-  glLightfv (GL_LIGHT0, GL_AMBIENT, this->ambientColor);
-}
-
-/**
-   \brief stets the direction of the Spot Light.
-   \param direction The direction of the Spot Light.
-*/
-void Light::setSpotDirection(Vector direction)
-{
-  this->currentLight->spotDirection[0] = direction.x;
-  this->currentLight->spotDirection[1] = direction.y;
-  this->currentLight->spotDirection[2] = direction.z;
-
-  glLightfv(lightsV[this->currentLight->lightNumber], GL_SPOT_DIRECTION, this->currentLight->spotDirection);
-}
-
-
-/**
-   \brief sets the cutoff angle of the Light.
-   \param cutoff The cutoff angle.
-*/
-void Light::setSpotCutoff(GLfloat cutoff)
-{
-  this->currentLight->spotCutoff = cutoff;
-  glLightf(lightsV[this->currentLight->lightNumber], GL_SPOT_CUTOFF, cutoff);
-}
-
-
-// get Attributes
-
-/**
-   \returns the Position of the Light
-*/
-Vector Light::getPosition(void)
-{
-  if (!this->currentLight)
-    { 
-      PRINTF(1)("no Light defined yet\n");
-      return Vector(.0, .0, .0);
-    }
-  else
-    return getPosition(currentLight->lightNumber);
-}
-
-
-
-
-/**
-   \brief outputs debug information about the Class and its lights
-*/
-void Light::debug(void)
-{
-  PRINT(0)("=================================\n");
-  PRINT(0)("= DEBUG INFORMATION CLASS LIGHT =\n");
-  PRINT(0)("=================================\n");
-  PRINT(0)("Reference: %p\n", Light::singletonRef);
-  if (this->currentLight)
-    PRINT(0)("current Light Nr: %d\n", this->currentLight->lightNumber);
-  PRINT(0)("Ambient Color: %f:%f:%f\n", this->ambientColor[0], this->ambientColor[0], this->ambientColor[0]);
-  PRINT(0)("=== Lights ===\n");
-  for (int i = 0; i < NUMBEROFLIGHTS; i++)
-    if (this->lights[i])
-      {
-	PRINT(0)(":: %d ::  -- reference %p\n", i, lights[i]);
-	PRINT(0)(" GL-state: ");
-	GLboolean param; 
-	glGetBooleanv(lightsV[i], &param);
-	if (param)
-	  PRINT(0)("ON\n");
-	else
-	  PRINT(0)("OFF\n");
-
-	if (i != lights[i]->lightNumber)
-	  PRINTF(1)(" Lights are out of sync, this really should not happen,\n   %d % should be equal.\n", i, lights[i]->lightNumber);
-	PRINT(0)(" Position:      %f/%f/%f\n", lights[i]->lightPosition[0], lights[i]->lightPosition[1], lights[i]->lightPosition[2]);
-	PRINT(0)(" DiffuseColor:  %f/%f/%f\n", lights[i]->diffuseColor[0], lights[i]->diffuseColor[1], lights[i]->diffuseColor[2]);
-	PRINT(0)(" SpecularColor: %f/%f/%f\n", lights[i]->specularColor[0], lights[i]->specularColor[1], lights[i]->specularColor[2]);
-	PRINT(0)(" Attenuation:   ");
-	switch (lights[i]->attenuationType)
-	  {
-	  case CONSTANT:
-	    PRINT(0)("constant");
-	  case LINEAR:
-	    PRINT(0)("linear");
-	    break;
-	  case QUADRATIC:
-	    PRINT(0)("quadratic");
-	    break;
-	  }
-	PRINT(0)(" with Factor %f\n", lights[i]->attenuationFactor);
-      }
-  PRINT(0)("--------------------------------\n");
-}
Index: orxonox/branches/levelloader/src/light.h
===================================================================
--- orxonox/branches/levelloader/src/light.h	(revision 3604)
+++ 	(revision )
@@ -1,98 +1,0 @@
-/*! 
-    \file light.h
-    \brief Handles Lights.
-
-    A Light is one of the more important things in a 3D-environment,
-    without it one sees nothing :)
-    It is here for diffuse-, specular- and Bump-Mappings.
-*/
-
-#ifndef _LIGHT_H
-#define _LIGHT_H
-
-#include "world_entity.h"
-#include "glincl.h"
-
-//! The maximum number of Lights this OpenGL-implementation supports
-#define NUMBEROFLIGHTS GL_MAX_LIGHTS
-
-//! Enumerator for the attenuation-Type.
-/**
-   CONSTANT means GL_CONSTANT_ATTENUATION
-   LINEAR means   GL_LINEAR_ATTENUATION
-   QUADRATIC means GL_QUADRATIC_ATTENUATION
-*/
-enum AttenuationType {CONSTANT, LINEAR, QUADRATIC};
-
-// FORWARD DEFINITIONS //
-class Vector;
-
-//! A class that handles Lights
-/**
-   A Light is a source that emits light rays (photons)
-*/
-class Light : public WorldEntity
-{
- private:
-  //! A struct that holds information about a Light
-  struct LightValue
-  {
-    int lightNumber;            //!< The number of this Light.
-    GLfloat lightPosition[4];   //!< The Position of this Light.
-    GLfloat diffuseColor[4];    //!< The Diffuse Color this Light emmits.
-    GLfloat specularColor[4];   //!< The specular Color of this Light.
-    AttenuationType attenuationType;//!< The AttenuationType of this Light.
-    float attenuationFactor;    //!< The Factor the attenuation should have.
-    GLfloat spotDirection[4];   //!< The direction of the Spot Light.
-    GLfloat spotCutoff;         //!< The cutoff Angle of the Light Source
-  };
-
-  static Light* singletonRef;    //!< This is the LightHandlers Reference.
-  GLfloat ambientColor[4];       //!< The ambient Color of the scene.
-
-
-  Light(void);
-
-  void init(int LightNumber);  
-  LightValue** lights;           //!< An array of Lenght NUMBEROFLIGHTS, that holds pointers to all LightValues.
-  LightValue* currentLight;      //!< The current Light, we are working with.
-  
- public:
-  static Light* getInstance();
-  ~Light(void);
-
-  // set Attributes
-  int addLight(void);
-  int addLight(int lightNumber);
-  void editLightNumber(int lightNumber);
-  void deleteLight(void);
-  void deleteLight(int lightNumber);
-
-  void setPosition(Vector position);
-  void setPosition(GLfloat x, GLfloat y, GLfloat z);
-  void setDiffuseColor(GLfloat r, GLfloat g, GLfloat b);
-  void setSpecularColor(GLfloat r, GLfloat g, GLfloat b);
-  void setAttenuation(AttenuationType type, float factor);
-  void setAmbientColor(GLfloat r, GLfloat g, GLfloat b);
-  void setSpotDirection(Vector direction);
-  void setSpotCutoff(GLfloat cutoff);
-
-  // get Attributes
-  Vector getPosition(void);
-  /**
-     \returns the Position of Light 
-     \param lightNumber lightnumber
-  */
-  inline Vector getPosition(int lightNumber)
-    {
-      if (!this->lights[lightNumber])
-	return Vector(.0,.0,.0);
-      return Vector(this->lights[lightNumber]->lightPosition[0],
-		    this->lights[lightNumber]->lightPosition[1],
-		    this->lights[lightNumber]->lightPosition[2]);
-    }
-
-  void debug(void);
-};
-
-#endif /* _LIGHT_H */
Index: orxonox/branches/levelloader/src/orxonox.cc
===================================================================
--- orxonox/branches/levelloader/src/orxonox.cc	(revision 3604)
+++ orxonox/branches/levelloader/src/orxonox.cc	(revision 3605)
@@ -31,5 +31,5 @@
 #include "game_loader.h"
 #include <string.h>
-int verbose;
+int verbose = 4;
 
 using namespace std;
@@ -54,5 +54,4 @@
   if( resources != NULL) delete resources;
 }
-
 
 /** \brief this is a singleton class to prevent duplicates */
@@ -173,8 +172,4 @@
   // SDL_WM_SetIcon(SDL_Surface *icon, Uint8 *mask);  
 
-  // OpenGL stuff
-  glClearColor (0.0, 0.0, 0.0, 0.0);
-  glEnable (GL_DEPTH_TEST);
-   
   return 0;
 }
Index: orxonox/branches/levelloader/src/orxonox.conf
===================================================================
--- orxonox/branches/levelloader/src/orxonox.conf	(revision 3604)
+++ orxonox/branches/levelloader/src/orxonox.conf	(revision 3605)
@@ -5,4 +5,5 @@
 RIGHT=right
 SPACE=fire
+m=mode
 ESCAPE=quit
 p=pause
@@ -10,5 +11,4 @@
 BUTTON_LEFT=fire
 BUTTON_RIGHT=altfire
-b=benscho
 x=up_world
 z=down_world
Index: orxonox/branches/levelloader/src/orxonox.h
===================================================================
--- orxonox/branches/levelloader/src/orxonox.h	(revision 3604)
+++ orxonox/branches/levelloader/src/orxonox.h	(revision 3605)
@@ -24,6 +24,6 @@
   static Orxonox* singletonRef;
   Orxonox ();
-  ~Orxonox ();
-  
+  virtual ~Orxonox ();
+
   char configfilename[256];   //!< Filename of the configuration-file.
   World* world;               //!< Reference to the current running world.
Index: orxonox/branches/levelloader/src/proto_class.cc
===================================================================
--- orxonox/branches/levelloader/src/proto_class.cc	(revision 3604)
+++ orxonox/branches/levelloader/src/proto_class.cc	(revision 3605)
@@ -16,7 +16,9 @@
 */
 
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
 
 #include "proto_class.h"
 
+#include "stdincl.h" // maybe
 
 using namespace std;
@@ -35,9 +37,10 @@
 /**
    \brief standard deconstructor
-   \todo this deconstructor is not jet implemented - do it
 
 */
-ProtoClass::~ProtoClass () {}
-
+ProtoClass::~ProtoClass () 
+{
+  // delete what has to be deleted here
+}
 
 /**
Index: orxonox/branches/levelloader/src/proto_class.h
===================================================================
--- orxonox/branches/levelloader/src/proto_class.h	(revision 3604)
+++ orxonox/branches/levelloader/src/proto_class.h	(revision 3605)
@@ -11,5 +11,10 @@
 #define _PROTO_CLASS_H
 
-#include "stdincl.h"
+#include "what realy has to be included"
+#include "base_object.h"
+
+// FORWARD DEFINITION \\
+class someClassWeNeed;
+
 
 /*class Test;*/ /* forward definition of class Test (without including it here!)*/
@@ -22,6 +27,6 @@
 
  public:
-  ProtoClass ();
-  ~ProtoClass ();
+  ProtoClass();
+  virtual ~ProtoClass();
 
   bool doNonSense (int nothing);
Index: orxonox/branches/levelloader/src/simple_animation.cc
===================================================================
--- orxonox/branches/levelloader/src/simple_animation.cc	(revision 3605)
+++ orxonox/branches/levelloader/src/simple_animation.cc	(revision 3605)
@@ -0,0 +1,229 @@
+
+
+/* 
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   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 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Patrick Boenzli
+   co-programmer: ...
+*/
+
+
+#include "simple_animation.h"
+#include "stdincl.h"
+#include "p_node.h"
+
+using namespace std;
+
+/**
+   \brief standard constructor
+   \param the point of the object
+   \param and the orientation of it
+   \param at this time
+*/
+KeyFrame::KeyFrame(Vector* point, Quaternion* orientation, float time)
+{
+  this->setRelCoor(point);
+  this->setRelDir(orientation);
+  this->time = time;
+}
+
+
+/**
+   \brief standard constructor
+   \param the point of the object
+   \param and the orientation of it
+   \param at this time
+   \param function of the velocity of the movement 
+*/
+KeyFrame::KeyFrame(Vector* point, Quaternion* orientation, float time, movementMode mode)
+{
+  this->setRelCoor(point);
+  this->setRelDir(orientation);
+  this->time = time;
+  this->mode = mode;
+}
+
+
+/**
+   \brief standard deconstructor
+*/
+KeyFrame::~KeyFrame()
+{
+}
+
+
+/**
+   \brief sets the important properties of a Keyframe
+   \param the point of the object
+   \param and the orientation of it
+   \param at this time
+*/
+void KeyFrame::set(Vector* point, Quaternion* orientation, float time)
+{
+  this->setRelCoor(point);
+  this->setRelDir(orientation);
+  this->time = time;
+}
+
+
+/**
+   \brief sets the important properties of a Keyframe
+   \param the point of the object
+   \param and the orientation of it
+   \param at this time
+   \param function of the velocity of the movement 
+*/
+void KeyFrame::set(Vector* point, Quaternion* orientation, float time, movementMode mode)
+{
+  this->setRelCoor(point);
+  this->setRelDir(orientation);
+  this->time = time;
+  this->mode = mode;
+}
+
+
+
+/**
+   \brief standard constructor
+*/
+SimpleAnimation::SimpleAnimation (PNode* parent) 
+{
+   this->setClassName ("SimpleAnimation");
+   this->frames = new tList<KeyFrame>();
+   this->localTime = 0;
+   this->bPause = false;
+   this->parent = parent;
+}
+
+
+/**
+   \brief standard deconstructor
+
+*/
+SimpleAnimation::~SimpleAnimation () 
+{
+  KeyFrame* frame = this->frames->enumerate(); 
+  while( frame != NULL) 
+    { 
+      delete frame;
+      frame = frames->nextElement();
+    }
+  delete this->frames;
+}
+
+
+
+/**
+   \brief adds a keyframe with properties
+   \param the point of the object
+   \param and the orientation of it
+   \param at this time
+*/
+void SimpleAnimation::addKeyFrame(Vector* point, Quaternion* orientation, float time)
+{
+  KeyFrame* frame = new KeyFrame(point, orientation, time);
+  this->frames->add(frame);
+}
+
+
+/**
+   \brief adds a keyframe with properties
+   \param the point of the object
+   \param and the orientation of it
+   \param at this time
+   \param function of the velocity of the movement 
+*/
+void SimpleAnimation::addKeyFrame(Vector* point, Quaternion* orientation, float time, movementMode mode)
+{
+  KeyFrame* frame = new KeyFrame(point, orientation, time, mode);
+  this->frames->add(frame);
+}
+
+/**
+   \brief adds a already defined keyframe
+   \param the keyframe to add
+*/
+void SimpleAnimation::addKeyFrame(KeyFrame* frame)
+{
+  this->frames->add(frame);
+}
+
+
+/**
+   \brief clear the list of keyframes, deleting all keyframes included
+*/
+void SimpleAnimation::reset()
+{
+  KeyFrame* frame = this->frames->enumerate(); 
+  while( frame != NULL) 
+    { 
+      delete frame;
+      frame = frames->nextElement();
+    }
+  delete this->frames;
+
+  this->frames = new tList<KeyFrame>();
+  this->localTime = 0;
+  this->bPause = false;
+
+}
+
+/**
+   \brief starts the animation, therefore listens to tick signals
+*/
+void SimpleAnimation::start()
+{}
+
+
+/**
+   \brief stops the animation, immune to tick signals
+*/
+void SimpleAnimation::stop()
+{}
+
+/**
+   \brief stops and then starts the animation from begining
+*/
+void SimpleAnimation::restart()
+{
+  this->localTime = 0;
+  this->bPause = false;
+}
+
+/**
+   \brief pauses the animation until resumed
+*/
+void SimpleAnimation::pause()
+{
+  this->bPause = true;
+}
+
+/**
+   \brief resumes a pause, if not paused, no effect
+*/
+void SimpleAnimation::resume()
+{
+  this->bPause = false;
+}
+
+
+/**
+   \brief heart beat, next animation step
+*/
+void SimpleAnimation::tick(float time)
+{
+  if(!this->bPause)
+    {
+
+
+
+    }
+}
Index: orxonox/branches/levelloader/src/simple_animation.h
===================================================================
--- orxonox/branches/levelloader/src/simple_animation.h	(revision 3605)
+++ orxonox/branches/levelloader/src/simple_animation.h	(revision 3605)
@@ -0,0 +1,72 @@
+/*! 
+    \file simple_animation.h
+    \brief A class to interpolate the movement of an object following descrete points in room and time
+    \todo implement it
+
+    This class has been done to animate some movement, works best for short 
+    distances.
+*/
+
+#ifndef _SIMPLE_ANIMATION_H
+#define _SIMPLE_ANIMATION_H
+
+#include "base_object.h"
+#include "p_node.h"
+#include "list.h"
+
+
+typedef enum movementMode{LINEAR=0, EXP, NEG_EXP, SIN, COS};
+
+
+//! KeyFrame Class
+/**
+   This represents one point with orientation of the animation
+*/
+class KeyFrame : public PNode {
+ public:
+  KeyFrame(Vector* point, Quaternion* orientation, float time);
+  KeyFrame(Vector* point, Quaternion* orientation, float time, movementMode mode); 
+  virtual ~KeyFrame();
+
+  void set(Vector* point, Quaternion* orientation, float time);
+  void set(Vector* point, Quaternion* orientation, float time, movementMode mode);
+  
+ private:
+  float time;
+  movementMode mode;
+};
+
+
+//! Animation Class
+/**
+   Helps you making some small animation
+*/
+class SimpleAnimation : public BaseObject {
+  
+ public:
+  SimpleAnimation(PNode* parent);
+  virtual ~SimpleAnimation();
+
+  void addKeyFrame(Vector* point, Quaternion* orientation, float time);
+  void addKeyFrame(Vector* point, Quaternion* orientation, float time, movementMode mode);
+  void addKeyFrame(KeyFrame* frame);
+  void reset();
+
+  void start();
+  void stop();
+  void restart();
+  void pause();
+  void resume();
+
+  void tick(float time);
+
+ private:
+  bool bPause;                     //<! is set, when there is a pause
+  tList<KeyFrame>* frames;        //<! where keyframes are stored in
+  float localTime;
+  PNode* parent;
+  
+
+};
+
+#endif /* _SIMPLE_ANIMATION_H */
Index: orxonox/branches/levelloader/src/story_entities/campaign.h
===================================================================
--- orxonox/branches/levelloader/src/story_entities/campaign.h	(revision 3604)
+++ orxonox/branches/levelloader/src/story_entities/campaign.h	(revision 3605)
@@ -14,5 +14,5 @@
   Campaign ();
   Campaign ( TiXmlElement* root);
-  ~Campaign ();
+  virtual ~Campaign ();
 
   StoryEntity* currentEntity;
Index: orxonox/branches/levelloader/src/story_entities/world.cc
===================================================================
--- orxonox/branches/levelloader/src/story_entities/world.cc	(revision 3604)
+++ orxonox/branches/levelloader/src/story_entities/world.cc	(revision 3605)
@@ -14,4 +14,6 @@
    co-programmer: Christian Meyer
 */
+
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD
 
 #include "world.h"
@@ -22,4 +24,5 @@
 #include "camera.h"
 #include "environment.h"
+#include "primitive.h"
 #include "p_node.h"
 #include "null_parent.h"
@@ -31,4 +34,6 @@
 #include "factory.h"
 #include "game_loader.h"
+#include "track_node.h"
+#include "terrain.h"
 
 using namespace std;
@@ -79,8 +84,6 @@
 World::World (char* name)
 {
-  this->setClassName ("World");
-  this->worldName = name;
-  this->debugWorldNr = -1;
-  this->entities = new tList<WorldEntity>();
+  this->init(name, -1);
+  //NullParent* np = NullParent::getInstance();
 }
 
@@ -91,7 +94,5 @@
 World::World (int worldID)
 {
-  this->debugWorldNr = worldID;
-  this->worldName = NULL;
-  this->entities = new tList<WorldEntity>();
+  this->init(NULL, worldID);
 }
 
@@ -104,34 +105,31 @@
 World::~World ()
 {
-  printf("World::~World() - deleting current world\n");
+  PRINTF(3)("World::~World() - deleting current world\n");
   CommandNode* cn = Orxonox::getInstance()->getLocalInput();
   cn->unbind(this->localPlayer);
   cn->reset();
 
-  this->localCamera->destroy();
-  this->nullParent->destroy();  
-  delete this->skySphere;
+  delete this->nullParent;
+  delete this->entities;
+  delete this->lightMan;
+  delete this->trackManager;
+}
   if( this->worldName) delete this->worldName;
   if( this->path) delete this->path;
 
-  //delete this->trackManager;
-
-  /*
-  WorldEntity* entity = entities->enumerate();  
-  while( entity != NULL ) 
-    { 
-      entity->destroy();
-      entity = entities->nextElement();
-    }
-  this->entities->destroy();
-  */
-
-  /* FIX the parent list has to be cleared - not possible if we got the old list also*/
-
-
-  //delete this->entities;
-  //delete this->localCamera;
-  /* this->localPlayer hasn't to be deleted explicitly, it is 
-     contained in entities*/
+/**
+   \brief initializes a new World
+*/
+void World::init(char* name, int worldID)
+{
+  this->setClassName ("World");
+
+  this->worldName = name;
+  this->debugWorldNr = worldID;
+  this->entities = new tList<WorldEntity>();
+
+  // Enable default GL stuff
+  glEnable(GL_DEPTH_TEST);
+
 }
 
@@ -142,4 +140,5 @@
 ErrorMessage World::load()
 {
+<<<<<<< .working
 	
 	PRINTF0("> Loading world: '%s'\n", getPath());
@@ -156,5 +155,88 @@
 	// load the campaign document
 	if( !XMLDoc->LoadFile())
+=======
+  //  BezierCurve* tmpCurve = new BezierCurve();
+  if(this->debugWorldNr != -1)
+    {
+      // initializing Font
+      testFont = new FontSet();
+      testFont->buildFont("../data/pictures/font.tga");
+
+      // initializing the TrackManager
+      trackManager = TrackManager::getInstance();
+      trackManager->addPoint(Vector(0,0,0));
+      trackManager->addPoint(Vector(100, -40, 5));
+      trackManager->addPoint(Vector(200,-40,-8));
+      trackManager->addPoint(Vector(250, -35, -2));
+      trackManager->addPoint(Vector(320,-33,-.55));
+      trackManager->setDuration(1);
+      trackManager->setSavePoint();
+      trackManager->addPoint(Vector(410, 0, 0));
+      trackManager->addPoint(Vector(510, 20, -10));
+      trackManager->addPoint(Vector(550, 20, -10));
+      trackManager->addPoint(Vector(570, 20, -10));
+      trackManager->setDuration(1);
+      
+      int fork11, fork12;
+      trackManager->fork(2, &fork11, &fork12);
+      trackManager->workOn(fork11);
+      trackManager->addPoint(Vector(640, 25, -30));
+      trackManager->addPoint(Vector(700, 40, -120));
+      trackManager->addPoint(Vector(800, 50, -150));
+      trackManager->addPoint(Vector(900, 60, -100));
+      trackManager->addPoint(Vector(900, 60, -70));
+      trackManager->addPoint(Vector(990, 65, -15));
+      trackManager->addPoint(Vector(1050, 65, -10));
+      trackManager->addPoint(Vector(1100, 65, -20));
+      trackManager->setDuration(4);
+
+      trackManager->workOn(fork12);
+      trackManager->addPoint(Vector(640, 25, 20));
+      trackManager->addPoint(Vector(670, 50, 120));
+      trackManager->addPoint(Vector(700, 70, 80));
+      trackManager->addPoint(Vector(800, 70, 65));
+      trackManager->addPoint(Vector(850, 65, 65));
+      trackManager->addPoint(Vector(920, 35, 40));
+      trackManager->addPoint(Vector(945, 40, 40));
+      trackManager->addPoint(Vector(970, 24, 40));
+      trackManager->addPoint(Vector(1000, 40, -7));
+      trackManager->setDuration(4);
+      
+
+      trackManager->join(2, fork11, fork12);
+
+      trackManager->workOn(5);
+      trackManager->addPoint(Vector(1200, 60, -50));
+      trackManager->addPoint(Vector(1300, 50, -50));
+      trackManager->addPoint(Vector(1400, 40, -50));
+      trackManager->addPoint(Vector(1500, 40, -60));
+      trackManager->addPoint(Vector(1600, 35, -55));
+      trackManager->addPoint(Vector(1700, 45, -40));
+      trackManager->addPoint(Vector(1750, 60, -40));
+      trackManager->addPoint(Vector(1770, 80, -40));
+      trackManager->addPoint(Vector(1800, 100, -40));
+      trackManager->setDuration(4);
+
+      trackManager->finalize();
+
+      
+      /*monitor progress*/
+      this->glmis->step();
+
+      // LIGHT initialisation
+      lightMan = LightManager::getInstance();
+      lightMan->setAmbientColor(.1,.1,.1);
+      lightMan->addLight();
+      //      lightMan->setAttenuation(1.0, .01, 0.0);
+      //      lightMan->setDiffuseColor(1,1,1);
+      //  lightMan->addLight(1);
+      //  lightMan->setPosition(20, 10, -20);
+      //  lightMan->setDiffuseColor(0,0,0);
+      lightMan->debug();
+
+      switch(this->debugWorldNr)
+>>>>>>> .merge-right.r3604
 	{
+<<<<<<< .working
 		// report an error
 		PRINTF0("Error loading XML File: %s @ %d:%d\n", XMLDoc->ErrorDesc(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol());
@@ -234,4 +316,17 @@
 		PRINTF0("Done loading Track\n");
 	}
+=======
+	  /*
+	    this loads the hard-coded debug world. this only for simplicity and will be 
+	    removed by a reald world-loader, which interprets a world-file.
+	    if you want to add an own debug world, just add a case DEBUG_WORLD_[nr] and
+	    make whatever you want...
+	   */
+	case DEBUG_WORLD_0:
+	  {
+	    lightMan->setPosition(-5.0, 10.0, -40.0);
+	    this->nullParent = NullParent::getInstance ();
+	    this->nullParent->setName ("NullParent");
+>>>>>>> .merge-right.r3604
 
 	
@@ -265,4 +360,5 @@
     this->localPlayer->addChild (this->localCamera);
 
+<<<<<<< .working
 	
 	// stuff beyond this point remains to be loaded properly
@@ -270,7 +366,36 @@
       /*monitor progress*/
   //  this->glmis->step();
-
+=======
+	    //create helper for player
+	    //HelperParent* hp = new HelperParent ();
+	    /* the player has to be added to this helper */
+>>>>>>> .merge-right.r3604
+
+<<<<<<< .working
+=======
+	    // create a player
+	    this->localPlayer = new Player ();
+	    this->localPlayer->setName ("player");
+	    this->spawn (this->localPlayer);
+	    /*monitor progress*/
+	    this->glmis->step();	    
+
+	    // bind input
+	    Orxonox *orx = Orxonox::getInstance ();
+	    orx->getLocalInput()->bind (this->localPlayer);
+	    
+	    // bind camera
+	    this->localCamera = new Camera(this);
+	    this->localCamera->setName ("camera");
+	    this->localCamera->bind (this->localPlayer);
+	    /*monitor progress*/
+	    this->glmis->step();	    
+
+>>>>>>> .merge-right.r3604
 	    // Create SkySphere
-	    skySphere = new Skysphere("../data/pictures/sky-replace.jpg");
+	    this->skySphere = new Skysphere("../data/pictures/sky-replace.jpg");
+	    this->skySphere->setName("SkySphere");
+	    this->localCamera->addChild(this->skySphere);
+	    this->skySphere->setMode(PNODE_MOVEMENT);
 
 	    /*monitor progress*/
@@ -279,204 +404,94 @@
 	  //  trackManager->setBindSlave(env);
 
+<<<<<<< .working
+=======
+	    
+	    WorldEntity* env = new Environment();
+	    env->setName ("env");
+	    this->spawn(env);
+
+	   
+	    Vector* es = new Vector (10, 5, 0);
+	    Quaternion* qs = new Quaternion ();
+	    WorldEntity* pr = new Primitive(PSPHERE);
+	    pr->setName("primitive");
+	    this->spawn(pr, this->localPlayer, es, qs, PNODE_MOVEMENT);
+	   
+
+	    /*monitor progress*/
+	    this->glmis->step();
+
+	    //	    trackManager->setBindSlave(env);
+	    PNode* tn = trackManager->getTrackNode();
+	    tn->addChild(this->localPlayer);
+
+	    //localCamera->setParent(TrackNode::getInstance());
+	    tn->addChild (this->localCamera);
+	    this->localPlayer->setMode(PNODE_ROTATE_AND_MOVE);
+	    //Vector* cameraOffset = new Vector (0, 5, -10);
+	    Vector* cameraOffset = new Vector (-10, 5, 0);
+	    this->localCamera->setRelCoor (cameraOffset);
+	    trackManager->condition(2, LEFTRIGHT, this->localPlayer);
+
+	    break;
+	  }
+	case DEBUG_WORLD_1:
+	  {
+	    lightMan->setPosition(.0, .0, .0);
+	    lightMan->setAttenuation(1.0, .01, 0.0);
+	    lightMan->setSpecularColor(1,0,0);
+	    this->nullParent = NullParent::getInstance ();
+	    this->nullParent->setName ("NullParent");
+
+	    // create a player
+	    WorldEntity* myPlayer = new Player();
+	    myPlayer->setName ("player");
+	    this->spawn(myPlayer);
+	    this->localPlayer = myPlayer;	    
+	    
+	    // bind input
+	    Orxonox *orx = Orxonox::getInstance();
+	    orx->getLocalInput()->bind (myPlayer);
+	    
+	    // bind camera
+	    this->localCamera = new Camera (this);
+	    this->localCamera->setName ("camera");
+	    this->localCamera->bind (myPlayer);	
+	    this->localPlayer->addChild (this->localCamera);
+
+	    // Create SkySphere
+	    skySphere = new Skysphere("../data/pictures/sky-replace.jpg");
+	    this->localPlayer->addChild(this->skySphere);
+
+	    Vector* es = new Vector (20, 0, 0);
+	    Quaternion* qs = new Quaternion ();
+	    WorldEntity* pr = new Primitive(PSPHERE);
+	    pr->setName("primitive");
+	    this->spawn(pr, this->localPlayer, es, qs, PNODE_ROTATE_AND_MOVE);
+
+	    lightMan->getLight(0)->setParent(trackManager->getTrackNode());
+	    break;
+	  }
+	default:
+	  printf("World::load() - no world with ID %i found", this->debugWorldNr );
+	}
+    }
+  else if(this->worldName != NULL)
+    {
+
+    }
+
+>>>>>>> .merge-right.r3604
   // initialize debug coord system
   objectList = glGenLists(1);
   glNewList (objectList, GL_COMPILE);
-  glLoadIdentity();
-  glColor3f(1.0,0,0);
-  glBegin(GL_QUADS);
-
-  int sizeX = 100;
-  int sizeZ = 80;
-  float length = 1000;
-  float width = 200;
-  float widthX = float (length /sizeX);
-  float widthZ = float (width /sizeZ);
-  
-  float height [sizeX][sizeZ];
-  Vector normal_vectors[sizeX][sizeZ];
-  
-  
-  for ( int i = 0; i<sizeX-1; i+=1)
-    for (int j = 0; j<sizeZ-1;j+=1)
-      //height[i][j] = rand()/20046 + (j-25)*(j-25)/30;
-#ifdef __WIN32__
-      height[i][j]=(sin((float)j/3)*rand()*i/182400)*.5;
-#else
-      height[i][j]=(sin((float)j/3)*rand()*(long)i/6282450500.0)*.5;
-#endif
-
-  //Die Huegel ein wenig glaetten
-  for (int h=1; h<2;h++)
-    for (int i=1;i<sizeX-2 ;i+=1 )
-      for(int j=1;j<sizeZ-2;j+=1)
-	height[i][j]=(height[i+1][j]+height[i][j+1]+height[i-1][j]+height[i][j-1])/4;
-  
-  //Berechnung von normalen Vektoren
-  for(int i=1;i<sizeX-2;i+=1)
-    for(int j=1;j<sizeZ-2 ;j+=1)
-      {
-	Vector v1 = Vector (widthX*(1),      height[i][j],      widthZ*(j) );
-	Vector v2 = Vector (widthX*(i-1),    height[i-1][j],    widthZ*(j));
-	Vector v3 = Vector (widthX*(i),      height[i][j+1],    widthZ*(j+1));
-	Vector v4 = Vector (widthX*(i+1),    height[i+1][j],    widthZ*(j));
-	Vector v5 = Vector (widthX*(i),      height[i][j-1],    widthZ*(j-1));
-	
-	Vector c1 = v2 - v1;
-	Vector c2 = v3 - v1;
-	Vector c3=  v4 - v1;
-	Vector c4 = v5 - v1;
-	Vector zero = Vector (0,0,0);
-	normal_vectors[i][j]=c1.cross(v3-v5)+c2.cross(v4-v2)+c3.cross(v5-v3)+c4.cross(v2-v4);
-	normal_vectors[i][j].normalize();
-      }
-
-  int snowheight=3;
-  for ( int i = 0; i<sizeX; i+=1)
-    for (int j = 0; j<sizeZ;j+=1)
-      {	  
-	Vector v1 = Vector (widthX*(i),      height[i][j]-20,       widthZ*(j)  -width/2);
-	Vector v2 = Vector (widthX*(i+1),    height[i+1][j]-20,     widthZ*(j)  -width/2);
-	Vector v3 = Vector (widthX*(i+1),    height[i+1][j+1]-20,   widthZ*(j+1)-width/2);
-	Vector v4 = Vector (widthX*(i),      height[i][j+1]-20,     widthZ*(j+1)-width/2);
-	float a[3];
-	if(height[i][j]<snowheight){
-	  a[0]=0;
-	  a[1]=1.0-height[i][j]/10-.3;
-	  a[2]=0;
-	  glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
-	}
-	else{
-	    a[0]=1.0;
-	    a[1]=1.0;
-	    a[2]=1.0;
-	    glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
-	    
-	}
-	glNormal3f(normal_vectors[i][j].x, normal_vectors[i][j].y, normal_vectors[i][j].z);
-	glVertex3f(v1.x, v1.y, v1.z);
-	if(height[i+1][j]<snowheight){
-	  a[0]=0;
-	  a[1] =1.0-height[i+1][j]/10-.3;
-	  a[2]=0;
-	  glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
-	}
-	else{
-	  a[0]=1.0;
-	  a[1]=1.0;
-	  a[2]=1.0;
-	  glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
-	  
-	}
-	glNormal3f(normal_vectors[i+1][j].x, normal_vectors[i+1][j].y, normal_vectors[i+1][j].z);
-	glVertex3f(v2.x, v2.y, v2.z);
-	if(height[i+1][j+1]<snowheight){
-	  a[0]=0;
-	  a[1] =1.0-height[i+1][j+1]/10-.3;
-	  a[2]=0;
-	  glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
-	}
-	else{
-	  a[0]=1.0;
-	  a[1]=1.0;
-	  a[2]=1.0;
-	  glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
-	  
-	  
-	}
-	glNormal3f(normal_vectors[i+1][j+1].x, normal_vectors[i+1][j+1].y, normal_vectors[i+1][j+1].z);
-	glVertex3f(v3.x, v3.y, v3.z);
-	if(height[i][j+1]<snowheight){
-	  a[0]=0;
-	  a[1] =1.0-height[i+1][j+1]/10-.3;
-	  a[2]=0;
-	  glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
-	}
-	else{
-	  a[0]=1.0;
-	  a[1]=1.0;
-	  a[2]=1.0;
-	  glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
-	}
-	glNormal3f(normal_vectors[i][j+1].x, normal_vectors[i][j+1].y, normal_vectors[i][j+1].z);
-	glVertex3f(v4.x, v4.y, v4.z);
-	
-      }
-  glEnd();
-  /*  
-  glBegin(GL_LINES);
-  for( float x = -128.0; x < 128.0; x += 25.0)
-    {
-      for( float y = -128.0; y < 128.0; y += 25.0)
-	{
-	  glColor3f(1,0,0);
-	  glVertex3f(x,y,-128.0);
-	  glVertex3f(x,y,0.0);
-	  glColor3f(0.5,0,0);
-	  glVertex3f(x,y,0.0);
-	  glVertex3f(x,y,128.0);
-	}
-    }
-  for( float y = -128.0; y < 128.0; y += 25.0)
-    {
-      for( float z = -128.0; z < 128.0; z += 25.0)
-	{
-	  glColor3f(0,1,0);
-	  glVertex3f(-128.0,y,z);
-	  glVertex3f(0.0,y,z);
-	  glColor3f(0,0.5,0);
-	  glVertex3f(0.0,y,z);
-	  glVertex3f(128.0,y,z);
-	}
-    }
-  for( float x = -128.0; x < 128.0; x += 25.0)
-    {
-      for( float z = -128.0; z < 128.0; z += 25.0)
-	{
-	  glColor3f(0,0,1);
-	  glVertex3f(x,-128.0,z);
-	  glVertex3f(x,0.0,z);
-	  glColor3f(0,0,0.5);
-	  glVertex3f(x,0.0,z);
-	  glVertex3f(x,128.0,z);
-	}
-      
-    }
-  */  
-  /*
-  glBegin(GL_LINE_STRIP);
-  glColor3f(1.0, 5.0, 1.0);
-  for( int i = 0; i <= 30; i++)
-    {
-      glEvalCoord1f ((GLfloat) i/30.0);
-    }
-  glEnd();
-  */
-
+ 
   trackManager->drawGraph(.01);
   trackManager->debug(2);
-  /*  
-  glBegin(GL_LINES);
-  float i;
-  for(i = 0.0; i<1; i+=.01)
-    {
-      printf("%f, %f, %f\n",tmpCurve->calcPos(i).x, tmpCurve->calcPos(i).y, tmpCurve->calcPos(i).z);
-      glVertex3f(tmpCurve->calcPos(i).x, tmpCurve->calcPos(i).y, tmpCurve->calcPos(i).z);
-    }
-  glEnd();
-  */
   glEndList();
-  // LIGHT initialisation
-  light = Light::getInstance();
-  light->addLight(0);
-  light->setAttenuation(QUADRATIC, 1.0);
-  light->setAttenuation(CONSTANT, 2.0);
-  light->setAttenuation(QUADRATIC, 1.0);
-  light->setPosition(10.0, 10.0, 50.0);
-  light->setDiffuseColor(1,1,1);
-  //  light->addLight(1);
-  //  light->setPosition(20, 10, -20);
-  //  light->setDiffuseColor(0,0,0);
-  light->debug();
-
+
+  terrain = new Terrain("../data/worlds/newGround.obj");
+  terrain->setRelCoor(new Vector(0,-10,0));
+  this->spawn(terrain);
 
 }
@@ -492,12 +507,5 @@
   cn->enable(true);
 
-  //glMap1f (GL_MAP1_VERTEX_3, 0.0, 1.0, 3, 4, &ctrlpoints[0][0]);
-  //glEnable (GL_MAP1_VERTEX_3);
-  
-  //theNurb = gluNewNurbsRenderer ();
-  //gluNurbsProperty (theNurb, GLU_NURBS_MODE, GLU_NURBS_TESSELLATOR);
-  //gluNurbsProperty (theNurb, GLU_NURBS_VERTEX, vertexCallback );
-	
-	PRINTF0("> Done Loading world: '%s'\n", getPath());
+PRINTF0("> Done Loading world: '%s'\n", getPath());
 }
 
@@ -508,5 +516,5 @@
 ErrorMessage World::start()
 {
-  printf("World::start() - starting current World: nr %i\n", this->debugWorldNr);
+  PRINTF(3)("World::start() - starting current World: nr %i\n", this->debugWorldNr);
   this->bQuitOrxonox = false;
   this->bQuitCurrentGame = false;
@@ -521,5 +529,5 @@
 ErrorMessage World::stop()
 {
-  printf("World::stop() - got stop signal\n");
+  PRINTF(3)("World::stop() - got stop signal\n");
   this->bQuitCurrentGame = true;
 }
@@ -546,5 +554,5 @@
 ErrorMessage World::destroy()
 {
-  delete trackManager;
+
 }
 
@@ -554,5 +562,5 @@
 void World::displayLoadScreen ()
 {
-  printf ("World::displayLoadScreen - start\n"); 
+  PRINTF(3)("World::displayLoadScreen - start\n"); 
   
   //GLMenuImageScreen* 
@@ -562,5 +570,5 @@
   this->glmis->draw();
  
-  printf ("World::displayLoadScreen - end\n"); 
+  PRINTF(3)("World::displayLoadScreen - end\n"); 
 }
 
@@ -572,8 +580,8 @@
 void World::releaseLoadScreen ()
 {
-  printf ("World::releaseLoadScreen - start\n"); 
+  PRINTF(3)("World::releaseLoadScreen - start\n"); 
   this->glmis->setValue(this->glmis->getMaximum());
   SDL_Delay(500);
-  printf ("World::releaseLoadScreen - end\n"); 
+  PRINTF(3)("World::releaseLoadScreen - end\n"); 
 }
 
@@ -629,4 +637,6 @@
   /* draw entities */
   WorldEntity* entity;
+  glLoadIdentity();
+
   entity = this->entities->enumerate();
   while( entity != NULL ) 
@@ -642,4 +652,5 @@
   testFont->printText(0, 0, 1, "orxonox_" PACKAGE_VERSION);
 
+  lightMan->draw(); // must be at the end of the drawing procedure, otherwise Light cannot be handled as PNodes //
 }
 
@@ -651,5 +662,5 @@
 void World::debug()
 {
-  printf ("World::debug() - starting debug\n");
+  PRINTF(2)("debug() - starting debug\n");
   PNode* p1 = NullParent::getInstance ();
   PNode* p2 = new PNode (new Vector(2, 2, 2), p1);
@@ -670,5 +681,5 @@
   p4->debug ();
   
-  p1->update (1);
+  p1->update ();
 
   printf ("World::debug() - update\n");
@@ -679,5 +690,5 @@
 
   p2->shiftCoor (new Vector(-1, -1, -1));
-  p1->update (2);
+  p1->update ();
 
   p1->debug ();
@@ -689,5 +700,5 @@
 
 
- p1->update (2);
+ p1->update ();
 
   p1->debug ();
@@ -696,5 +707,5 @@
   p4->debug ();
 
-  p1->destroy ();
+  delete p1;
   
   
@@ -726,4 +737,5 @@
   while( !this->bQuitOrxonox && !this->bQuitCurrentGame) /* \todo implement pause */
     {
+      PRINTF(3)("World::mainloop() - number of entities: %i\n", this->entities->getSize());
       // Network
       this->synchronize ();
@@ -731,19 +743,18 @@
       this->handleInput ();
       if( this->bQuitCurrentGame || this->bQuitOrxonox)
-	{
-	  printf("World::mainLoop() - leaving loop earlier...\n");
 	  break;
-	}
       // Process time
-     this->timeSlice ();
+      this->tick ();
+      // Update the state
+      this->update ();      
       // Process collision
      this->collide ();
       // Draw
      this->display ();
-  
-      for( int i = 0; i < 5000000; i++) {}
+
+      //      for( int i = 0; i < 5000000; i++) {}
       /* \todo this is to slow down the program for openGl Software emulator computers, reimplement*/
     }
-  printf("World::mainLoop() - Exiting the main loop\n");
+  PRINTF(3)("World::mainLoop() - Exiting the main loop\n");
 }
 
@@ -781,5 +792,5 @@
    a heart-beat.
 */
-void World::timeSlice ()
+void World::tick ()
 {
   Uint32 currentFrame = SDL_GetTicks();
@@ -791,5 +802,5 @@
 	{
 	  float fps = 1000/dt;
-	  printf("fps = %f\n", fps);
+	  PRINTF(3)("fps = %f\n", fps);
 	}
       else
@@ -798,5 +809,5 @@
 	     nothing.
 	  */
-	  printf("fps = 1000 - frame rate is adjusted\n");
+	  PRINTF(2)("fps = 1000 - frame rate is adjusted\n");
 	  SDL_Delay(10);
 	  dt = 10;
@@ -808,5 +819,4 @@
       float seconds = dt / 1000.0;  
       assert( this->nullParent != NULL); 
-      this->nullParent->update (seconds);
       entity = entities->enumerate(); 
       while( entity != NULL) 
@@ -815,14 +825,24 @@
 	  entity = entities->nextElement();
 	}
-      //assert( skySphere != NULL); 
-      //skySphere->updatePosition(localCamera->absCoordinate);
-      
       /* update tick the rest */
       assert( this->localCamera != NULL); 
       assert( this->trackManager != NULL); 
-      this->localCamera->timeSlice(dt);
+      this->localCamera->tick(dt);
+
       this->trackManager->tick(dt);
     }
   this->lastFrame = currentFrame;
+}
+
+
+/**
+   \brief this function gives the world a consistant state
+
+   after ticking (updating the world state) this will give a constistant
+   state to the whole system.
+*/
+void World::update()
+{
+  this->nullParent->update ();
 }
 
@@ -856,9 +876,5 @@
 void World::spawn(WorldEntity* entity)
 {
-  if( this->nullParent != NULL && entity->parent == NULL)
-    this->nullParent->addChild (entity);
-
   this->entities->add (entity);
-
   entity->postSpawn ();
 }
@@ -873,13 +889,37 @@
 void World::spawn(WorldEntity* entity, Vector* absCoor, Quaternion* absDir)
 {
+  this->entities->add (entity);
+
   entity->setAbsCoor (absCoor);
   entity->setAbsDir (absDir);
-  
-  if( this->nullParent != NULL && entity->parent == NULL)
-    this->nullParent->addChild (entity);
-
-  this->entities->add (entity);
 
   entity->postSpawn ();
+}
+
+
+/**
+   \brief add and spawn a new entity to this world
+   \param entity to be added
+   \param entity to be added to (PNode)
+   \param At what relative  coordinates to add this entity.
+   \param In which relative direction should it look.
+*/
+void World::spawn(WorldEntity* entity, PNode* parentNode, 
+		  Vector* relCoor, Quaternion* relDir, 
+		  int parentingMode)
+{
+  this->nullParent = NullParent::getInstance();
+  if( parentNode != NULL)
+    {
+      parentNode->addChild (entity);
+      
+      entity->setRelCoor (relCoor);
+      entity->setRelDir (relDir);
+      entity->setMode(parentingMode);
+      
+      this->entities->add (entity);
+      
+      entity->postSpawn ();
+    }
 }
 
Index: orxonox/branches/levelloader/src/story_entities/world.h
===================================================================
--- orxonox/branches/levelloader/src/story_entities/world.h	(revision 3604)
+++ orxonox/branches/levelloader/src/story_entities/world.h	(revision 3605)
@@ -10,4 +10,5 @@
 
 #include "story_entity.h"
+#include "p_node.h"
 
 class TrackManager;
@@ -17,6 +18,8 @@
 class GLMenuImageScreen;
 class Skysphere;
-class Light;
+class LightManager;
 class FontSet;
+class Terrain;
+
 
 //! The game world
@@ -55,10 +58,14 @@
   void spawn (WorldEntity* entity);
   void spawn (WorldEntity* entity, Vector* absCoor, Quaternion* absDir);
+  void spawn(WorldEntity* entity, PNode* parentNode, Vector* relCoor, Quaternion* relDir, 
+	     int parentingMode);
+
 	
 	void setPath( char* name);
 	char* getPath();
 
+ private:
+  void init(char* name, int worldID);
 
- private:
   Uint32 lastFrame;             //!< last time of frame
   bool bQuitOrxonox;            //!< quit this application
@@ -74,8 +81,9 @@
 
   PNode* nullParent;            //!< The zero-point, that everything has as its parent.
-  TrackManager* trackManager;  //!< The reference of the TrackManager that handles the course through the Level.
-  Camera* localCamera;         //!< The current Camera
+  TrackManager* trackManager;   //!< The reference of the TrackManager that handles the course through the Level.
+  Camera* localCamera;          //!< The current Camera
   Skysphere* skySphere;         //!< The Environmental Heaven of orxonox \todo insert this to environment insted
-  Light* light;                 //!< The Lights of the Level
+  LightManager* lightMan;       //!< The Lights of the Level
+  Terrain* terrain;             //!< The Terrain of the World.
 
   GLuint objectList;            //!< temporary: \todo this will be ereased soon
@@ -87,5 +95,6 @@
   void synchronize ();
   void handleInput ();
-  void timeSlice ();
+  void tick ();
+  void update ();
   void collide ();
   void draw ();
Index: orxonox/branches/levelloader/src/subprojects/Makefile.am
===================================================================
--- orxonox/branches/levelloader/src/subprojects/Makefile.am	(revision 3605)
+++ orxonox/branches/levelloader/src/subprojects/Makefile.am	(revision 3605)
@@ -0,0 +1,1 @@
+SUBDIRS = testmain
Index: orxonox/branches/levelloader/src/subprojects/Makefile.in
===================================================================
--- orxonox/branches/levelloader/src/subprojects/Makefile.in	(revision 3605)
+++ orxonox/branches/levelloader/src/subprojects/Makefile.in	(revision 3605)
@@ -0,0 +1,452 @@
+# Makefile.in generated by automake 1.8.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+host_triplet = @host@
+subdir = src/subprojects
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-exec-recursive install-info-recursive \
+	install-recursive installcheck-recursive installdirs-recursive \
+	pdf-recursive ps-recursive uninstall-info-recursive \
+	uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CURL_CFLAGS = @CURL_CFLAGS@
+CURL_LIBS = @CURL_LIBS@
+CXX = @CXX@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEBUG = @DEBUG@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOCUMENTATION_FALSE = @DOCUMENTATION_FALSE@
+DOCUMENTATION_TRUE = @DOCUMENTATION_TRUE@
+DOXYGEN = @DOXYGEN@
+DOXYGEN_FALSE = @DOXYGEN_FALSE@
+DOXYGEN_TRUE = @DOXYGEN_TRUE@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GTHREAD_CFLAGS = @GTHREAD_CFLAGS@
+GTHREAD_LIBS = @GTHREAD_LIBS@
+GTK2_CFLAGS = @GTK2_CFLAGS@
+GTK2_LIBS = @GTK2_LIBS@
+HAVE_CURL_FALSE = @HAVE_CURL_FALSE@
+HAVE_CURL_TRUE = @HAVE_CURL_TRUE@
+HAVE_GTHREAD_FALSE = @HAVE_GTHREAD_FALSE@
+HAVE_GTHREAD_TRUE = @HAVE_GTHREAD_TRUE@
+HAVE_GTK2_FALSE = @HAVE_GTK2_FALSE@
+HAVE_GTK2_TRUE = @HAVE_GTK2_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MSBITFIELDS = @MSBITFIELDS@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SUB_PROJECTS_FALSE = @SUB_PROJECTS_FALSE@
+SUB_PROJECTS_TRUE = @SUB_PROJECTS_TRUE@
+VERSION = @VERSION@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+SUBDIRS = testmain
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/subprojects/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  src/subprojects/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@set fnord $$MAKEFLAGS; amf=$$2; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	   || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@set fnord $$MAKEFLAGS; amf=$$2; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	   || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || mkdir "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="../$(top_distdir)" \
+	        distdir="../$(distdir)/$$subdir" \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+	clean clean-generic clean-recursive ctags ctags-recursive \
+	distclean distclean-generic distclean-recursive distclean-tags \
+	distdir dvi dvi-am html html-am info info-am install \
+	install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	maintainer-clean-recursive mostlyclean mostlyclean-generic \
+	mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: orxonox/branches/levelloader/src/subprojects/testmain/Makefile.am
===================================================================
--- orxonox/branches/levelloader/src/subprojects/testmain/Makefile.am	(revision 3605)
+++ orxonox/branches/levelloader/src/subprojects/testmain/Makefile.am	(revision 3605)
@@ -0,0 +1,27 @@
+MAINSRCDIR=../..
+AM_CXXFLAGS=-I$(MAINSRCDIR)
+AM_CXXFLAGS+=-I$(MAINSRCDIR)/world_entities
+AM_CXXFLAGS+=-I$(MAINSRCDIR)/story_entities
+AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib
+AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/data
+AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/gaphics
+AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/graphics/importer
+AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/lang
+AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/util
+AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/math
+AM_CXXFLAGS+=-I$(MAINSRCDIR)/defs
+AM_CXXFLAGS+=-I$(MAINSRCDIR)/font
+AM_CXXFLAGS+=-I$(MAINSRCDIR)/network
+AM_CXXFLAGS+=-I$(MAINSRCDIR)/glmenu
+AM_CXXFLAGS+=-I$(MAINSRCDIR)/ai
+
+
+AM_LDFLAGS=$(MWINDOWS)
+
+#"-O3 -pedantic -fPIC -ffast-math -I/usr/X11R6/include"
+
+
+bin_PROGRAMS=testmain
+testmain_SOURCES= testmain.cc
+
+noinst_HEADERS= 
Index: orxonox/branches/levelloader/src/subprojects/testmain/Makefile.in
===================================================================
--- orxonox/branches/levelloader/src/subprojects/testmain/Makefile.in	(revision 3605)
+++ orxonox/branches/levelloader/src/subprojects/testmain/Makefile.in	(revision 3605)
@@ -0,0 +1,439 @@
+# Makefile.in generated by automake 1.8.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+SOURCES = $(testmain_SOURCES)
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+host_triplet = @host@
+bin_PROGRAMS = testmain$(EXEEXT)
+subdir = src/subprojects/testmain
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am_testmain_OBJECTS = testmain.$(OBJEXT)
+testmain_OBJECTS = $(am_testmain_OBJECTS)
+testmain_LDADD = $(LDADD)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/testmain.Po
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
+	-o $@
+SOURCES = $(testmain_SOURCES)
+DIST_SOURCES = $(testmain_SOURCES)
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CURL_CFLAGS = @CURL_CFLAGS@
+CURL_LIBS = @CURL_LIBS@
+CXX = @CXX@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEBUG = @DEBUG@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOCUMENTATION_FALSE = @DOCUMENTATION_FALSE@
+DOCUMENTATION_TRUE = @DOCUMENTATION_TRUE@
+DOXYGEN = @DOXYGEN@
+DOXYGEN_FALSE = @DOXYGEN_FALSE@
+DOXYGEN_TRUE = @DOXYGEN_TRUE@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GTHREAD_CFLAGS = @GTHREAD_CFLAGS@
+GTHREAD_LIBS = @GTHREAD_LIBS@
+GTK2_CFLAGS = @GTK2_CFLAGS@
+GTK2_LIBS = @GTK2_LIBS@
+HAVE_CURL_FALSE = @HAVE_CURL_FALSE@
+HAVE_CURL_TRUE = @HAVE_CURL_TRUE@
+HAVE_GTHREAD_FALSE = @HAVE_GTHREAD_FALSE@
+HAVE_GTHREAD_TRUE = @HAVE_GTHREAD_TRUE@
+HAVE_GTK2_FALSE = @HAVE_GTK2_FALSE@
+HAVE_GTK2_TRUE = @HAVE_GTK2_TRUE@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MSBITFIELDS = @MSBITFIELDS@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SUB_PROJECTS_FALSE = @SUB_PROJECTS_FALSE@
+SUB_PROJECTS_TRUE = @SUB_PROJECTS_TRUE@
+VERSION = @VERSION@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+MAINSRCDIR = ../..
+AM_CXXFLAGS = -I$(MAINSRCDIR) -I$(MAINSRCDIR)/world_entities -I$(MAINSRCDIR)/story_entities -I$(MAINSRCDIR)/lib -I$(MAINSRCDIR)/lib/data -I$(MAINSRCDIR)/lib/gaphics -I$(MAINSRCDIR)/lib/graphics/importer -I$(MAINSRCDIR)/lib/lang -I$(MAINSRCDIR)/lib/util -I$(MAINSRCDIR)/lib/math -I$(MAINSRCDIR)/defs -I$(MAINSRCDIR)/font -I$(MAINSRCDIR)/network -I$(MAINSRCDIR)/glmenu -I$(MAINSRCDIR)/ai
+AM_LDFLAGS = $(MWINDOWS)
+testmain_SOURCES = testmain.cc
+noinst_HEADERS = 
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cc .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/subprojects/testmain/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  src/subprojects/testmain/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-binPROGRAMS: $(bin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-binPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(bindir)/$$f"; \
+	done
+
+clean-binPROGRAMS:
+	-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+testmain$(EXEEXT): $(testmain_OBJECTS) $(testmain_DEPENDENCIES) 
+	@rm -f testmain$(EXEEXT)
+	$(CXXLINK) $(testmain_LDFLAGS) $(testmain_OBJECTS) $(testmain_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testmain.Po@am__quote@
+
+.cc.o:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cc.obj:
+@am__fastdepCXX_TRUE@	if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkdir_p) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS) $(HEADERS)
+installdirs:
+	for dir in "$(DESTDIR)$(bindir)"; do \
+	  test -z "$$dir" || $(mkdir_p) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+	clean-generic ctags distclean distclean-compile \
+	distclean-generic distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-binPROGRAMS \
+	install-data install-data-am install-exec install-exec-am \
+	install-info install-info-am install-man install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-binPROGRAMS uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Index: orxonox/branches/levelloader/src/subprojects/testmain/testmain.cc
===================================================================
--- orxonox/branches/levelloader/src/subprojects/testmain/testmain.cc	(revision 3605)
+++ orxonox/branches/levelloader/src/subprojects/testmain/testmain.cc	(revision 3605)
@@ -0,0 +1,4 @@
+int main(int argc, char** argv)
+{
+
+}
Index: orxonox/branches/levelloader/src/track_manager.cc
===================================================================
--- orxonox/branches/levelloader/src/track_manager.cc	(revision 3604)
+++ orxonox/branches/levelloader/src/track_manager.cc	(revision 3605)
@@ -14,4 +14,5 @@
 */
 
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_TRACK_MANAGER
 
 #include "track_manager.h"
@@ -19,4 +20,6 @@
 #include "p_node.h"
 #include "substring.h"
+
+#include "track_node.h"
 
 #include <stdarg.h>
@@ -35,11 +38,10 @@
   this->isJoined = false;
   this->mainJoin = false;
-  this->cond; //!< todo think!!
   this->ID = -1;
-  this->startingTime = 0; //!< \todo eventually set this to the max time of TrackManager.
-  this->duration = 1;
+  this->startingTime = 0;
+  this->duration = TMAN_DEFAULT_DURATION;
   this->endTime = 1;
   this->jumpTime = 0;
-  this->curveType = BEZIERCURVE;
+  this->width = TMAN_DEFAULT_WIDTH;
   this->nodeCount = 0;
   this->childCount = 0;
@@ -47,4 +49,8 @@
   this->curve = NULL;
   this->children = NULL;
+
+  this->history = NULL;
+
+  this->condFunc = &TrackElement::random;
 }
 
@@ -61,6 +67,10 @@
   if ((!this->isJoined &&this->childCount > 0) || (this->isJoined && this->mainJoin))
     {
-      for (int i=0; i < this->childCount; i++)
-	delete this->children[i];
+      TrackElement* enumElem = children->enumerate();
+      while (enumElem)
+	{
+	  delete enumElem;
+	  enumElem = children->nextElement();
+	}
       delete this->children;
     }
@@ -81,23 +91,16 @@
   // search on.
   if (this->childCount > 0)
-    for (int i=0; i < this->childCount; i++)
-      {
-	TrackElement* tmpElem;
-	if ((tmpElem = this->children[i]->findByID(trackID)))
-	  return tmpElem;
-      }
-  else return NULL;
-}
-
-/**
-   \brief Sets the name of this TrackElement
-   \param trackName The new name for this element
-*/
-void TrackElement::setName(const char* trackName)
-{
-	if( this->name != NULL) delete this->name;
-	
-	this->name = new char[strlen(trackName) + 1];
-	strcpy( this->name, trackName);
+    {
+      TrackElement* enumElem = this->children->enumerate();
+      TrackElement* tmpElem;
+      while (enumElem)
+	{
+	  if ((tmpElem = enumElem->findByID(trackID)))
+	    return tmpElem;
+	  enumElem = this->children->nextElement();
+	}
+    }
+  else 
+    return NULL;
 }
 
@@ -116,19 +119,219 @@
   // search on.
   if (this->childCount > 0)
-    for (int i=0; i < this->childCount; i++)
-      {
-	TrackElement* tmpElem;
-	if ((tmpElem = this->children[i]->findByName(trackName)))
-	  return tmpElem;
-      }
-  else return NULL;
-}
-
-
-
-
-/////////////////////////////////////
-///// TRACKMANAGER //////////////////
-/////////////////////////////////////
+    {
+    
+      TrackElement* enumElem = this->children->enumerate();
+      TrackElement* tmpElem;
+      while (enumElem)
+	{
+	  if ((tmpElem = enumElem->findByName(trackName)))
+	    return tmpElem;
+	  enumElem = this->children->nextElement();
+	}
+    }
+  else 
+    return NULL;
+}
+
+/**
+   \brief checks if there are any BackLoops in the Track
+   \param trackElem the trackElement to check about
+   it simply does this by looking if the current trackElem is found again somewhere else in the Track
+*/
+bool TrackElement::backLoopCheck(TrackElement* trackElem)
+{
+  if (this->childCount == 0)
+    return true;
+  else
+    {
+      TrackElement* enumElem = this->children->enumerate();
+      while (enumElem)
+	{
+	  if(!enumElem->backLoopCheck(trackElem))
+	    return false;
+	  enumElem = this->children->nextElement();
+	}
+      
+      return true;
+    }
+}
+
+/**
+   \param childNumber which child to return
+   \returns the n-the children (starting at 0)
+*/
+TrackElement* TrackElement::getChild(int childCount)
+{
+  if (this->childCount == 0)
+    return NULL;
+  if (childCount > this->childCount)
+    childCount = this->childCount;
+  
+  TrackElement* enumElem = this->children->enumerate();
+  for (int i = 0; i < childCount; i++)
+    enumElem = this->children->nextElement();
+  return enumElem;
+}
+
+/**
+   \param name the Name to set.
+*/
+void TrackElement::setName(const char* name)
+{
+  //  delete the old name
+  if (this->name)
+    delete []this->name;
+  // if a name was given already.
+  if (name)
+    {
+      this->name = new char[strlen(name)+1];
+      strcpy(this->name, name);
+    }
+  else 
+    this->name = NULL;
+}
+
+/**
+   \returns The name of this TrackElement
+*/
+char* TrackElement::getName(void) const
+{
+  return this->name;
+}
+
+/**
+   \brief prints out debug information about this TrackElement
+*/
+void TrackElement::debug(void)
+{
+  PRINT(0)("--== TrackElement:%i ==--", this->ID);
+  if(this->getName())
+    PRINT(0)("Name: %s::", this->getName());
+  if(this->isFresh)
+    PRINT(0)("  -- has not jet eddited in any way --\n");
+  PRINT(0)("\n   TimeTable: startingTime=%f; endTime=%f; duration=%f; jumpTime=%f\n", this->startingTime, this->endTime, this->duration, this->jumpTime);
+  PRINT(0)("   consists of %d Points\n", this->nodeCount);
+  if (this->childCount == 0)
+    PRINT(0)("   has no child\n");
+  else if (this->childCount == 1)
+    PRINT(0)("   has 1 child: =%d=\n", this->getChild(0)->ID);
+  else if (this->childCount > 1)
+    {
+      PRINT(0)("   has %d children: ", this->childCount);
+      TrackElement* enumElem = this->children->enumerate();
+      while (enumElem)
+	{
+	  PRINT(0)("=%d= ", enumElem->ID);
+	  enumElem = this->children->nextElement();
+	}
+      PRINT(0)("\n");
+    }
+  
+  if(this->isHotPoint)
+    PRINT(0)("   is a special Point:\n");
+  if(this->isSavePoint)
+    PRINT(0)("    is a SavePoint\n");
+  if(this->isFork)
+    {
+      PRINT(0)("    is A Fork with with %d children.\n", this->childCount);
+    }
+  if(this->isJoined)
+    PRINT(0)("   is Joined at the End\n");
+  
+  if(!this->backLoopCheck(this)) /* this should not happen */
+    PRINT(2)(" THERE IS A BACKLOOP TO THIS ELEMENT\n");
+}
+
+/**
+   \brief CONDITION that chooses the first child for the decision (static)
+   \param nothing Nothing in this function
+   \returns the chosen child
+*/
+int TrackElement::lowest(void* nothing)
+{
+  return 0;
+}
+
+/**
+   \brief CONDITION that chooses the last child for the decision (static)
+   \param nothing Nothing in this function
+   \returns the chosen child
+*/
+int TrackElement::highest(void* nothing)
+{ 
+  return this->childCount-1;
+}
+
+/**
+   \brief CONDITION that chooses a random child for the decision (static)
+   \param nothing Nothing in this function
+   \returns the chosen child
+*/
+int TrackElement::random(void* nothing)
+{
+  int i = (int)floor ((float)rand()/(float)RAND_MAX * (float)this->childCount);
+  if (i >= this->childCount)
+    return this->childCount-1;
+  else 
+    return i;
+}
+
+/**
+   \brief CONDITION that chooses child 0, if the node(probably Player)
+   is left of its parent (z<0)) and 1/right otherwise.
+   \param node The node to act upon.
+   \returns the chosen child
+*/
+int TrackElement::leftRight(void* node)
+{
+  PNode* tmpNode = (PNode*)node;
+
+  if (tmpNode->getRelCoor().z < 0)
+    return 0;
+  else 
+    return 1;
+}
+
+
+/**
+   \brief CONDITION that chooses the child, that has the nearest distance to the node (probably player).
+   \param node The node to act upon.
+   \returns the chosen child
+
+   This is rather dangerous, because one must carefully set the points on the curve.
+   The best Way is to set the nodes as wide away of each other as possible,
+   but take into consideration, that if the nodes are to far from a center node, the center will be chosen.
+   (play with this!!).
+*/
+int TrackElement::nearest(void* node)
+{
+  PNode* tmpNode = (PNode*)node;
+
+  Vector nodeRelCoord = tmpNode->getRelCoor();
+  float minDist = 100000000;
+  int childNumber = 0;
+  int i = 0;
+
+  TrackElement* enumElem = this->children->enumerate();
+  while (enumElem)
+    {
+      float dist = (nodeRelCoord - enumElem->curve->getNode(4)).len();
+      if (dist < minDist)
+	{
+	  minDist = dist;
+	  childNumber = i;
+	}
+      i++;
+      enumElem = this->children->nextElement();
+    }
+
+  PRINTF(4)("PathDecision with nearest algorithm: %d\n", childNumber);
+  return childNumber;
+}
+
+
+////////////////////////
+///// TRACKMANAGER /////
+////////////////////////
 /**
    \brief standard constructor
@@ -137,5 +340,7 @@
 TrackManager::TrackManager(void)
 {
-  this->setClassName ("TrackManager");
+  this->setClassName("TrackManager");
+  
+  TrackManager::singletonRef = this;
 
   PRINTF(3)("Initializing the TrackManager\n");
@@ -146,5 +351,5 @@
   this->maxTime = 0;
   this->trackElemCount = 1;
-  this->bindSlave = NULL;
+  this->setBindSlave(this->trackNode = new TrackNode());
 }
 
@@ -152,5 +357,4 @@
 /**
    \brief standard destructor
-
 */
 TrackManager::~TrackManager(void)
@@ -158,12 +362,13 @@
   PRINTF(3)("Destruct TrackManager\n");
 
-  PRINTF(3)("Deleting all the TrackElements\n");
+  PRINTF(4)("Deleting all the TrackElements\n");
   delete this->firstTrackElem;
   // delete this->name;
 
   // we do not have a TrackManager anymore
-  singletonRef = NULL;
-}
-
+  TrackManager::singletonRef = NULL;
+}
+
+//! Singleton Reference to TrackManager
 TrackManager* TrackManager::singletonRef = NULL;
 
@@ -175,8 +380,7 @@
 TrackManager* TrackManager::getInstance(void) 
 {
-  if (singletonRef)
-    return singletonRef;
-  else
-    return singletonRef = new TrackManager();
+  if (!TrackManager::singletonRef)
+    TrackManager::singletonRef = new TrackManager();
+  return TrackManager::singletonRef;
 }
 
@@ -189,22 +393,24 @@
   this->currentTrackElem->childCount = childCount;
   this->currentTrackElem->mainJoin = true;
-  this->currentTrackElem->children = new TrackElement*[childCount];
-  for (int i=0; i<childCount; i++)
-    {
-	    
-      this->currentTrackElem->children[i] = new TrackElement();
-      this->currentTrackElem->children[i]->ID = ++trackElemCount;
-      this->currentTrackElem->children[i]->startingTime = this->currentTrackElem->endTime + this->currentTrackElem->jumpTime;
-      this->addPoint(this->currentTrackElem->curve->getNode(this->currentTrackElem->curve->getNodeCount()), this->currentTrackElem->children[i]);
-     	if( names != NULL)
+  this->currentTrackElem->children =  new tList<TrackElement>();
+  for (int i = 0; i < childCount; i++)
+    {
+      TrackElement* newElem = new TrackElement();
+      this->currentTrackElem->children->add(newElem);
+      newElem->ID = ++trackElemCount;
+      newElem->startingTime = this->currentTrackElem->endTime + this->currentTrackElem->jumpTime;
+      this->addPoint(this->currentTrackElem->curve->getNode(this->currentTrackElem->curve->getNodeCount()), this->currentTrackElem->getChild(i));
+      if( names != NULL)
     	{
-    		// todo check for duplicate track names to avoid confusion
-	    	/*if( this->findTrackElementByName( names->getString(i)) != NULL)
-	    		PRINTF0("Track name '%s' already taken", names->getString(i));
-	    	else*/
-	    		this->currentTrackElem->children[i]->setName( names->getString(i)); 
-	    }
+	  // todo check for duplicate track names to avoid confusion
+	  /*if( this->findTrackElementByName( names->getString(i)) != NULL)
+	    PRINTF0("Track name '%s' already taken", names->getString(i));
+	    else*/
+	  this->currentTrackElem->getChild(i)->setName(names->getString(i)); 
+	}
 	    
    }
+  if (childCount == 1)
+    this->currentTrackElem->getChild(0)->setName(this->currentTrackElem->getName());
 }
 
@@ -240,6 +446,6 @@
     this->currentTrackElem = tmpElem;
   else
-    printf("TrackElement not Found, leaving unchanged\n");
-  printf("now Working on %d\n", this->currentTrackElem->ID);
+    PRINTF(2)("TrackElement not Found, leaving unchanged\n");
+  PRINTF(4)("now Working on %d\n", this->currentTrackElem->ID);
 
 }
@@ -247,5 +453,6 @@
 /**
    \brief Sets the Type of the Curve
-   \brief curveType The Type to set
+   \param curveType The Type to set
+   \param trackElem the TrackElement that should get a new Curve.
 */
 void TrackManager::setCurveType(CurveType curveType, TrackElement* trackElem)
@@ -256,5 +463,5 @@
       return;
     }
-  trackElem->curveType = curveType;
+  this->curveType = curveType;
   switch (curveType)
     {
@@ -262,7 +469,5 @@
       trackElem->curve = new BezierCurve();
       break;
-    case UPOINTCURVE:
-      trackElem->curve = new UPointCurve();
-      break;
+
     }
 }
@@ -297,5 +502,5 @@
   if (trackElem->isFresh)
     {
-      this->setCurveType(BEZIERCURVE, trackElem);
+      this->setCurveType(TMAN_DEFAULT_CURVETYPE, trackElem);
       trackElem->isFresh = false;
     }
@@ -311,5 +516,5 @@
 int TrackManager::addHotPoint(Vector newPoint)
 {
-  printf("setting up a HotPoint\n");
+  PRINTF(4)("setting up a HotPoint\n");
   if (this->currentTrackElem->isFresh)
     {
@@ -322,5 +527,5 @@
   this->currentTrackElem->nodeCount++;
   this->initChildren(1);
-  this->currentTrackElem = this->currentTrackElem->children[0];
+  this->currentTrackElem = this->currentTrackElem->getChild(0);
 }
 
@@ -334,12 +539,15 @@
 int TrackManager::setSavePoint(void)
 {
-  printf("setting up a SavePoint.\n");
+  PRINTF(4)("setting up a SavePoint.\n");
   if (this->currentTrackElem->isFork || this->currentTrackElem->isSavePoint)
-    return this->currentTrackElem->children[1]->ID;
+    {
+      PRINTF(2)("%d is already finished \n", currentTrackElem->ID);
+      return this->currentTrackElem->getChild(0)->ID;
+    }
   this->currentTrackElem->isSavePoint = true;
   this->currentTrackElem->isHotPoint = true;
 
   this->initChildren(1);
-  this->currentTrackElem = this->currentTrackElem->children[0];
+  this->currentTrackElem = this->currentTrackElem->getChild(0);
 }
 
@@ -377,5 +585,5 @@
 void TrackManager::forkV(unsigned int count, int* trackIDs, SubString* names)
 {
-  printf("Forking with %d children\n", count);
+  PRINTF(4)("Forking with %d children\n", count);
   if (this->currentTrackElem->isSavePoint)
   {
@@ -392,11 +600,51 @@
 /**
    \brief decides under what condition a certain Path will be chosen.
+   \param cond the CONDITION of the decision
+   \param subject the Subject that will be decided upon with CONDITION cond.
+*/
+void TrackManager::condition(CONDITION cond, void* subject)
+{
+  this->condition(this->currentTrackElem->ID, cond, subject);
+}
+/**
+   \brief decides under what condition a certain Path will be chosen.
    \param groupID the ID on which to choose the preceding move
-   \param cond \todo think about this
-*/
-void TrackManager::condition(unsigned int groupID, PathCondition cond)
-{
-  
-}
+   \param cond the CONDITION of the decision
+   \param subject the Subject that will be decided upon with CONDITION cond.
+*/
+void TrackManager::condition(unsigned int groupID, CONDITION cond, void* subject)
+{
+  TrackElement* tmpElem = this->findTrackElementByID(groupID);
+  if (!tmpElem->isFork)
+    {
+      PRINTF(2)("%d is not a Fork, and no condition can be set in this case\n", tmpElem->ID);
+      return;
+    }
+  else
+    {
+      switch (cond)
+	{
+	case LOWEST:
+	  tmpElem->condFunc = &TrackElement::lowest;
+	  break;
+	case HIGHEST:
+	  tmpElem->condFunc = &TrackElement::highest;
+	  break;
+	case RANDOM: 
+	  tmpElem->condFunc = &TrackElement::random;
+	  break;
+	case LEFTRIGHT:
+	  tmpElem->condFunc = &TrackElement::leftRight;
+	  break;
+	case NEAREST:
+	  tmpElem->condFunc = &TrackElement::nearest;
+	  break;
+	case ENEMYKILLED:
+	  break;
+	}
+      tmpElem->subject=subject;
+    }
+}
+
 
 /**
@@ -430,5 +678,10 @@
 void TrackManager::joinV(unsigned int count, int* trackIDs)
 {
-  printf("Joining %d tracks and merging to Track %d\n", count, trackIDs[0]);
+  PRINTF(3)("Joining %d tracks and merging to Track %d\n", count, trackIDs[0]);
+
+  // checking if there is a back-loop-connection and ERROR if it is.
+  TrackElement* tmpTrackElem = this->findTrackElementByID(trackIDs[0]);
+  if (!tmpTrackElem->backLoopCheck(tmpTrackElem))
+    PRINTF(2)("Backloop connection detected at joining trackElements\n");
 
   // chanching work-on to temporary value. going back at the end.
@@ -480,11 +733,15 @@
     }
   if(firstJoint->childCount > 0)
-    for(int i = 0; i < firstJoint->childCount; i++)
-      {
-	printf("Setting startingTime of %d to %f.\n", firstJoint->children[i]->ID, tmpLatestTime);
-	firstJoint->children[i]->startingTime = tmpLatestTime;
-	firstJoint->children[i]->endTime = tmpLatestTime+firstJoint->children[i]->duration;
-      }	
-
+    {
+      TrackElement* enumElem = firstJoint->children->enumerate();
+      while (enumElem)
+	{
+	  PRINTF(4)("Setting startingTime of %d to %f.\n", enumElem->ID, tmpLatestTime);
+	  enumElem->startingTime = tmpLatestTime;
+	  enumElem->endTime = tmpLatestTime + enumElem->duration;
+	  
+	  enumElem = firstJoint->children->nextElement();
+	}
+    }
   // returning to the TrackElement we were working on.
   this->workOn(tmpCurrentWorkingID);
@@ -501,28 +758,35 @@
     {
       TrackElement* tmpElem = findTrackElementByID(i);
-      if (tmpElem->childCount>0 && tmpElem->mainJoin)
-	{
-	  for (int j = 0; j < tmpElem->childCount; j++)
+      if (tmpElem->childCount > 0 && tmpElem->mainJoin)
+	{
+
+	  TrackElement* enumElem = tmpElem->children->enumerate();
+	  while (enumElem)
 	    {
 	      
 	      // c1-continuity
-	      tmpElem->children[j]->curve->addNode(tmpElem->children[j]->curve->getNode(0) +
-						   ((tmpElem->children[j]->curve->getNode(0) - 
+	      enumElem->curve->addNode(enumElem->curve->getNode(0) +
+						   ((enumElem->curve->getNode(0) - 
 						    tmpElem->curve->getNode(tmpElem->curve->getNodeCount()-1))
 						    ),2);
-	      tmpElem->children[j]->nodeCount++;
+	      enumElem->nodeCount++;
 	      // c2-continuity
-	      tmpElem->children[j]->curve->addNode((tmpElem->curve->getNode(tmpElem->curve->getNodeCount())-
+	      enumElem->curve->addNode((tmpElem->curve->getNode(tmpElem->curve->getNodeCount())-
 						    tmpElem->curve->getNode(tmpElem->curve->getNodeCount()-1)) * 4 +
 						   tmpElem->curve->getNode(tmpElem->curve->getNodeCount()-2), 3);
-	      tmpElem->children[j]->nodeCount++;						    
-	      printf("accelerations: %d-in: count: %d, %f, %f, %f\n                  %d-out: count: %d %f, %f, %f\n",
+	      enumElem->nodeCount++;						    
+	      PRINTF(5)("accelerations: %d-in: count: %d, %f, %f, %f\n                  %d-out: count: %d %f, %f, %f\n",
 		     tmpElem->ID, tmpElem->nodeCount,
 		     tmpElem->curve->calcAcc(0.999).x, tmpElem->curve->calcAcc(0.999).y, tmpElem->curve->calcAcc(0.999).z,
-		     tmpElem->children[j]->ID, tmpElem->children[j]->nodeCount,
-		     tmpElem->children[j]->curve->calcAcc(0).x, tmpElem->children[j]->curve->calcAcc(0).y, tmpElem->children[j]->curve->calcAcc(0).z);
+		     enumElem->ID, enumElem->nodeCount,
+		     enumElem->curve->calcAcc(0).x, enumElem->curve->calcAcc(0).y, enumElem->curve->calcAcc(0).z);
+	      
+	      enumElem = tmpElem->children->nextElement();
 	    }
 	}
     }
+  for (int i = 1; i <=trackElemCount;i++)
+    if (this->findTrackElementByID(i)->endTime > this->maxTime)
+      this->maxTime = findTrackElementByID(i)->endTime; // very bad implemented :/
 }
 
@@ -536,5 +800,4 @@
 Vector TrackManager::calcPos() const
 {
-  //  PRINTF(0)("TrackElement:%d, localTime: %f\n",this->currentTrackElem->ID, this->localTime);
   return this->currentTrackElem->curve->calcPos((this->localTime-this->currentTrackElem->startingTime)/this->currentTrackElem->duration);
 }
@@ -550,4 +813,12 @@
 
 /**
+   \returns the current Width of the track
+*/
+float TrackManager::getWidth(void) const
+{
+  return this->currentTrackElem->width;
+}
+
+/**
    \brief Advances the local-time of the Track around dt
    \param dt The time about which to advance.
@@ -558,14 +829,18 @@
 {
   dt /= 1000;
-  printf("CurrentTrackID: %d, LocalTime is: %f, timestep is: %f\n", this->currentTrackElem->ID, this->localTime, dt);
+  PRINTF(4)("CurrentTrackID: %d, LocalTime is: %f, timestep is: %f\n", this->currentTrackElem->ID, this->localTime, dt);
   if (this->localTime <= this->firstTrackElem->duration)
     this->jumpTo(this->localTime);
-  this->localTime += dt;
+  if (this->localTime <= this->maxTime)
+    this->localTime += dt;
   if (this->localTime > this->currentTrackElem->endTime
       && this->currentTrackElem->children)
     {
-      if (this->currentTrackElem->jumpTime > 0) 
+      if (this->currentTrackElem->jumpTime != 0.0)
 	this->jumpTo(this->localTime + this->currentTrackElem->jumpTime);
-      this->currentTrackElem = this->currentTrackElem->children[0];
+      // jump to the next TrackElement and also set the history of the new Element to the old one.
+      TrackElement* tmpHistoryElem = this->currentTrackElem;
+      this->currentTrackElem = this->currentTrackElem->getChild(this->choosePath(this->currentTrackElem));
+      this->currentTrackElem->history = tmpHistoryElem;
     }
   if (this->bindSlave)
@@ -573,4 +848,9 @@
       Vector tmp = this->calcPos();
       Quaternion quat = Quaternion(this->calcDir(), Vector(this->currentTrackElem->curve->calcAcc((localTime-this->currentTrackElem->startingTime)/this->currentTrackElem->duration).x,1,this->currentTrackElem->curve->calcAcc((localTime-this->currentTrackElem->startingTime)/this->currentTrackElem->duration).z)); 
+
+      Vector v(0.0, 1.0, 0.0);
+      Quaternion q(-PI/2, v);
+      quat = quat * q;
+
       this->bindSlave->setAbsCoor(&tmp);
       this->bindSlave->setAbsDir(&quat);
@@ -594,10 +874,10 @@
 /**
    \brief a Function that decides which Path we should follow.
-   \param graphID The Path to choose.
+   \param trackElem The Path to choose.
    
 */
-void TrackManager::choosePath(int graphID)
-{
-
+int TrackManager::choosePath(TrackElement* trackElem)
+{
+  return (trackElem->*(trackElem->condFunc))(trackElem->subject);
 }
 
@@ -608,8 +888,14 @@
 void TrackManager::setBindSlave(PNode* bindSlave)
 {
-  if (!this->bindSlave)
-    this->bindSlave = bindSlave;
-}
-
+  this->bindSlave = bindSlave;
+}
+
+/**
+   \returns the main TrackNode
+*/
+PNode* TrackManager::getTrackNode(void)
+{
+  return this->trackNode;
+}
 
 // DEBUG //
@@ -646,8 +932,10 @@
 void TrackManager::debug(unsigned int level) const
 {
-  printf("::CLASS TRACKMANAGER::debug information::\n");
-  //  printf("Status is: %
-  printf(" Consists of %d elements\n", this->trackElemCount);
-  printf(" localTime is: %f\n", this->localTime);
+  PRINT(0)("=========================================\n");
+  PRINT(0)("= CLASS TRACKMANAGER::debug information =\n");
+  PRINT(0)("=========================================\n");
+  //  PRINT(0)("Status is: %
+  PRINT(0)(" Consists of %d elements\n", this->trackElemCount);
+  PRINT(0)(" localTime is: %f\n", this->localTime);
   if (level >= 2)
     {
@@ -655,35 +943,8 @@
 	{
 	  TrackElement* tmpElem = this->findTrackElementByID(i);
-	  printf("  ::TrackElement:%i::", tmpElem->ID);
-	  if(tmpElem->name)
-	    printf("name:%s::", tmpElem->name);
-	  if(tmpElem->isFresh)
-	    printf("   has not jet eddited in any way\n");
-	  printf("\n   TimeTable: startingTime=%f; endTime=%f; duration=%f; jumpTime=%f\n", tmpElem->startingTime, tmpElem->endTime, tmpElem->duration, tmpElem->jumpTime);
-	  printf("   consists of %d Points\n", tmpElem->nodeCount);
-	  if (tmpElem->childCount == 0)
-	    printf("   has no child\n");	    
-	  else if (tmpElem->childCount == 1)
-	    printf("   has 1 child: ==%d==\n", tmpElem->children[0]->ID);
-	  else if (tmpElem->childCount > 1)
-	    {
-	      printf("   has %d children: ", tmpElem->childCount);
-	      for(int i = 0; i < tmpElem->childCount; i++)
-		printf("=%d= ", tmpElem->children[i]->ID);
-	      printf("\n");
-	    }
-
-	  if(tmpElem->isHotPoint)
-	    printf("   is a special Point:\n");
-	  if(tmpElem->isSavePoint)
-	    printf("    is a SavePoint\n");
-	  if(tmpElem->isFork)
-	    {
-	      printf("    is A Fork with with %d children.\n", tmpElem->childCount);
-	    }
-	  if(tmpElem->isJoined)
-	    printf("   is Joined at the End\n");
-	}
-    }
+	  tmpElem->debug();
+	}
+    }
+  PRINT(0)("-----------------------------------------\n");
 }
 
Index: orxonox/branches/levelloader/src/track_manager.h
===================================================================
--- orxonox/branches/levelloader/src/track_manager.h	(revision 3604)
+++ orxonox/branches/levelloader/src/track_manager.h	(revision 3605)
@@ -19,10 +19,10 @@
 class TrackNamer;
 
-//! condition for choosing a certain Path. \todo implement a useful way.
-struct PathCondition
-{
-  
-};
-  
+// Static Definitions
+
+//! The Default Curve-Type to set for the whole path (if not chosen otherwise).
+#define TMAN_DEFAULT_CURVETYPE BEZIERCURVE
+#define TMAN_DEFAULT_DURATION 10
+#define TMAN_DEFAULT_WIDTH    10
 
 //! A Graph-Element, that holds the curve-structure of a Level.
@@ -38,7 +38,14 @@
 
   TrackElement* findByID(unsigned int trackID);
+
   TrackElement* findByName(const char* trackName);
-	void setName( const char* trackName);
 	
+  bool backLoopCheck(TrackElement* trackElem);
+
+  TrackElement* getChild(int childNumber);
+  void setName(const char* name);
+  char* getName(void) const;
+
+  // atributes
   bool isFresh;              //!< If no Points where added until now
   bool isHotPoint;           //!< If the first node is a specialPoint;
@@ -47,5 +54,4 @@
   bool isJoined;             //!< If the End of the Curve is joined.
   bool mainJoin;             //!< If the End of the Curve is joined, and this is the one Curve the others join to.
-  PathCondition cond;        //!< The Split Condition;
   int ID;                    //!< The ID of this TrackElement
   float startingTime;        //!< The time at which this Track begins.
@@ -53,13 +59,35 @@
   float endTime;             //!< The time at which this Track ends.
   float jumpTime;            //!< The Time this Track has to jump to its preceding Track (only >0 if Track isJoined==true)
-  CurveType curveType;       //!< The CurveType this will have.
+  float width;               //!< Th width of the Path. This tells the Player(s), how far he(they) can go to the left/right.
   int nodeCount;             //!< The count of points this TrackElement has.
-  char* name;                //!< A name for the Trac.
   Curve* curve;              //!< The Curve of this TrackElement
   int childCount;            //!< The number of Children This TrackElement has.
-  TrackElement** children;   //!< A TrackElement can have a Tree of following TrackElements.
+  tList<TrackElement>* children;   //!< A TrackElement can have a Tree of following TrackElements.
+
+
+  // runtime
+  TrackElement* history;     //!< a pointer to the last TrackElement we were on. This is if you want to walk the path backwards again.
+
+  void debug(void);
+
+  // CONDITION FUNCTIONS and STUFF
+  void* subject;             //!< The Subject the Condition should act upon.
+  int (TrackElement::*condFunc)(void*); //!< Pointer to the condition function
+
+  int lowest(void* nothing);
+  int highest(void* nothing);
+  int random(void* nothing);
+
+  int leftRight(void* node);
+  int nearest(void* node);
+  // todo  int enemyKilled(void* entity);
+
+ private:
+  char* name;                //!< A name for the Trac.
+ 
 };
 
-
+//! the Condition to choose between the different ways of the game.
+enum CONDITION {LOWEST, HIGHEST, RANDOM, LEFTRIGHT, NEAREST, ENEMYKILLED};
 
 //! The TrackManager handles the flow of the Players through the game.
@@ -103,11 +131,14 @@
   TrackManager(void);
 
-  static TrackManager* singletonRef;  //!< There may only be one TrackManager existing.
+  static TrackManager* singletonRef;  //!< There may only be one TrackManager.
+
   TrackElement* firstTrackElem;       //!< The first TrackElement that exists.
   TrackElement* currentTrackElem;     //!< The TrackElement we are working on.
+  CurveType curveType;                //!< The CurveType the entire TrackSystem will have.
   float localTime;                    //!< The time that has been passed since the traveling the Track.
   float maxTime;                      //!< The maximal time the track has.
   int trackElemCount;                 //!< The count of TrackElements that exist.
-  PNode* bindSlave;
+  PNode* bindSlave;                   //!< The node that is slave to the TrackManager. This node will be moved while update the TrackManager, and must NOT move itself.
+  PNode* trackNode;                   //!< The main TrackNode of this Track.
   
   void initChildren(unsigned int childCount, SubString* names = NULL);
@@ -117,10 +148,12 @@
   
  public:
-  ~TrackManager(void);
+  virtual ~TrackManager(void);
+
   static TrackManager* getInstance(void);
 
   // Methods to change the Path (initialisation)
   void workOn(unsigned int trackID);
-  inline void setCurveType(CurveType curveType) { this->setCurveType (curveType, this->currentTrackElem);}
+  /** \see setCurveType(CurveType curveType, TrackElement* trackElem); \param curveType the type of the Curve */
+  inline void setCurveType(CurveType curveType) { this->setCurveType (curveType, this->currentTrackElem);};
   void setCurveType(CurveType curveType, TrackElement* trackElem);
   void setDuration(float time);
@@ -131,5 +164,6 @@
   void fork(unsigned int count, ...);
   void forkV(unsigned int count, int* trackIDs, SubString* names = NULL);
-  void condition(unsigned int groupID, PathCondition cond); //!< \todo really do this!!
+  void condition(CONDITION cond, void* subject);
+  void condition(unsigned int groupID, CONDITION cond, void* subject);
   void join(unsigned int count, ...);
   void joinV(unsigned int count, int* trackIDs);
@@ -143,11 +177,13 @@
 
   // Methods to calculate the position on the Path (runtime)
-  Vector calcPos(void) const;
-  Vector calcDir(void) const;
+  inline Vector calcPos(void) const;
+  inline Vector calcDir(void) const;
+  float getWidth(void) const;
   void tick(float dt);
   void jumpTo(float time);
-  void choosePath(int graphID);
+  inline int choosePath(TrackElement* trackElem);
 
   void setBindSlave(PNode* bindSlave);
+  PNode* getTrackNode(void);
 
   // DEBUG //
Index: orxonox/branches/levelloader/src/track_node.cc
===================================================================
--- orxonox/branches/levelloader/src/track_node.cc	(revision 3605)
+++ orxonox/branches/levelloader/src/track_node.cc	(revision 3605)
@@ -0,0 +1,60 @@
+
+
+/* 
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   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 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Benjamin Grauer
+   co-programmer: ...
+*/
+
+
+#include "track_node.h"
+
+#include "null_parent.h"
+
+#include "track_manager.h"
+
+using namespace std;
+
+/**
+   \brief standard constructor
+
+   \todo this constructor is not jet implemented - do it
+*/
+TrackNode::TrackNode () 
+{
+  this->setClassName("TrackNode");
+  this->setName("TrackNode"); /* absolete but still used... */
+
+  NullParent::getInstance()->addChild(this);
+  this->trackManager = TrackManager::getInstance();
+  this->setMode(PNODE_ALL);
+}
+
+
+TrackNode::TrackNode (Vector* absCoordinate)
+{
+  this->parent = NullParent::getInstance();
+  this->trackManager = TrackManager::getInstance();
+  this->setMode(PNODE_ALL);
+  this->absCoordinate = *absCoordinate;
+}
+
+
+/**
+   \brief standard deconstructor
+
+   \todo this deconstructor is not jet implemented - do it
+*/
+TrackNode::~TrackNode () 
+{
+
+}
Index: orxonox/branches/levelloader/src/track_node.h
===================================================================
--- orxonox/branches/levelloader/src/track_node.h	(revision 3605)
+++ orxonox/branches/levelloader/src/track_node.h	(revision 3605)
@@ -0,0 +1,32 @@
+/*! 
+    \file track_node.h
+    \brief Definition of the TrackNode are located here
+    
+    the TrackNode is the node, that follows the Track (and the TrackManager) 
+    through the level.
+    Under normal confitions the Plyaer(s) are 
+*/
+
+
+#ifndef _TRACK_NODE_H
+#define _TRACK_NODE_H
+
+#include "p_node.h"
+
+/* FORWARD DEFINITION */
+class TrackManager;
+
+class TrackNode : public PNode {
+
+ public:
+  TrackNode ();
+  TrackNode (Vector* absCoordinate);
+
+  virtual ~TrackNode ();
+
+ private:
+  TrackManager* trackManager;
+
+};
+
+#endif /* _TRACK_NODE_H */
Index: orxonox/branches/levelloader/src/world_entities/character_attributes.cc
===================================================================
--- orxonox/branches/levelloader/src/world_entities/character_attributes.cc	(revision 3605)
+++ orxonox/branches/levelloader/src/world_entities/character_attributes.cc	(revision 3605)
@@ -0,0 +1,378 @@
+
+
+/* 
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   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 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Patrick Boenzli
+   co-programmer: ...
+*/
+
+
+#include "character_attributes.h"
+#include "stdincl.h" 
+
+using namespace std;
+
+
+/**
+   \brief standard constructor
+   \todo this constructor is not jet implemented - do it
+*/
+CharacterAttributes::CharacterAttributes () 
+{
+   this->setClassName ("CharacterAttributes");
+}
+
+
+/**
+   \brief standard deconstructor
+
+*/
+CharacterAttributes::~CharacterAttributes () 
+{
+}
+
+
+/*=====================health=====================*/
+
+/**
+   \brief sets the health of the character
+   \param helath
+ */
+void CharacterAttributes::setHealth(int health)
+{
+  this->health = health;
+}
+
+/**
+   \brief adds health to the charater
+   \param health
+   \returns health that couldnt be added due to healt limit, 0 if everything worked as normal
+ */
+int CharacterAttributes::addHealth(int health)
+{
+  this->health += health;
+  int rest = this->healthMax - this->health;
+  if( rest < 0)
+    {
+      this->health = this->healthMax;
+      return 0;
+    }
+  return rest;
+}
+
+/**
+   \brief remove health due to damager for example
+   \param amount of health
+   \returns false if health is zero -> dead
+ */
+bool CharacterAttributes::substractHealth(int health)
+{
+  this->health -= health;
+  if( this->health < 0)
+    {
+      this->health = 0;
+      return false;
+    }
+  return true;
+}
+
+/**
+   \brief gets the current amount of health
+   \returns health
+ */
+int CharacterAttributes::getHealth()
+{
+  return this->health;
+}
+
+
+/**
+   \brief sets maximum health 
+   \param health
+
+   if healthMax = 0 -> unlimited
+ */
+void CharacterAttributes::setHealthMax(int healthMax)
+{
+  this->healthMax = healthMax;
+}
+
+/**
+   \brief gets health maximium
+   \returns the health maximum
+ */
+int CharacterAttributes::getHealthMax()
+{
+  return this->healthMax;
+}
+
+
+/*======================armor/ shields===================== */
+/**
+   \brief sets the shild strength
+   \param strength
+ */
+void CharacterAttributes::setShieldStrength(int shieldStrength)
+{
+  this->shieldStrength = shieldStrength;
+}
+
+/**
+   \brief adds shield strength
+   \param strength
+   
+   there is currently no limit to shieldstrength
+ */
+void CharacterAttributes::addShieldStrength(int shiledStrength)
+{
+  this->shieldStrength += shieldStrength;
+}
+
+/**
+   \brief substracts shield strength
+   \param strength
+   \returns amount of shield strength below zero after substraction. Magic: Troumble. if everything works allright, it returns 0
+ */
+int CharacterAttributes::substractShieldStrength(int shieldStrength)
+{
+  int rest = this->shieldStrength -= shieldStrength;
+  if( rest < 0)
+    {
+      this->shieldStrength = 0;
+      return -rest;
+    }
+  return 0;
+}
+
+/**
+   \brief gets shield strength
+   \returns the shield strength
+ */
+int CharacterAttributes::getShieldStrength()
+{
+  return this->shieldStrength;
+}
+
+
+/*=====================damage=====================*/
+/**
+   \brief sets the amount of base damage dealt to all aircrafts
+   \param damage
+
+   There can be a difference between arms that hit a ground/air craft. Eg.
+   a tank will react differently to explosives than something in the air
+   (think about physics)
+ */
+void CharacterAttributes::setDamageToAirCraft(int damage)
+{
+  this->damageToAirCraft = damage;
+}
+
+/**
+   \brief gets the amount of base damage
+   \returns base damage to aircrafts
+
+   There can be a difference between arms that hit a ground/air craft. Eg.
+   a tank will react differently to explosives than something in the air
+   (think about physics)
+ */
+int CharacterAttributes::getDamageToAirCraft()
+{
+  return this->damageToAirCraft;
+}
+
+
+/**
+   \brief sets the amount of base damage dealt to all groundcrafts
+   \param damage
+
+   There can be a difference between arms that hit a ground/air craft. Eg.
+   a tank will react differently to explosives than something in the air
+   (think about physics)
+ */
+void CharacterAttributes::setDamageToGroundCraft(int damage)
+{
+  this->damageToGroundCraft = damage;
+}
+
+/**
+   \briefgets the amount of base damage
+   \returns base damage to groundcrafts
+
+   There can be a difference between arms that hit a ground/air craft. Eg.
+   a tank will react differently to explosives than something in the air
+   (think about physics)
+ */
+int CharacterAttributes::getDamageToGroundCraft()
+{
+  return this->damageToGroundCraft;
+}
+
+
+/**
+   \brief sets the damage modifier to the damage that is dealed via laser weapons
+   \param modifier [0..1]
+
+   eg. the damage is calculated after: damage = modifier * damageToGroundCraft
+ */
+void CharacterAttributes::setDamageLaserModifier(float modifier)
+{
+  this->damageLaserModifier = modifier;
+}
+
+/**
+   \brief gets the damage modifier to the damage that is dealed via laser weapons
+   \returns damage modifier
+
+   eg. the damage is calculated after: damage = modifier * damageToGroundCraft
+ */
+float CharacterAttributes::getDamageLaserModifier()
+{
+  return this->damageLaserModifier;
+}
+
+
+/**
+   \brief sets the damage modifier to the damage that is dealed via plasma weapons
+   \param damage modifier
+
+   eg. the damage is calculated after: damage = modifier * damageToGroundCraft
+ */
+void CharacterAttributes::setDamagePlasmaModifier(float modifier)
+{
+  this->damagePlasmaModifier = modifier;
+}
+
+/**
+   \brief gets the damage modifier to the damage that is dealed plasma weapons
+   \returns damage modifier
+
+   eg. the damage is calculated after: damage = modifier * damageToGroundCraft
+ */
+float CharacterAttributes::getDamagePlasmaModifier()
+{
+  return this->damagePlasmaModifier;
+}
+
+
+/**
+   \brief sets the damage modifier to the damage that is dealed via explosives
+   \param damage modifier
+
+   eg. the damage is calculated after: damage = modifier * damageToGroundCraft
+ */
+void CharacterAttributes::setDamageExplosiveModifier(float modifier)
+{
+  this->damageExplosiveModifier = modifier;
+}
+
+/**
+   \brief sets the damage modifier to the damage that is dealed via explosives
+   \returns damage modifier
+
+   eg. the damage is calculated after: damage = modifier * damageToGroundCraft
+ */
+float CharacterAttributes::getDamageExplosiveModifier()
+{
+  return this->damageExplosiveModifier;
+}
+
+
+/*=====================energy=====================*/
+/**
+   \brief sets the amount of energy 
+   \param energy
+ */
+void CharacterAttributes::setEnergy(int energy)
+{
+  this->energy = energy;
+}
+
+/**
+   \brief adds energy to the system
+   \param amount of energy
+   \returns amount of energy that is too much due to energy limit
+ */
+int CharacterAttributes::addEnergy(int addEnergy)
+{
+  this->energy += addEnergy;
+  int rest = this->energyMax - this->energy;
+  if(rest < 0)
+    {
+      this->energy = 0;
+      return rest;
+    }
+  return 0;
+}
+
+/**
+   \brief substracts energy from a system
+   \param amount of energy
+   \returns false if there is no energy anymore
+ */
+bool CharacterAttributes::substractEnergy(int subEnergy)
+{
+  this->energy -= subEnergy;
+  if(this->energy < 0)
+    {
+      this->energy = 0;
+      return false;
+    }
+  return true;
+}
+
+/**
+   \brief gets the amount of energy 
+   \returns energy
+ */
+int CharacterAttributes::getEnergy()
+{
+  return this->energy;
+}
+
+
+/**
+   \brief sets the energy consumption
+   \param amount of energy
+*/
+void CharacterAttributes::setEnergyConsumption(int energy)
+{
+  this->energyConsumption = energy;
+}
+
+/**
+   \brief gets the energy consumption
+   \returns amount of energy
+*/
+int CharacterAttributes::getEnergyConsumption()
+{
+  return this->energyConsumption;
+}
+  
+
+/**
+   \brief sets the maximum energy level
+   \param amount of energy
+*/
+void CharacterAttributes::setEnergyMax(int energy)
+{
+  this->energyMax = energy;
+}
+
+/**
+   \brief gets the max energy level
+   \returns amount of energy
+*/
+int CharacterAttributes::getEnergyMax()
+{
+  return this->energyMax;
+}
Index: orxonox/branches/levelloader/src/world_entities/character_attributes.h
===================================================================
--- orxonox/branches/levelloader/src/world_entities/character_attributes.h	(revision 3605)
+++ orxonox/branches/levelloader/src/world_entities/character_attributes.h	(revision 3605)
@@ -0,0 +1,91 @@
+/*! 
+    \file character_attributes.h
+    \brief Definition of the attributes of a character (healt, armor,.. ) whatever is important to the character
+*/
+
+#ifndef _CHARACTER_ATTRIBUTES_H
+#define _CHARACTER_ATTRIBUTES_H
+
+#include "base_object.h"
+
+
+//! A class including all important information about a character
+/**
+  its not yet clear, what the character-attributes will be. 
+*/
+class CharacterAttributes : public BaseObject {
+
+ public:
+  CharacterAttributes();
+  virtual ~CharacterAttributes();
+
+  /* health */
+  void setHealth(int health);
+  int addHealth(int health);
+  bool substractHealth(int health);
+  int getHealth();
+
+  void setHealthMax(int healthMax);
+  int getHealthMax();
+
+
+  /* armor/ shields */
+  void setShieldStrength(int shieldStrength);
+  void addShieldStrength(int shiledStrength);
+  int substractShieldStrength(int shieldStrength);
+  int getShieldStrength();
+
+
+  /* damage */
+  void setDamageToAirCraft(int damage);
+  int getDamageToAirCraft();
+
+  void setDamageToGroundCraft(int damage);
+  int getDamageToGroundCraft();
+
+  void setDamageLaserModifier(float modifier);
+  float getDamageLaserModifier();
+
+  void setDamagePlasmaModifier(float modifier);
+  float getDamagePlasmaModifier();
+
+  void setDamageExplosiveModifier(float modifier);
+  float getDamageExplosiveModifier();
+
+
+  /* energy */
+  void setEnergy(int energy);
+  int addEnergy(int addEnergy);
+  bool substractEnergy(int subEnergy);
+  int getEnergy();
+
+  void setEnergyConsumption(int energy);
+  int getEnergyConsumption();
+
+  void setEnergyMax(int energy);
+  int getEnergyMax();
+  
+
+ private:
+  /* healt */
+  int health;                        //<! the healt of a projectile
+  int healthMax;                     //<! the max healt of a projectile, =0 if no limit
+
+  /* armor/ shields */
+  int shieldStrength;                //<! the shiled strength of a character, =0 if no shields
+
+  /* damage */
+  int damageToAirCraft;              //<! damage dealt to a air craft in case of a hit
+  int damageToGroundCraft;           //<! damage dealt to a ground craft in case of a hit
+
+  float damageLaserModifier;         //<! [0..1] the damage from laser is multiplied with this modifier. there can be things in the world, that are immune to certain damage
+  float damagePlasmaModifier;        //<! [0..1] the damage from plasma is multiplied with this modifier. there can be things in the world, that are immune to certain damage
+  float damageExplosiveModifier;      //<! [0..1] the damage from exposives (rockets, tnt,...) is multiplied with this modifier. there can be things in the world, that are immune to certain damage 
+
+  /* energy */
+  int energyConsumption;             //<! if the character defines an action, it will consume energy
+  int energy;                        //<! the current amount of energy saved in this part
+  int energyMax;                     //<! the maximal energy a character can handle
+};
+
+#endif /* _CHARACTER_ATTRIBUTES_H */
Index: orxonox/branches/levelloader/src/world_entities/environment.cc
===================================================================
--- orxonox/branches/levelloader/src/world_entities/environment.cc	(revision 3604)
+++ orxonox/branches/levelloader/src/world_entities/environment.cc	(revision 3605)
@@ -100,10 +100,10 @@
 Environment::~Environment () 
 {
-  delete this->model;
+
 }
 
 void Environment::tick (float time) {}
 
-void Environment::hit (WorldEntity* weapon, Vector loc) {}
+void Environment::hit (WorldEntity* weapon, Vector* loc) {}
 
 void Environment::destroy () {}
@@ -114,5 +114,5 @@
 {
   glMatrixMode(GL_MODELVIEW);
-  glLoadIdentity();
+  glPushMatrix();
   float matrix[4][4];
   
@@ -123,4 +123,6 @@
   
   this->model->draw();
+
+  glPopMatrix();
 }
 
Index: orxonox/branches/levelloader/src/world_entities/environment.h
===================================================================
--- orxonox/branches/levelloader/src/world_entities/environment.h	(revision 3604)
+++ orxonox/branches/levelloader/src/world_entities/environment.h	(revision 3605)
@@ -9,19 +9,11 @@
   friend class World;
 
- private:
-  float xCor;
-  float yCor;
-  float zCor;
-
-  float mountainTest[10][10];
-
  public:
   Environment ();
   Environment (TiXmlElement* root);
-  ~Environment ();
-
+  virtual ~Environment ();
   
   virtual void tick (float time);
-  virtual void hit (WorldEntity* weapon, Vector loc);
+  virtual void hit (WorldEntity* weapon, Vector* loc);
   virtual void destroy ();
   virtual void collide (WorldEntity* other,  Uint32 ownhitflags, Uint32 otherhitflags);
Index: orxonox/branches/levelloader/src/world_entities/player.cc
===================================================================
--- orxonox/branches/levelloader/src/world_entities/player.cc	(revision 3604)
+++ orxonox/branches/levelloader/src/world_entities/player.cc	(revision 3605)
@@ -16,8 +16,14 @@
 */
 
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_PLAYER
+
 #include "player.h"
+
 #include "stdincl.h"
 //#include "collision.h"
 #include "objModel.h"
+#include "list.h"
+#include "weapon.h"
+#include "track_manager.h"
 
 using namespace std;
@@ -31,32 +37,31 @@
 Player::Player(bool isFree) : WorldEntity(isFree)
 {
-
   this->model = new OBJModel("../data/models/reaplow.obj");
-  /*
-  objectList = glGenLists(1);
-  glNewList (objectList, GL_COMPILE);
-
-  glBegin(GL_TRIANGLES);
-  glColor3f(1,1,1);
-  glVertex3f(0,0,0.5);
-  glVertex3f(-0.5,0,-1);
-  glVertex3f(0.5,0,-1);
-
-  glVertex3f(0,0,0.5);
-  glVertex3f(0,0.5,-1);
-  glVertex3f(0,-0.5,-1);
-  glEnd();
-    
-  glBegin(GL_QUADS);
-  glColor3f(0,0,1);
-  glVertex3f(0.5,0.5,-1);
-  glVertex3f(0.5,-0.5,-1);
-  glVertex3f(-0.5,-0.5,-1);
-  glVertex3f(-0.5,0.5,-1);
-  glEnd();
-  
-  glEndList ();
-  */
-}
+  this->weapons = new tList<Weapon>();
+  this->activeWeapon = NULL;
+
+  travelSpeed = 15.0;
+  velocity = Vector();
+  bUp = bDown = bLeft = bRight = bAscend = bDescend = false;
+  bFire = false;
+  acceleration = 10.0;
+}
+
+/**
+   \brief destructs the player, deletes alocated memory
+*/
+Player::~Player ()
+{
+  Weapon* w = this->weapons->enumerate(); 
+  while( w != NULL) 
+    { 
+      delete w;
+      w = this->weapons->nextElement();
+    }
+  delete this->weapons;
+  
+  //delete this->velocity;
+}
+
 
 /**
@@ -102,10 +107,22 @@
 
 /**
-   \brief destructs the player
-*/
-Player::~Player ()
-{
-  delete this->model;
-}
+   \brief adds a weapon to the weapon list of player
+   \param weapon to add
+*/
+void Player::addWeapon(Weapon* weapon)
+{
+  this->weapons->add(weapon);
+}
+
+
+/**
+   \brief removes a weapon from the player
+   \param weapon to remove
+*/
+void Player::removeWeapon(Weapon* weapon)
+{
+  this->weapons->remove(weapon);
+}
+
 
 /**
@@ -114,21 +131,15 @@
 void Player::postSpawn ()
 {
-  travelSpeed = 15.0;
-  velocity = Vector();
-  bUp = bDown = bLeft = bRight = bAscend = bDescend = false;
-  bFire = false;
-  acceleration = 10.0;
   //setCollision(new CollisionCluster(1.0, Vector(0,0,0)));
 }
 
-/**
-   \brief the function called for each passing timeSnap
-   \param time The timespan passed since last update
-*/
-void Player::tick (float time)
-{
-  // movement
-  this->move (time);
-}
+
+/**
+   \brief the action occuring if the player left the game
+*/
+void Player::leftWorld ()
+{}
+
+
 
 /**
@@ -137,14 +148,8 @@
    \param loc ??
 */
-void Player::hit (WorldEntity* weapon, Vector loc)
-{
-}
-
-/**
-   \brief action that happens when the player is destroyed.
-*/
-void Player::destroy ()
-{
-}
+void Player::hit (WorldEntity* weapon, Vector* loc)
+{
+}
+
 
 /** 
@@ -158,19 +163,4 @@
 }
 
-/**
-   \brief The connection to the command node
-   \param cmd the Command unit from witch to map
-
-   here the commands are mapped to the players movement/weaponary
-*/
-void Player::command (Command* cmd)
-{
-  //printf("Player|recieved command [%s]\n", cmd->cmd);
-  if( !strcmp( cmd->cmd, "up")) bUp = !cmd->bUp;
-  else if( !strcmp( cmd->cmd, "down")) bDown = !cmd->bUp;
-  else if( !strcmp( cmd->cmd, "left")) bLeft = !cmd->bUp;
-  else if( !strcmp( cmd->cmd, "right")) bRight = !cmd->bUp;
-  else if( !strcmp( cmd->cmd, "fire")) bFire = !cmd->bUp;
-}
 
 /**
@@ -180,5 +170,5 @@
 { 
   glMatrixMode(GL_MODELVIEW);
-  glLoadIdentity();
+  glPushMatrix();
   float matrix[4][4];
   
@@ -191,24 +181,21 @@
   glMultMatrixf((float*)matrix);
   
-  glMatrixMode(GL_MODELVIEW);
   this->model->draw();
-  // glCallList(objectList);
-}
-
-
-/*PN
-  void Player::getLookat(Location* locbuf)
-  {
-  *locbuf = *getLocation();
-  //locbuf->dist += 5.0;
-  }
-*/
-
-/**
-   \brief the action occuring if the player left the game
-*/
-void Player::leftWorld ()
-{
-}
+  glPopMatrix();
+}
+
+
+/**
+   \brief the function called for each passing timeSnap
+   \param time The timespan passed since last update
+*/
+void Player::tick (float time)
+{
+  // player controlled movement
+  this->move (time);
+  // weapon system manipulation
+  this->fire();
+}
+
 
 /**
@@ -220,5 +207,4 @@
   Vector accel(0.0, 0.0, 0.0);
   /* FIXME: calculating the direction and orthDirection every timeSlice is redundant! save it somewhere */
-  //Placement *pos = getPlacement();
   
   /* calculate the direction in which the craft is heading  */
@@ -228,27 +214,52 @@
   //orthDirection = orthDirection.cross (direction);
 
-  if( bUp) { accel = accel+(direction*acceleration); }
-  if( bDown) { accel = accel-(direction*acceleration); }
-  if( bLeft ) { accel = accel - (orthDirection*acceleration); }
-  if( bRight ) { accel = accel + (orthDirection*acceleration); }
-  if( bAscend ) { /* not yet implemented but just: (0,0,1)*acceleration */}
-  if( bDescend) {/* FIXME */} /* \todo up and down player movement */
-
-  //Location* l = getLocation();
-  
-  // r(t) = r(0) + v(0)*t + 1/2*a*t^2
-  // r = position
-  // v = velocity
-  // a = acceleration
-
-  /* this the base-speed of the player: determines how fast and how the player follows the track*/
-  //l->dist = l->dist + travelSpeed * time;
-  
-  Vector* shift = new Vector (this->travelSpeed * time, 0, 0);
-  this->shiftCoor (shift);
-  
-  /* this updates the player position on the track - user interaction */
-  //l->pos = l->pos + accel*time;
+  if( this->bUp && this->getRelCoor().x < 20)
+    accel = accel+(direction*acceleration);
+  if( this->bDown && this->getRelCoor().x > -5)
+    accel = accel-(direction*acceleration);
+  if( this->bLeft &&  TrackManager::getInstance()->getWidth() > -this->getRelCoor().z*2)
+    accel = accel - (orthDirection*acceleration); 
+  if( this->bRight &&  TrackManager::getInstance()->getWidth() > this->getRelCoor().z*2)
+    accel = accel + (orthDirection*acceleration);
+  if( this->bAscend )
+  if( this->bDescend) {/* FIXME */} /* \todo up and down player movement */
+
   Vector move = accel * time;
   this->shiftCoor (&move);
 }
+
+
+/**
+   \brief weapon manipulation by the player
+*/
+void Player::fire()
+{
+  if(this->bFire)
+    {
+      if(this->activeWeapon != NULL)
+	this->activeWeapon->fire();
+    }
+  if(this->bWeaponChange)
+    {
+      Weapon* w = this->weapons->enumerate(); 
+      this->activeWeapon = this->weapons->nextElement(this->activeWeapon);
+    }
+}
+
+
+/**
+   \brief The connection to the command node
+   \param cmd the Command unit from witch to map
+
+   here the commands are mapped to the players movement/weaponary
+*/
+void Player::command (Command* cmd)
+{
+  PRINTF(3)("recieved command [%s]\n", cmd->cmd);
+  if( !strcmp( cmd->cmd, "up")) this->bUp = !cmd->bUp;
+  else if( !strcmp( cmd->cmd, "down")) this->bDown = !cmd->bUp;
+  else if( !strcmp( cmd->cmd, "left")) this->bLeft = !cmd->bUp;
+  else if( !strcmp( cmd->cmd, "right")) this->bRight = !cmd->bUp;
+  else if( !strcmp( cmd->cmd, "fire")) this->bFire = !cmd->bUp;
+  else if( !strcmp( cmd->cmd, "mode")) this->bWeaponChange = !cmd->bUp;
+}
Index: orxonox/branches/levelloader/src/world_entities/player.h
===================================================================
--- orxonox/branches/levelloader/src/world_entities/player.h	(revision 3604)
+++ orxonox/branches/levelloader/src/world_entities/player.h	(revision 3605)
@@ -9,5 +9,7 @@
 #include "world_entity.h"
 
+template<class T> class tList;
 class OBJModel;
+class Weapon;
 
 //! Basic controllable WorldEntity
@@ -19,17 +21,18 @@
   Player(bool isFree = false);
   Player(TiXmlElement* root);
-  ~Player();
+  virtual ~Player();
+
+  void addWeapon(Weapon* weapon);
+  void removeWeapon(Weapon* weapon);
   
   virtual void postSpawn();
-  virtual void tick(float time);
-  virtual void hit(WorldEntity* weapon, Vector loc);
-  virtual void destroy();
+  virtual void leftWorld();
+  virtual void hit(WorldEntity* weapon, Vector* loc);
   virtual void collide(WorldEntity* other, Uint32 ownhitflags, Uint32 otherhitflags);
+
+  virtual void tick(float time);  
+  virtual void draw();
+
   virtual void command(Command* cmd);
-  
-  virtual void draw();
-  // virtual void getLookat(Location* locbuf);
-  
-  virtual void leftWorld();
   
  private:
@@ -41,4 +44,8 @@
   bool bDescend;         //!< descend button presses.
   bool bFire;            //!< fire button pressed.
+  bool bWeaponChange;    //!< weapon change button pressed
+
+  tList<Weapon>* weapons;//!< a list of weapon
+  Weapon* activeWeapon;  //!< the weapon that is currenty activated
 
   Vector velocity;       //!< the velocity of the player.
@@ -47,4 +54,5 @@
   
   void move(float time);
+  void fire(void);
   
 };
Index: orxonox/branches/levelloader/src/world_entities/power_up.h
===================================================================
--- orxonox/branches/levelloader/src/world_entities/power_up.h	(revision 3604)
+++ orxonox/branches/levelloader/src/world_entities/power_up.h	(revision 3605)
@@ -15,5 +15,5 @@
  public:
   PowerUp ();
-  ~PowerUp ();
+  virtual ~PowerUp ();
   
 };
Index: orxonox/branches/levelloader/src/world_entities/primitive.cc
===================================================================
--- orxonox/branches/levelloader/src/world_entities/primitive.cc	(revision 3605)
+++ orxonox/branches/levelloader/src/world_entities/primitive.cc	(revision 3605)
@@ -0,0 +1,99 @@
+
+
+/* 
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   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 2, or (at your option)
+   any later version.
+
+   ### File Specific
+   main-programmer: Patrick Boenzli
+   co-programmer: 
+*/
+
+
+#include "primitive.h"
+#include "stdincl.h"
+#include "world_entity.h"
+#include "vector.h"
+#include "objModel.h"
+
+using namespace std;
+
+
+
+/**
+   \brief standard constructor
+*/
+Primitive::Primitive (PRIMITIVE_FORM form) : WorldEntity()
+{
+  //this->model = new OBJModel("../data/models/fighter.obj");
+  //this->model = new OBJModel("");
+  this->object = gluNewQuadric();
+  
+  gluQuadricTexture(this->object, GL_TRUE);
+
+  this->material = new Material("Sphere");
+  this->material->setDiffuseMap("../data/pictures/load_screen.jpg");
+  this->material->setIllum(3);
+  this->material->setSpecular(1, 1, 1);
+}
+
+
+/**
+   \brief standard deconstructor
+*/
+Primitive::~Primitive () 
+{
+  delete this->material;
+  free(this->object);
+}
+
+/**
+   \brief called, when the object gets hit
+   \param other object, that hits it
+   \param location of impact
+*/
+void Primitive::hit (WorldEntity* weapon, Vector* loc) {}
+
+
+/**
+   \brief object collides
+*/
+void Primitive::collide (WorldEntity* other,  Uint32 ownhitflags, Uint32 otherhitflags) {}
+
+
+/**
+   \brief tick singal put everything here, that is timedependent
+   \param time in sec
+*/
+void Primitive::tick (float time) 
+{
+  //  Vector v(0.0, 0.0, 1.0);
+  //  Quaternion q(10.0, v);
+  //  this->setRelDir(&(this->relDirection * q));
+}
+
+/**
+   \brief drawing function of the object
+*/
+void Primitive::draw () 
+{
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+
+  float matrix[4][4];
+  glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
+  //rotate
+  //this->getAbsDir().matrix (matrix);
+  //glMultMatrixf((float*)matrix);
+  this->material->select();
+  gluSphere(this->object, 2, 20, 20);
+
+  glPopMatrix();
+}
+
Index: orxonox/branches/levelloader/src/world_entities/primitive.h
===================================================================
--- orxonox/branches/levelloader/src/world_entities/primitive.h	(revision 3605)
+++ orxonox/branches/levelloader/src/world_entities/primitive.h	(revision 3605)
@@ -0,0 +1,27 @@
+#ifndef _PRIMITIVE_H
+#define _PRIMITIVE_H
+
+#include "world_entity.h"
+
+typedef enum PRIMITIVE_FORM {PSPHERE = 0, PCUBE, PSQUARE};
+
+class Primitive : public WorldEntity 
+{
+  friend class World;
+
+ public:
+  Primitive (PRIMITIVE_FORM form);
+  virtual ~Primitive ();
+
+  virtual void tick (float time);
+  virtual void hit (WorldEntity* weapon, Vector* loc);
+  virtual void collide (WorldEntity* other,  Uint32 ownhitflags, Uint32 otherhitflags);
+  virtual void draw ();
+
+ private:
+  GLUquadricObj *object; //!< the object to be rendered
+  Material *material;    //!< A Material for the SkySphere.
+
+};
+
+#endif /* _PRIMITIVE_H */
Index: orxonox/branches/levelloader/src/world_entities/projectile.cc
===================================================================
--- orxonox/branches/levelloader/src/world_entities/projectile.cc	(revision 3605)
+++ orxonox/branches/levelloader/src/world_entities/projectile.cc	(revision 3605)
@@ -0,0 +1,82 @@
+
+
+/* 
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   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 2, or (at your option)
+   any later version.
+
+   ### File Specific
+   main-programmer: Patrick Boenzli
+   co-programmer: 
+*/
+
+
+#include "projectile.h"
+#include "stdincl.h"
+#include "world_entity.h"
+#include "vector.h"
+#include "objModel.h"
+
+using namespace std;
+
+
+/**
+   \brief standard constructor
+*/
+Projectile::Projectile () : WorldEntity()
+{
+  this->model = new OBJModel("");
+}
+
+
+/**
+   \brief standard deconstructor
+*/
+Projectile::~Projectile () 
+{
+
+}
+
+
+/**
+   \brief signal tick, time dependent things will be handled here
+   \param time since last tick
+*/
+void Projectile::tick (float time) 
+{}
+
+/**
+   \brief the projectile gets hit by another entity
+   \param the other entity
+   \param place where it is hit
+*/
+void Projectile::hit (WorldEntity* entity, Vector* place) 
+{}
+
+
+/**
+   \brief the function gets called, when the projectile is destroyed
+*/
+void Projectile::destroy () 
+{}
+
+
+void Projectile::draw () 
+{
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+
+  float matrix[4][4];  
+  glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
+  this->getAbsDir().matrix (matrix);
+  glMultMatrixf((float*)matrix);  
+  this->model->draw();
+
+  glPopMatrix();
+}
+
Index: orxonox/branches/levelloader/src/world_entities/projectile.h
===================================================================
--- orxonox/branches/levelloader/src/world_entities/projectile.h	(revision 3605)
+++ orxonox/branches/levelloader/src/world_entities/projectile.h	(revision 3605)
@@ -0,0 +1,31 @@
+/*! 
+    \projectile.h
+    \brief a projectile, that is been shooted by a weapon
+*/
+
+#ifndef _PROJECTILE_H
+#define _PROJECTILE_H
+
+#include "world_entity.h"
+
+
+class Projectile : public WorldEntity 
+{
+  friend class World;
+
+ public:
+  Projectile ();
+  virtual ~Projectile ();
+
+  virtual void hit (WorldEntity* weapon, Vector* loc);
+  virtual void destroy ();
+
+  virtual void tick (float time);
+  virtual void draw ();
+
+ private:
+  //physical attriutes like: force, speed, acceleration etc.
+
+};
+
+#endif /* _PROJECTILE_H */
Index: orxonox/branches/levelloader/src/world_entities/shoot_laser.cc
===================================================================
--- orxonox/branches/levelloader/src/world_entities/shoot_laser.cc	(revision 3604)
+++ 	(revision )
@@ -1,153 +1,0 @@
-
-
-/* 
-   orxonox - the future of 3D-vertical-scrollers
-
-   Copyright (C) 2004 orx
-
-   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 2, or (at your option)
-   any later version.
-
-   ### File Specific:
-   main-programmer: Patrick Boenzli
-   co-programmer: 
-*/
-
-
-
-
-#include <GL/glut.h>
-#include <iostream>
-
-#include "stdincl.h"
-#include "data_tank.h"
-
-#include "shoot_laser.h"
-
-using namespace std;
-
-
-
-ShootLaser::ShootLaser () 
-{
-  lastShoot = null;
-  step = 1.0;
-  inhibitor = 0;
-}
-
-
-ShootLaser::~ShootLaser () {}
-
-
-void ShootLaser::drawShoot() 
-{
-
-  //cout << "ShootLaser::drawShoot" << endl;
-  /* now draw all the shoots (many) */
-  shoot* tmpShoot = lastShoot;
-  shoot* lastRef = null;
-  while( tmpShoot != null )
-    {
-      glPushMatrix(); 
-      glTranslatef(tmpShoot->xCor, tmpShoot->yCor, tmpShoot->zCor);
-      tmpShoot->xCor+=tmpShoot->xVel;
-      tmpShoot->yCor+=tmpShoot->yVel;
-      glScalef(0.1, 0.1, 0.1);
-      glutWireCube(1.0);
-      glPopMatrix();
-
-      /* garbage collection: look if shoot is outside world */
-      /* fix1: weak boundaries check all four sides */
-      /* fix2: conditions, that a struct tree can be cut off */
-      /* fix3: more efficent and nicer please */
-      if (tmpShoot->yCor - DataTank::yOffset > 20) 
-	{
-	  /* normal case: delete one element, link the others */
-	  if (lastRef != null) 
-	    {
-	      //cout << "garbage collection" << endl;
-	      lastRef->next = tmpShoot->next;
-	      delete tmpShoot;
-	      tmpShoot = lastRef->next;
-	      //cout << "garbage collection left" << endl;
-	    }
-	  else
-	    {
-	      /* special case: first element to be processed */
-	      //cout << "garbage collecton: first el in queue" << endl;
-	      lastRef = tmpShoot->next;
-	      delete tmpShoot;
-	      tmpShoot = lastRef;
-	      lastShoot = tmpShoot;
-	      if (tmpShoot != null) 
-		{
-		  tmpShoot = tmpShoot->next;
-		  //cout << "noch nich null" << endl;
-		}
-	      else 
-		{
-		  lastRef = null;
-		  tmpShoot = null;
-		  lastShoot = null;
-		  //cout << "endl null" << endl;
-		}
-	      
-	      //cout << "garbage collection: firtst el in queue left" << endl;
-	    }
-	}
-      else 
-	{
-	  lastRef = tmpShoot;
-	  tmpShoot = tmpShoot->next;
-	}
-    }
-  //cout << "ShootLaser::drawShoot - finished" << endl;
-}
-
-
-void ShootLaser::addShoot(shoot* sh) 
-{
-  sh->next = null;
-  lastShoot = sh;
-}
-
-void ShootLaser::addShoot(float x, float y, float z)
-{
-  //cout << "ShootLaser::addShoot" << endl;
-  shoot* sh = new shoot;
-  sh->xCor = x; sh->yCor = y; sh->zCor = z;
-  sh->xVel = 0; sh->yVel = .4/step; sh->zVel = 0;
-  sh->next = lastShoot;
-  lastShoot = sh;
-}
-
-void ShootLaser::addShootExt(float x, float y, float z, 
-			     float xVel, float yVel, float zVel)
-{
-  //cout << "ShootLaser::addShootExtended" << endl;
-  shoot* sh = new shoot;
-  sh->xCor = x; sh->yCor = y; sh->zCor = z;
-  sh->xVel = xVel/step; sh->yVel = yVel/step; sh->zVel = zVel/step;
-  sh->next = lastShoot;
-  lastShoot = sh;
-}
-
-void ShootLaser::setShootStep(float step) 
-{
-  cout << "ShootLaser::setShootStep to " << step << endl;
-  this->step = step;
-  cout << "ShootLaser::setShootStep end " << step << endl;
-}
-
-
-/* Exterminate shoot from game, implement this method  */
-/* if you like to add animatiion */
-void ShootLaser::removeShoot(shoot* sh)
-{
-  glPushMatrix(); 
-  glTranslatef(sh->xCor, sh->yCor, sh->zCor);
-  glutWireCube(1.0);
-  glPopMatrix();
-}
Index: orxonox/branches/levelloader/src/world_entities/shoot_laser.h
===================================================================
--- orxonox/branches/levelloader/src/world_entities/shoot_laser.h	(revision 3604)
+++ 	(revision )
@@ -1,42 +1,0 @@
-
-#ifndef _SHOOT_LASER_H
-#define _SHOOT_LASER_H
-
-
-class ShootLaser {
-
- public:
-  
-  /* a list of all shoot-amental objects */
-  struct shoot {
-    shoot *next;
-    float xCor;
-    float yCor;
-    float zCor;    
-    float xVel;
-    float yVel;
-    float zVel;
-    float collisionRadius;
-  };
-  shoot* lastShoot;
-
-  ShootLaser ();
-  ~ShootLaser ();
-
-  int inhibitor;
-
-  void drawShoot(void);
-  void addShoot(shoot* sh);
-  void addShoot(float x, float y, float z);
-  void addShootExt(float x, float y, float z, float xVel, float yVel, float zVel);
-  void setShootStep(float step);
-  void removeShoot(shoot* sh);
-
-
- private:
-
-  float step;
-
-};
-
-#endif /* _SHOOT_LASER_H */
Index: orxonox/branches/levelloader/src/world_entities/shoot_rocket.cc
===================================================================
--- orxonox/branches/levelloader/src/world_entities/shoot_rocket.cc	(revision 3604)
+++ 	(revision )
@@ -1,220 +1,0 @@
-
-
-/* 
-   orxonox - the future of 3D-vertical-scrollers
-
-   Copyright (C) 2004 orx
-
-   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 2, or (at your option)
-   any later version.
-
-   ### File Specific:
-   main-programmer: Patrick Boenzli
-   co-programmer:  Benjamin Grauer
-*/
-
-
-#include <iostream>
-#include <math.h>
-#include <GL/glut.h>
-
-#include "stdincl.h"
-#include "data_tank.h"
-#include "npc.h"
-
-#include "shoot_rocket.h"
-
-using namespace std;
-
-
-
-ShootRocket::ShootRocket ()
-{
-  lastShoot = null;
-  step = 1.0;
-  inhibitor =0;
-  rotateAngle = 0.0;
-}
-
-
-ShootRocket::~ShootRocket () {}
-
-
-void ShootRocket::drawShoot() 
-{
-
-  //cout << "ShootRocket::drawShoot" << endl;
-  /* now draw all the shoots (many) */
-  shoot* tmpShoot = lastShoot;
-  shoot* lastRef = null;
-  while( tmpShoot != null )
-    {
-      glPushMatrix(); 
-      glTranslatef(tmpShoot->xCor, tmpShoot->yCor, tmpShoot->zCor);
-      tmpShoot->age+=step;
-      switch (tmpShoot->type)
-	{
-	case BACKPARABLE:
-	  tmpShoot->xCor+=tmpShoot->xVel;
-	  tmpShoot->yCor+=tmpShoot->yVel;
-	  tmpShoot->xVel+=tmpShoot->xAcc;
-	  tmpShoot->yVel+=tmpShoot->yAcc;
-	  break;
-	
-	case SIDEACC:
-	  if (tmpShoot->xVel >= .01 || tmpShoot->xVel <= -.01)
-	    {
-	      tmpShoot->xCor+=tmpShoot->xVel;
-	      tmpShoot->yCor+=tmpShoot->yVel;
-	      tmpShoot->xVel*=tmpShoot->xAcc;
-	    }
-	  else
-	    {
-	      tmpShoot->xCor+=tmpShoot->xVel;
-	      tmpShoot->yCor+=tmpShoot->yVel;
-	      tmpShoot->yVel+=tmpShoot->yVel*tmpShoot->yAcc;
-	    }
-	  break;
-	
-	case ROTATER:
-	  tmpShoot->xCor+=tmpShoot->xVel;
-	  tmpShoot->yCor+=tmpShoot->yVel;
-	  tmpShoot->zCor+=tmpShoot->zVel;
-	  break;
-	
-	}
-      
-      glScalef(0.1, 0.1, 0.1);
-      glutWireCube(1.0);
-      glPopMatrix();
-
-      /* garbage collection: look if shoot is outside world */
-      /* fix1: weak boundaries check all four sides */
-      /* fix2: conditions, that a struct tree can be cut off */
-      /* fix3: more efficent and nicer please */
-      if (tmpShoot->age > tmpShoot->lifetime) 
-	{
-	  /* normal case: delete one element, link the others */
-	  if (lastRef != null) 
-	    {
-	      //cout << "garbage collection" << endl;
-	      lastRef->next = tmpShoot->next;
-	      delete tmpShoot;
-	      tmpShoot = lastRef->next;
-	      //cout << "garbage collection left" << endl;
-	    }
-	  else
-	    {
-	      /* special case: first element to be processed */
-	      //cout << "garbage collecton: first el in queue" << endl;
-	      lastRef = tmpShoot->next;
-	      delete tmpShoot;
-	      tmpShoot = lastRef;
-	      lastShoot = tmpShoot;
-	      if (tmpShoot != null) 
-		{
-		  tmpShoot = tmpShoot->next;
-		  //cout << "noch nich null" << endl;
-		}
-	      else 
-		{
-		  lastRef = null;
-		  tmpShoot = null;
-		  lastShoot = null;
-		  //cout << "endl null" << endl;
-		}
-	      
-	      //cout << "garbage collection: firtst el in queue left" << endl;
-	    }
-	}
-      else 
-	{
-	  lastRef = tmpShoot;
-	  tmpShoot = tmpShoot->next;
-	}
-    }
-  //cout << "ShootRocket::drawShoot - finished" << endl;
-}
-
-
-void ShootRocket::addShoot(shoot* sh) 
-{
-  sh->next = null;
-  lastShoot = sh;
-}
-
-void ShootRocket::addBackParable(float x, float y, float z)
-{
-  
-  //cout << "ShootRocket::addShoot" << endl;
-  shoot* sh = new shoot;
-  sh->type = BACKPARABLE;
-  sh->xCor = x; sh->yCor = y; sh->zCor = z;
-  sh->xVel = (-1+(float)rand() / 1000000000/step)/5; 
-  sh->yVel = -.3;
-  sh->zVel = (1-(float)rand() / 1000000000/step)/5;
-  sh->xAcc = 0; sh->yAcc = .01/step; sh->zAcc = 0;
-  sh->age=0;
-  sh->lifetime=5; 
-  sh->next = lastShoot;
-  lastShoot = sh;
-  }
-void ShootRocket::addSideAcc(float x, float y, float z, enum RocketDirection direction)
-{
-  //cout << "ShootRocket::addShoot" << endl;
-  shoot* sh = new shoot;
-  sh->type = SIDEACC;
-  sh->xCor = x; sh->yCor = y; sh->zCor = z;
-  switch (direction)
-    {
-    case LEFT:
-      sh->xVel = -.5; sh->yVel = .05; sh->zVel = 0;
-      break;
-    case RIGHT:
-      sh->xVel = .5; sh->yVel = .05; sh->zVel = 0;
-      break;
-    }
-  sh->xAcc = .9; sh->yAcc = .02; sh->zAcc = 0;
-  sh->age=0;
-  sh->lifetime=10; 
-  sh->next = lastShoot;
-  lastShoot = sh;
-}
-
-void ShootRocket::addRotater(float x, float y, float z)
-{
-  
-  static float radius = 2;
-  rotateAngle+=.1;
-  //cout << "ShootRocket::addShoot" << endl;
-  shoot* sh = new shoot;
-  sh->type = ROTATER;
-  sh->xCor = x+radius*sin(rotateAngle); sh->yCor = y; sh->zCor = z+radius*cos(rotateAngle);
-  sh->xVel = 1*cos(rotateAngle)*step;
-  sh->yVel = 4*step;
-  sh->zVel = 1*sin(rotateAngle)*step;
-  sh->xAcc = 1.01; sh->yAcc = 1- step; sh->zAcc = 1.01;
-  sh->age=0;
-  sh->lifetime=10; 
-  sh->next = lastShoot;
-  lastShoot = sh;
-}
-
-void ShootRocket::setShootStep(float step) 
-{
-  cout << "ShootRocket::setShootStep to " << step << endl;
-  this->step = step;
-}
-
-
-/* Exterminate shoot from game, implement this method  */
-/* if you like to add animatiion */
-void ShootRocket::removeShoot(shoot* sh)
-{
-  glPushMatrix(); 
-  glTranslatef(sh->xCor, sh->yCor, sh->zCor);
-  glutWireCube(1.0);
-  glPopMatrix();
-}
Index: orxonox/branches/levelloader/src/world_entities/shoot_rocket.h
===================================================================
--- orxonox/branches/levelloader/src/world_entities/shoot_rocket.h	(revision 3604)
+++ 	(revision )
@@ -1,56 +1,0 @@
-
-#ifndef _SHOOT_ROCKET_H
-#define _SHOOT_ROCKET_H
-
-
-
-enum RocketType { HOMING, SIDEACC, BACKPARABLE, ROTATER};
-enum RocketDirection {LEFT, RIGHT, UP, DOWN};
-
-
-class ShootRocket {
-
- public:
-  
-  /* a list of all shoot-amental objects */
-  struct shoot {
-    enum RocketType type;
-    shoot *next;
-    float xCor;
-    float yCor;
-    float zCor;    
-    float xVel;
-    float yVel;
-    float zVel;
-    float xAcc;
-    float yAcc;
-    float zAcc;
-    float age;
-    float lifetime;
-    float collisionRadius;
-  };
-  shoot* lastShoot;
-  
-  ShootRocket ();
-  ~ShootRocket ();
-  
-  int inhibitor;
-  float rotateAngle;
-
-  void drawShoot(void);
-  void addShoot(shoot* sh);
-  void addBackParable(float x, float y, float z);
-  void addSideAcc(float x, float y, float z, enum RocketDirection direction);
-  void addRotater(float x, float y, float z);
-
-  void setShootStep(float step);
-  void removeShoot(shoot* sh);
-
-
- private:
-
-  float step;
-
-};
-
-#endif /* _SHOOT_ROCKET_H */
Index: orxonox/branches/levelloader/src/world_entities/skysphere.cc
===================================================================
--- orxonox/branches/levelloader/src/world_entities/skysphere.cc	(revision 3604)
+++ orxonox/branches/levelloader/src/world_entities/skysphere.cc	(revision 3605)
@@ -24,4 +24,6 @@
 */
 
+#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
+
 #include "material.h"
 #include "skysphere.h"
@@ -29,5 +31,4 @@
 #include "vector.h"
 #include "world_entity.h"
-
 
 using namespace std;
@@ -38,6 +39,7 @@
 Skysphere::Skysphere()
 {  
-  initialize("../data/pictures/sky-replace.jpg");
+  this->initialize("../data/pictures/sky-replace.jpg");
 }
+
 
 /**
@@ -47,6 +49,7 @@
 Skysphere::Skysphere(char* fileName)
 {
-  initialize(fileName);
+  this->initialize(fileName);
 }
+
 
 /**
@@ -56,6 +59,6 @@
 {
   PRINTF(3)("Deleting the SkySphere\n");
-  delete skyMaterial;
-  free(sphereObj);
+  delete this->skyMaterial;
+  free(this->sphereObj);
 }
 
@@ -69,5 +72,5 @@
   this->sphereObj = gluNewQuadric();
   gluQuadricTexture(this->sphereObj, GL_TRUE);
-  this->setRadius(250.0);
+  this->setRadius(1900.0);
 
   this->skyMaterial = new Material("Sky");
@@ -75,14 +78,4 @@
   this->skyMaterial->setIllum(3);
   this->skyMaterial->setAmbient(1.0, 1.0, 1.0);
-}
-
-
-/**
-   \brief sets the Radius of the Sphere.
-   \param radius The Radius of The Sphere
-*/
-void Skysphere::setRadius(float radius)
-{
-  this->sphereRadius = radius;
 }
 
@@ -99,16 +92,4 @@
 
 /**
-   \brief updates the position of the Skysphere
-   \param sphereCenter The coordinate of the Center of the Sphere
-   
-   This is normally done in the update-phase of world, so the Skysphere is always centered at the Camera.
-*/
-void Skysphere::updatePosition(Vector sphereCenter)
-{
-  this->sphereCenter = sphereCenter;
-}
-
-
-/**
    \brief draws the Skysphere
    
@@ -117,15 +98,26 @@
 void Skysphere::draw()
 {
-  glEnable(GL_TEXTURE_2D);
+  glPushMatrix();
+  glMatrixMode(GL_MODELVIEW);
+  glTranslatef(this->absCoordinate.x,
+	       this->absCoordinate.y,
+	       this->absCoordinate.z);
+
+  //glRotatef(-30, 1, 0, 0);
+  //glRotatef(95.0f, 0.0f, 0.0f, 1.0f);
+  //glRotatef(-250.0f, 0.0, 1.0f, 0.0f);
+  
   skyMaterial->select();
-  glPushMatrix();
-  glTranslatef(this->sphereCenter.x,this->sphereCenter.y,this->sphereCenter.z);
-  
-  glRotatef(-30, 1, 0, 0);
-  glRotatef(95.0f, 0.0f, 0.0f, 1.0f);
-  glRotatef(-250.0f, 0.0, 1.0f, 0.0f);
-  
-  gluSphere(sphereObj, sphereRadius, 20, 20);
+  gluSphere(this->sphereObj, this->sphereRadius, 20, 20);
   glPopMatrix();
-  glDisable(GL_TEXTURE_2D);
 }
+
+
+/**
+   \brief sets the Radius of the Sphere.
+   \param radius The Radius of The Sphere
+*/
+void Skysphere::setRadius(float radius)
+{
+  this->sphereRadius = radius;
+}
Index: orxonox/branches/levelloader/src/world_entities/skysphere.h
===================================================================
--- orxonox/branches/levelloader/src/world_entities/skysphere.h	(revision 3604)
+++ orxonox/branches/levelloader/src/world_entities/skysphere.h	(revision 3605)
@@ -15,4 +15,5 @@
 /* INCLUDES */
 #include "p_node.h"
+#include "world_entity.h"
 
 /* FORWARD DEFINITION */
@@ -21,5 +22,5 @@
 
 //! A Class to handle a SkySphere
-class Skysphere : public PNode 
+class Skysphere : public WorldEntity
 {
 
@@ -27,19 +28,17 @@
   Skysphere();
   Skysphere(char* fileName);
-  ~Skysphere();
+  virtual ~Skysphere();
+  void destroy();
 
   void setRadius(float radius);
   void setTexture(char* fileName);
 
-  void updatePosition(Vector sphereCenter);
-  void draw();
+  virtual void draw();
 
  private: 
   GLUquadricObj *sphereObj; //!< A Placeholder for the SkySphere.
   Material *skyMaterial;    //!< A Material for the SkySphere.
-  Vector sphereCenter;      //!< Center of the SkySphere.
   float sphereRadius;       //!< Radius of the SkySphere. This should match the frustum maximum range.
-
-
+    
   void initialize(char* fileName);  
 };
Index: orxonox/branches/levelloader/src/world_entities/terrain.cc
===================================================================
--- orxonox/branches/levelloader/src/world_entities/terrain.cc	(revision 3605)
+++ orxonox/branches/levelloader/src/world_entities/terrain.cc	(revision 3605)
@@ -0,0 +1,271 @@
+/* 
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   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 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Benjamin Grauer
+   co-programmer: ...
+*/
+
+
+#include "terrain.h"
+
+#include "glincl.h"
+
+using namespace std;
+
+
+/**
+   \brief standard constructor
+
+*/
+Terrain::Terrain () 
+{
+  this->init();
+}
+
+/**
+   \brief Constructor for loading a Terrain out of a file
+   \param fileName The file to load data from.
+ 
+   this either loads out of an OBJ-file, or loads a heightmap if no .obj-extension is found.
+*/
+Terrain::Terrain(char* fileName)
+{
+  this->init();
+
+  if (strstr(fileName, ".obj") || strstr(fileName, ".OBJ"))
+    {
+      this->model = (OBJModel*)new OBJModel(fileName);
+    }
+  else
+    {
+      // load the hightMap here.
+    }
+}
+
+/**
+   \brief a Constructor for the Debug-Worlds
+
+   \todo make it not compileable when not in debug-mode
+*/
+Terrain::Terrain(DebugTerrain debugTerrain)
+{
+  this->init();
+  this->buildDebugTerrain(debugTerrain);
+}
+
+/**
+   \brief standard deconstructor
+
+*/
+Terrain::~Terrain () 
+{
+  if (objectList)
+    glDeleteLists(this->objectList, 1);
+}
+
+
+void Terrain::init(void)
+{
+   this->setClassName ("Terrain");
+
+   this->objectList = 0;
+}
+
+
+
+void Terrain::draw ()
+{ 
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+  float matrix[4][4];
+  
+  /* translate */
+  glTranslatef (this->getAbsCoor ().x, 
+		this->getAbsCoor ().y, 
+		this->getAbsCoor ().z);
+  /* rotate */
+  this->getAbsDir ().matrix (matrix);
+  glMultMatrixf((float*)matrix);
+
+  if (objectList)
+    glCallList(objectList);
+  else if (model)
+    model->draw();
+  //  this->model->draw();
+  glPopMatrix();
+}
+
+
+void Terrain::buildDebugTerrain(DebugTerrain debugTerrain)
+{
+  // if the terrain is the Terrain of Dave
+  if (debugTerrain == TERRAIN_DAVE)
+    {
+      objectList = glGenLists(1);
+      glNewList (objectList, GL_COMPILE);
+      
+      glColor3f(1.0,0,0);
+      
+      int sizeX = 100;
+      int sizeZ = 80;
+      float length = 1000;
+      float width = 200;
+      float widthX = float (length /sizeX);
+      float widthZ = float (width /sizeZ);
+      
+      float height [sizeX][sizeZ];
+      Vector normal_vectors[sizeX][sizeZ];
+      
+      
+      for ( int i = 0; i<sizeX-1; i+=1)
+	for (int j = 0; j<sizeZ-1;j+=1)
+	  //height[i][j] = rand()/20046 + (j-25)*(j-25)/30;
+#ifdef __WIN32__
+	  height[i][j]=(sin((float)j/3)*rand()*i/182400)*.5;
+#else
+      height[i][j]=(sin((float)j/3)*rand()*(long)i/6282450500.0)*.5;
+#endif
+      
+      //Die Huegel ein wenig glaetten
+      for (int h=1; h<2;h++)
+	for (int i=1;i<sizeX-2 ;i+=1 )
+	  for(int j=1;j<sizeZ-2;j+=1)
+	    height[i][j]=(height[i+1][j]+height[i][j+1]+height[i-1][j]+height[i][j-1])/4;
+      
+      //Berechnung von normalen Vektoren
+      for(int i=1;i<sizeX-2;i+=1)
+	for(int j=1;j<sizeZ-2 ;j+=1)
+	  {
+	    Vector v1 = Vector (widthX*(1),      height[i][j],      widthZ*(j) );
+	    Vector v2 = Vector (widthX*(i-1),    height[i-1][j],    widthZ*(j));
+	    Vector v3 = Vector (widthX*(i),      height[i][j+1],    widthZ*(j+1));
+	    Vector v4 = Vector (widthX*(i+1),    height[i+1][j],    widthZ*(j));
+	    Vector v5 = Vector (widthX*(i),      height[i][j-1],    widthZ*(j-1));
+	    
+	    Vector c1 = v2 - v1;
+	    Vector c2 = v3 - v1;
+	    Vector c3=  v4 - v1;
+	    Vector c4 = v5 - v1;
+	    Vector zero = Vector (0,0,0);
+	    normal_vectors[i][j]=c1.cross(v3-v5)+c2.cross(v4-v2)+c3.cross(v5-v3)+c4.cross(v2-v4);
+	    normal_vectors[i][j].normalize();
+	  }
+      
+      glBegin(GL_QUADS);
+      int snowheight=3;
+      for ( int i = 0; i<sizeX; i+=1)
+	for (int j = 0; j<sizeZ;j+=1)
+	  {	  
+	    Vector v1 = Vector (widthX*(i),      height[i][j]-20,       widthZ*(j)  -width/2);
+	    Vector v2 = Vector (widthX*(i+1),    height[i+1][j]-20,     widthZ*(j)  -width/2);
+	    Vector v3 = Vector (widthX*(i+1),    height[i+1][j+1]-20,   widthZ*(j+1)-width/2);
+	    Vector v4 = Vector (widthX*(i),      height[i][j+1]-20,     widthZ*(j+1)-width/2);
+	    float a[3];
+	    if(height[i][j]<snowheight){
+	      a[0]=0;
+	      a[1]=1.0-height[i][j]/10-.3;
+	      a[2]=0;
+	      glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
+	    }
+	    else{
+	      a[0]=1.0;
+	      a[1]=1.0;
+	      a[2]=1.0;
+	      glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
+	      
+	    }
+	    glNormal3f(normal_vectors[i][j].x, normal_vectors[i][j].y, normal_vectors[i][j].z);
+	    glVertex3f(v1.x, v1.y, v1.z);
+	    if(height[i+1][j]<snowheight){
+	      a[0]=0;
+	      a[1] =1.0-height[i+1][j]/10-.3;
+	      a[2]=0;
+	      glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
+	    }
+	    else{
+	      a[0]=1.0;
+	      a[1]=1.0;
+	      a[2]=1.0;
+	      glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
+	      
+	    }
+	    glNormal3f(normal_vectors[i+1][j].x, normal_vectors[i+1][j].y, normal_vectors[i+1][j].z);
+	    glVertex3f(v2.x, v2.y, v2.z);
+	    if(height[i+1][j+1]<snowheight){
+	      a[0]=0;
+	      a[1] =1.0-height[i+1][j+1]/10-.3;
+	      a[2]=0;
+	      glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
+	    }
+	    else{
+	      a[0]=1.0;
+	      a[1]=1.0;
+	      a[2]=1.0;
+	      glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
+	      
+	      
+	    }
+	    glNormal3f(normal_vectors[i+1][j+1].x, normal_vectors[i+1][j+1].y, normal_vectors[i+1][j+1].z);
+	    glVertex3f(v3.x, v3.y, v3.z);
+	    if(height[i][j+1]<snowheight){
+	      a[0]=0;
+	      a[1] =1.0-height[i+1][j+1]/10-.3;
+	      a[2]=0;
+	      glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
+	    }
+	    else{
+	      a[0]=1.0;
+	      a[1]=1.0;
+	      a[2]=1.0;
+	      glMaterialfv(GL_FRONT,GL_DIFFUSE,a);
+	    }
+	    glNormal3f(normal_vectors[i][j+1].x, normal_vectors[i][j+1].y, normal_vectors[i][j+1].z);
+	    glVertex3f(v4.x, v4.y, v4.z);
+	    
+	  }
+      glEnd();
+      glEndList();
+    }
+
+  if (debugTerrain == TERRAIN_BENSCH)
+    {
+      /*
+	this->model = (OBJModel*) new Model();
+      this->model->setName("CUBE");
+      this->model->addVertex (-0.5, -0.5, 0.5);
+      this->model->addVertex (0.5, -0.5, 0.5);
+      this->model->addVertex (-0.5, 0.5, 0.5);
+      this->model->addVertex (0.5, 0.5, 0.5);
+      this->model->addVertex (-0.5, 0.5, -0.5);
+      this->model->addVertex (0.5, 0.5, -0.5);
+      this->model->addVertex (-0.5, -0.5, -0.5);
+      this->model->addVertex (0.5, -0.5, -0.5);
+      
+      this->model->addVertexTexture (0.0, 0.0);
+      this->model->addVertexTexture (1.0, 0.0);
+      this->model->addVertexTexture (0.0, 1.0);
+      this->model->addVertexTexture (1.0, 1.0);
+      this->model->addVertexTexture (0.0, 2.0);
+      this->model->addVertexTexture (1.0, 2.0);
+      this->model->addVertexTexture (0.0, 3.0);
+      this->model->addVertexTexture (1.0, 3.0);
+      this->model->addVertexTexture (0.0, 4.0);
+      this->model->addVertexTexture (1.0, 4.0);
+      this->model->addVertexTexture (2.0, 0.0);
+      this->model->addVertexTexture (2.0, 1.0);
+      this->model->addVertexTexture (-1.0, 0.0);
+      this->model->addVertexTexture (-1.0, 1.0);
+
+      this->model->finalize();
+      */
+    }
+  
+}
Index: orxonox/branches/levelloader/src/world_entities/terrain.h
===================================================================
--- orxonox/branches/levelloader/src/world_entities/terrain.h	(revision 3605)
+++ orxonox/branches/levelloader/src/world_entities/terrain.h	(revision 3605)
@@ -0,0 +1,39 @@
+/*! 
+    \file terrain.h
+    \brief Defines and handles the terrain of the World
+
+    \todo implement it
+
+    The terrain should either be build from a Model a OBJModel or from a HeightMap.
+*/
+
+#ifndef _TERRAIN_H
+#define _TERRAIN_H
+
+#include "world_entity.h"
+
+// FORWARD DEFINITION \\
+
+//! A simple method to call a desired debug world.
+enum DebugTerrain {TERRAIN_DAVE, TERRAIN_BENSCH};
+
+
+//! A Class to handle Terrain of orxonox
+class Terrain : public WorldEntity 
+{
+
+ public:
+  Terrain();
+  Terrain(char* fileName);
+  Terrain(DebugTerrain debugTerrain);
+  virtual ~Terrain();
+  void init();
+  
+  void buildDebugTerrain(DebugTerrain debugTerrain);
+  virtual void draw();
+
+ private:
+  int objectList;
+};
+
+#endif /* _TERRAIN_H */
Index: orxonox/branches/levelloader/src/world_entities/weapon.cc
===================================================================
--- orxonox/branches/levelloader/src/world_entities/weapon.cc	(revision 3605)
+++ orxonox/branches/levelloader/src/world_entities/weapon.cc	(revision 3605)
@@ -0,0 +1,220 @@
+
+
+/* 
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   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 2, or (at your option)
+   any later version.
+
+   ### File Specific
+   main-programmer: Patrick Boenzli
+   co-programmer: 
+*/
+
+
+#include "weapon.h"
+#include "stdincl.h"
+#include "world_entity.h"
+#include "vector.h"
+#include "objModel.h"
+#include "projectile.h"
+
+using namespace std;
+
+
+/**
+   \brief standard constructor
+
+   creates a new weapon
+*/
+Weapon::Weapon () : WorldEntity()
+{}
+
+
+/**
+   \brief standard deconstructor
+*/
+Weapon::~Weapon () 
+{
+  // model will be deleted from WorldEntity-destructor
+}
+
+
+/** 
+    \brief enables the weapon
+
+    a weapon can be enabled/disabled because of various reasons. if a weapon is 
+    been enabled, it can interact in a world. elswhere it wont react to any
+    action.
+*/
+void Weapon::enable()
+{
+  this->enabled = true;
+}
+
+
+/** 
+    \brief disables the weapon
+
+    a weapon can be enabled/disabled because of various reasons. if a weapon is 
+    been enabled, it can interact in a world. elswhere it wont react to any
+    action.
+*/
+void Weapon::disable()
+{
+  this->enabled = false;
+}
+
+
+/** 
+    \brief checks if the weapon is enabled
+    \returns true if enabled
+
+    a weapon can be ebabled/disabled because of various reasons. if a weapon is 
+    been enabled, it can interact in a world. elswhere it wont react to any
+    action.
+*/
+bool Weapon::isEnabled()
+{
+  return this->enabled;
+}
+
+
+/**
+   \brief sets a new projectile to the weapon
+   \param new projectile for this weapon
+
+   weapon an projectile are independent, so you can combine them as you want
+*/
+void Weapon::setProjectile(Projectile* projectile)
+{
+  this->projectile = projectile;
+}
+
+
+/**
+   \brief sets a new projectile to the weapon
+   \returns the current projectile of this weapon
+
+   weapon an projectile are independent, so you can combine them as you want
+*/
+Projectile* Weapon::getProjectile()
+{
+  return this->projectile;
+}
+
+
+/**
+   \brief this activates the weapon
+
+   This is needed, since there can be more than one weapon on a ship. the 
+   activation can be connected with an animation. for example the weapon is 
+   been armed out. 
+*/
+void Weapon::activate()
+{}
+
+
+/**
+   \brief this deactivates the weapon
+
+   This is needed, since there can be more than one weapon on a ship. the 
+   activation can be connected with an animation. for example the weapon is 
+   been armed out.
+*/
+void Weapon::deactivate()
+{}
+
+/**
+   \brief asks if the current weapon is active
+   \returns true if it the weapon is active
+*/
+bool Weapon::isActive()
+{}
+
+/**
+   \brief sets a weapon idle time
+   \param idle time in ms
+
+   a weapon idle time is the time spend after a shoot until the weapon can
+   shoot again
+*/
+void Weapon::setWeaponIdleTime(float time)
+{}
+
+/**
+   \brief gets the weapon idle time
+   \returns idle time in ms
+
+   a weapon idle time is the time spend after a shoot until the weapon can
+   shoot again
+*/
+float Weapon::getWeaponIdleTime(void)
+{}
+
+/**
+   \brief checks if the idle time is elapsed
+   \return true if time is elapsed
+
+   a weapon idle time is the time spend after a shoot until the weapon can
+   shoot again
+*/
+bool Weapon::hasWeaponIdleTimeElapsed(void)
+{}
+
+
+/**
+   \brief fires the weapon
+   
+   this is called from the player.cc, when fire-button is been pushed
+*/
+void Weapon::fire()
+{}
+
+
+/**
+   \brief is called, when the weapon gets hit (=collide with something)
+   \param from which entity it is been hit
+   \param where it is been hit
+
+   this may not be used, since it would make the game relay complicated when one
+   can destroy the weapons of enemies or vice versa.
+*/
+void Weapon::hit (WorldEntity* entity, Vector* position) 
+{}
+
+
+/**
+   \brief is called, when the weapon is destroyed
+
+   this is in conjunction with the hit function, so when a weapon is able to get
+   hit, it can also be destoryed.
+*/
+void Weapon::destroy () 
+{}
+
+
+/**
+   \brief tick signal for time dependent/driven stuff
+*/
+void Weapon::tick (float time) 
+{}
+
+
+/**
+   \brief is called, when there is no fire button pressed
+*/
+void Weapon::weaponIdle()
+{}
+
+
+/**
+   \brief this will draw the weapon
+*/
+void Weapon::draw () 
+{}
+
Index: orxonox/branches/levelloader/src/world_entities/weapon.h
===================================================================
--- orxonox/branches/levelloader/src/world_entities/weapon.h	(revision 3605)
+++ orxonox/branches/levelloader/src/world_entities/weapon.h	(revision 3605)
@@ -0,0 +1,81 @@
+/*! 
+    \file weapon.h
+    \brief a weapon that a player can use
+
+    A Player has a list of weapons, that can be choosen to shoot projectiles
+    (projectiles.{cc,h}) at ennemies. These weapons can be shooted sequentially
+    or (if able) combined. Therefore you can choose the weapon mode = choose
+    a weapon.
+
+    A weapon is characterized by:
+     o firing-rate: the initial firing rate of a weapon (1/s = Herz)
+     o slowdown-factor: this is a factor d: exp(-d*x), d is element of all positive R. it determines how fast the firing-rate will slow down. if no slowdown: d=0, the bigger d is, the faster the weapon will slow down!
+     o energy-consumption: this determines the energy that has to be used to produce this projectile = costs per projectile
+    
+    Furthermore there are some other attributes, that will help to represent a firing
+    weapon in this world:
+     o sound file/ressource: this is a pointer to the sound-file/ressource. however it may be represented
+     o shooting animation
+     
+*/
+
+
+#ifndef _WEAPON_H
+#define _WEAPON_H
+
+#include "world_entity.h"
+
+class Projectile;
+
+typedef enum {
+  SHOOT,
+  EMPTY,
+  RELOAD,
+  SPECIAL1,
+  SPECIAL2,
+  SPECIAL3
+} weaponSoundType;
+
+
+class Weapon : public WorldEntity 
+{
+  friend class World;
+
+ public:
+  Weapon ();
+  virtual ~Weapon ();
+  
+  void enable(void);
+  void disable(void);
+  bool isEnabled(void);
+
+  void setProjectile(Projectile* projectile);
+  Projectile* getProjectile(void);
+
+  virtual void activate(void);
+  virtual void deactivate(void);
+  bool isActive(void);
+
+  virtual void setWeaponIdleTime(float time);
+  virtual float getWeaponIdleTime(void);
+  virtual bool hasWeaponIdleTimeElapsed(void);
+
+  virtual void fire(void);
+  virtual void hit (WorldEntity* weapon, Vector* loc);
+  virtual void destroy(void);
+  
+  virtual void tick(float time);
+  virtual void weaponIdle(void);
+  virtual void draw(void);
+
+
+ private:
+  bool enabled;
+  float localTime;
+  float slowDownFactor;
+  Projectile* projectile;
+  //WeaponSound sound;
+
+};
+
+#endif /* _WEAPON_H */
Index: orxonox/branches/levelloader/src/world_entities/world_entity.cc
===================================================================
--- orxonox/branches/levelloader/src/world_entities/world_entity.cc	(revision 3604)
+++ orxonox/branches/levelloader/src/world_entities/world_entity.cc	(revision 3605)
@@ -38,4 +38,5 @@
   this->setClassName ("WorldEntity");
   this->bDraw = true;
+  this->model = NULL;
   //  collisioncluster = NULL;
 }
@@ -47,27 +48,25 @@
 {
   // if( collisioncluster != NULL) delete collisioncluster;
+  delete this->model;
 }
 
 /**
-   \brief get the Location of the WorldEntity
-   \return a pointer to location
+   \brief sets the character attributes of a worldentity
+   \param character attributes
+
+   these attributes don't have to be set, only use them, if you need them
 */
-/*PN
-Location* WorldEntity::getLocation ()
-{
-  return &loc;
-}
-*/
+void WorldEntity::setCharacterAttributes(CharacterAttributes* charAttr)
+{}
+
 
 /**
-   \brief get the Placement of the WorldEntity
-   \return a pointer to placement
+   \brief gets the Character attributes of this worldentity
+   \returns character attributes
 */
- /*PN
-Placement* WorldEntity::getPlacement ()
-{
-  return &place;
-}
- */
+CharacterAttributes* WorldEntity::getCharacterAttributes()
+{}
+
+
 /**
    \brief query whether the WorldEntity in question is free
@@ -93,14 +92,4 @@
 }
 */
-
-/**
-   \brief this method is called every frame
-   \param time: the time in seconds that has passed since the last tick
-   
-   Handle all stuff that should update with time inside this method (movement, animation, etc.)
-*/
-void WorldEntity::tick(float time) 
-{
-}
 
 
@@ -130,12 +119,4 @@
 
 /**
-   \brief the entity is drawn onto the screen with this function
-   
-   This is a central function of an entity: call it to let the entity painted to the screen. Just override this function with whatever you want to be drawn.
-*/
-void WorldEntity::draw() 
-{}
-
-/**
    \brief this function is called, when two entities collide
    \param other: the world entity with whom it collides
@@ -147,4 +128,5 @@
 void WorldEntity::collide(WorldEntity* other, Uint32 ownhitflags, Uint32 otherhitflags) {}
 
+
 /**
    \brief this function is called, when the ship is hit by a waepon
@@ -154,12 +136,5 @@
    calculate the damage depending
 */
-void WorldEntity::hit(WorldEntity* weapon, Vector loc) {}
-
-/**
-   \brief this function is called when the entity is to be destroied
-   
-   This can be called, if eg. something realy bad happens :)
-*/
-void WorldEntity::destroy() {}
+void WorldEntity::hit(WorldEntity* weapon, Vector* loc) {}
 
 
@@ -174,4 +149,36 @@
 }
 
+
+/**
+   \brief this method is called by the world if the WorldEntity leaves valid gamespace
+   
+   For free entities this means it left the Track boundaries. With bound entities it means its Location adresses a
+   place that is not in the world anymore. In both cases you might have to take extreme measures (a.k.a. call destroy).
+*/
+void WorldEntity::leftWorld ()
+{
+}
+
+
+/**
+   \brief this method is called every frame
+   \param time: the time in seconds that has passed since the last tick
+   
+   Handle all stuff that should update with time inside this method (movement, animation, etc.)
+*/
+void WorldEntity::tick(float time) 
+{
+}
+
+
+/**
+   \brief the entity is drawn onto the screen with this function
+   
+   This is a central function of an entity: call it to let the entity painted to the screen. Just override this function with whatever you want to be drawn.
+*/
+void WorldEntity::draw() 
+{}
+
+
 /**
    \brief this handles incoming command messages
@@ -184,25 +191,2 @@
 {
 }
-
-/**
-   \brief this is called by the local Camera to determine the point it should look at on the WorldEntity
-   \param locbuf: a pointer to the buffer to fill with a location to look at
-	
-   You may put any Location you want into locbuf, the Camera will determine via the corresponding Track how
-   to look at the location you return with this.
-*/
-/*PN
-void WorldEntity::getLookat (Location* locbuf)
-{
-}
-*/
-
-/**
-   \brief this method is called by the world if the WorldEntity leaves valid gamespace
-   
-   For free entities this means it left the Track boundaries. With bound entities it means its Location adresses a
-   place that is not in the world anymore. In both cases you might have to take extreme measures (a.k.a. call destroy).
-*/
-void WorldEntity::leftWorld ()
-{
-}
Index: orxonox/branches/levelloader/src/world_entities/world_entity.h
===================================================================
--- orxonox/branches/levelloader/src/world_entities/world_entity.h	(revision 3604)
+++ orxonox/branches/levelloader/src/world_entities/world_entity.h	(revision 3605)
@@ -9,7 +9,9 @@
 #include "stdincl.h"
 #include "p_node.h"
+#include "objModel.h"
 
 //class CollisionCluster;
-class OBJModel;
+class CharacterAttributes;
+
 
 //! Basic class from which all interactive stuff in the world is derived from
@@ -22,17 +24,20 @@
   virtual ~WorldEntity ();
 
-  OBJModel* model;                  //!< The model that should be loaded for this entity.
+
+
   
   //void setCollision (CollisionCluster* newhull);
   
-  bool isFree ();
-  
   //void addAbility(Ability* ability);
   //void removeAbility(Ability* ability);
-  
+  void setDrawable (bool bDraw);  
+  bool isFree ();
+  void setCharacterAttributes(CharacterAttributes* charAttr);
+  CharacterAttributes* getCharacterAttributes();
+
   virtual void postSpawn ();
-  virtual void tick (float time);
-  virtual void hit (WorldEntity* weapon, Vector loc);
-  virtual void destroy ();
+  virtual void leftWorld ();
+
+  virtual void hit (WorldEntity* weapon, Vector* loc);
   virtual void collide (WorldEntity* other,  Uint32 ownhitflags, Uint32 otherhitflags);
   virtual void command (Command* cmd);
@@ -40,7 +45,9 @@
   void processDraw ();
   virtual void draw ();
-  void setDrawable (bool bDraw);
+  virtual void tick (float time);
   
-  virtual void leftWorld ();
+ protected:
+  OBJModel* model;                  //!< The model that should be loaded for this entity.
+  CharacterAttributes* charAttr;      //!< the character attributes of a world_entity
   
  private:
@@ -49,4 +56,6 @@
   bool bDraw;                         //!< If it should be visible.
 
+
+
   //CollisionCluster* collisioncluster; //!< The collision-Cluster of this entity.
 };
