Index: /orxonox/branches/physics/src/subprojects/particles/Makefile.am
===================================================================
--- /orxonox/branches/physics/src/subprojects/particles/Makefile.am	(revision 4296)
+++ /orxonox/branches/physics/src/subprojects/particles/Makefile.am	(revision 4297)
@@ -41,4 +41,5 @@
 		  $(MAINSRCDIR)/lib/graphics/particles/particle_emitter.cc \
 		  $(MAINSRCDIR)/util/state.cc \
+		  $(MAINSRCDIR)/world_entities/camera.cc \
 	  	  $(MAINSRCDIR)/lib/graphics/importer/model.cc \
 		  $(MAINSRCDIR)/lib/graphics/importer/objModel.cc \
Index: /orxonox/branches/physics/src/subprojects/particles/Makefile.in
===================================================================
--- /orxonox/branches/physics/src/subprojects/particles/Makefile.in	(revision 4296)
+++ /orxonox/branches/physics/src/subprojects/particles/Makefile.in	(revision 4297)
@@ -55,7 +55,7 @@
 am_particles_OBJECTS = framework.$(OBJEXT) particle_engine.$(OBJEXT) \
 	particle_system.$(OBJEXT) particle_emitter.$(OBJEXT) \
-	state.$(OBJEXT) model.$(OBJEXT) objModel.$(OBJEXT) \
-	primitive_model.$(OBJEXT) array.$(OBJEXT) material.$(OBJEXT) \
-	texture.$(OBJEXT) graphics_engine.$(OBJEXT) \
+	state.$(OBJEXT) camera.$(OBJEXT) model.$(OBJEXT) \
+	objModel.$(OBJEXT) primitive_model.$(OBJEXT) array.$(OBJEXT) \
+	material.$(OBJEXT) texture.$(OBJEXT) graphics_engine.$(OBJEXT) \
 	base_object.$(OBJEXT) vector.$(OBJEXT) \
 	resource_manager.$(OBJEXT) text_engine.$(OBJEXT) \
@@ -67,5 +67,5 @@
 am__depfiles_maybe = depfiles
 @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/array.Po \
-@AMDEP_TRUE@	./$(DEPDIR)/base_object.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/base_object.Po ./$(DEPDIR)/camera.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/framework.Po \
 @AMDEP_TRUE@	./$(DEPDIR)/graphics_engine.Po \
@@ -208,4 +208,5 @@
 		  $(MAINSRCDIR)/lib/graphics/particles/particle_emitter.cc \
 		  $(MAINSRCDIR)/util/state.cc \
+		  $(MAINSRCDIR)/world_entities/camera.cc \
 	  	  $(MAINSRCDIR)/lib/graphics/importer/model.cc \
 		  $(MAINSRCDIR)/lib/graphics/importer/objModel.cc \
@@ -291,4 +292,5 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/array.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base_object.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/camera.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/framework.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/graphics_engine.Po@am__quote@
@@ -387,4 +389,20 @@
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o state.obj `if test -f '$(MAINSRCDIR)/util/state.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/util/state.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/util/state.cc'; fi`
+
+camera.o: $(MAINSRCDIR)/world_entities/camera.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT camera.o -MD -MP -MF "$(DEPDIR)/camera.Tpo" -c -o camera.o `test -f '$(MAINSRCDIR)/world_entities/camera.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/world_entities/camera.cc; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/camera.Tpo" "$(DEPDIR)/camera.Po"; else rm -f "$(DEPDIR)/camera.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(MAINSRCDIR)/world_entities/camera.cc' object='camera.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/camera.Po' tmpdepfile='$(DEPDIR)/camera.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 camera.o `test -f '$(MAINSRCDIR)/world_entities/camera.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/world_entities/camera.cc
+
+camera.obj: $(MAINSRCDIR)/world_entities/camera.cc
+@am__fastdepCXX_TRUE@	if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT camera.obj -MD -MP -MF "$(DEPDIR)/camera.Tpo" -c -o camera.obj `if test -f '$(MAINSRCDIR)/world_entities/camera.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/world_entities/camera.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/world_entities/camera.cc'; fi`; \
+@am__fastdepCXX_TRUE@	then mv -f "$(DEPDIR)/camera.Tpo" "$(DEPDIR)/camera.Po"; else rm -f "$(DEPDIR)/camera.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$(MAINSRCDIR)/world_entities/camera.cc' object='camera.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	depfile='$(DEPDIR)/camera.Po' tmpdepfile='$(DEPDIR)/camera.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 camera.obj `if test -f '$(MAINSRCDIR)/world_entities/camera.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/world_entities/camera.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/world_entities/camera.cc'; fi`
 
 model.o: $(MAINSRCDIR)/lib/graphics/importer/model.cc
Index: /orxonox/branches/physics/src/subprojects/particles/framework.cc
===================================================================
--- /orxonox/branches/physics/src/subprojects/particles/framework.cc	(revision 4296)
+++ /orxonox/branches/physics/src/subprojects/particles/framework.cc	(revision 4297)
@@ -25,26 +25,26 @@
 #include "graphics_engine.h"
 #include "resource_manager.h"
-
-
+#include "camera.h"
 
 int verbose;
 
-bool mainLoop()
+bool Framework::mainLoop()
 {
   while(true)
     {
+      // keyhandler returns false if sdl gets quit by some event
       if (!keyHandler())
 	return false;
 
+      // tick the scene
       float dt = tick();
+
       // Draw the scene
-      draw(dt);
-      
+      draw(dt);      
     }
-
-}
-
-
-bool draw(float dt)
+}
+
+
+bool Framework::draw(float dt)
 {
   
@@ -53,15 +53,12 @@
   glLoadIdentity(); // Reset the view
   
-  glMatrixMode(GL_PROJECTION);
-  glLoadIdentity();	
-  gluPerspective(45.0f,500/375,0.1f,dist * 5.0f);
-  gluLookAt (0, dist , dist, 0,0,0, up.x,up.y,up.z);
-  
   ParticleEngine::getInstance()->draw(dt);
+
+  camera->apply();
   
   SDL_GL_SwapBuffers(); // Swap the buffers
 
 }
-float tick()
+float Framework::tick()
 {
   currFrame = SDL_GetTicks();
@@ -82,5 +79,5 @@
 
 
-bool keyHandler()
+bool Framework::keyHandler()
 {
   // This is the main loop for the entire program and it will run until done==TRUE
@@ -213,8 +210,6 @@
 
 
-int main(int argc, char *argv[])
-{
-  verbose = 3;
-
+ Framework::Framework()
+{
 
   // Create a new OpenGL window with the title "Cone3D Basecode" at
@@ -268,10 +263,10 @@
   ParticleSystem* system = new ParticleSystem(100000, PARTICLE_SPRITE);
   system->setLifeSpan(5);
-  system->setConserve(.8);
+  system->setConserve(1);
   system->setRadius(4, 3, 1, 2);
   system->setColor(.5,0,0,.5, 1,1,0,1, 0,0,0,0);
 
   // Creating a Test Particle Emitter
-  ParticleEmitter* emitter = new ParticleEmitter(Vector(0 , 0, -1), 0, 100, 1);
+  ParticleEmitter* emitter = new ParticleEmitter(Vector(0 , 1, 0), 0, 100, .01);
   emitter->setType(EMITTER_DOT  );
   emitter->setSize(0);
@@ -281,5 +276,5 @@
   ParticleEngine::getInstance()->addConnection(emitter, system);
 
-  PNode* camera = new PNode();
+  camera = new Camera();
 
   State::getInstance()->setCamera(camera, emitter);
@@ -287,8 +282,20 @@
   camera->setAbsCoor(Vector(10, 10, 0));
 
-  mainLoop();
-    
+}
+
+Framework::~Framework()
+{
+  delete GraphicsEngine::getInstance();
+
+}
+
+int main(int argc, char *argv[])
+{
+  verbose = 3;
+  Framework* framework =new Framework();
+  framework->mainLoop();
+
+  delete framework;
   // Kill the GL & SDL screens
-  delete GraphicsEngine::getInstance();
   // And quit
   return 0;
Index: /orxonox/branches/physics/src/subprojects/particles/framework.h
===================================================================
--- /orxonox/branches/physics/src/subprojects/particles/framework.h	(revision 4296)
+++ /orxonox/branches/physics/src/subprojects/particles/framework.h	(revision 4297)
@@ -5,35 +5,45 @@
 #include "glincl.h"
 
+
 #define DATA_DIRECTORY "~/svn/data/"
 
-float rotatorP;
-float rotatorV;
+class Camera;
 
-float dist;
-float zoomTo;
+class Framework {
+ private:
+  Camera* camera;
+  float rotatorP;
+  float rotatorV;
+  
+  float dist;
+  float zoomTo;
+  
+  Uint32 lastFrame;
+  Uint32 currFrame;
+  
+  Vector dir;
+  Vector up;
+  
+  float matQ[4][4];
+  
+  Vector M;
+  Vector p1;
+  Vector p2;
+  Vector rotAxis;
+  float rotAngle;
+  Quaternion rotQ;
+  Quaternion rotQlast;
+  
+  Uint8* keys; // This variable will be used in the keyboard routine
+  bool mouse1Down;
 
-Uint32 lastFrame;
-Uint32 currFrame;
-
-Vector dir;
-Vector up;
-
-float matQ[4][4];
-
-Vector M;
-Vector p1;
-Vector p2;
-Vector rotAxis;
-float rotAngle;
-Quaternion rotQ;
-Quaternion rotQlast;
-
-Uint8* keys; // This variable will be used in the keyboard routine
-bool mouse1Down;
-
-bool mainLoop();
-bool draw(float dt);
-float tick();
-bool keyHandler();
-
+ public:
+  Framework();
+  ~Framework();
+  
+  bool mainLoop();
+  bool draw(float dt);
+  float tick();
+  bool keyHandler();
+};
 #endif /* _FRAMEWORK_H */
