Index: orxonox/branches/buerli/src/camera.cc
===================================================================
--- orxonox/branches/buerli/src/camera.cc	(revision 2707)
+++ orxonox/branches/buerli/src/camera.cc	(revision 3238)
@@ -30,19 +30,19 @@
 {
   this->world = world;
-  bound = NULL;
+  this->bound = NULL;
   /* give it some physical live */
-  m = 10;
-  a = new Vector(0.0, 0.0, 0.0);
-  v = new Vector(0.0, 0.0, 0.0);
-  fs = new Vector(0.0, 0.0, 0.0);
-  cameraMode = NORMAL;
-  deltaTime = 3000.0;
-  cameraOffset = 1.0;
-  cameraOffsetZ = 10.0;
-  t = 0.0;
-
-  actual_place.r.x = 0.0;
-  actual_place.r.y = 10.0;
-  actual_place.r.z = -5.0;
+  this->m = 10;
+  this->a = new Vector(0.0, 0.0, 0.0);
+  this->v = new Vector(0.0, 0.0, 0.0);
+  this->fs = new Vector(0.0, 0.0, 0.0);
+  this->cameraMode = NORMAL;
+  this->deltaTime = 3000.0;
+  this->cameraOffset = 1.0;
+  this->cameraOffsetZ = 10.0;
+  this->t = 0.0;
+
+  this->actualPlace.r.x = 0.0;
+  this->actualPlace.r.y = 10.0;
+  this->actualPlace.r.z = -5.0;
 }
 
@@ -61,11 +61,11 @@
    as smooth camera movement or swaying).
 */
-void Camera::time_slice (Uint32 deltaT)
-{
-  if(t <= deltaTime)
-    {t += deltaT;}
+void Camera::timeSlice (Uint32 deltaT)
+{
+  if( this->t <= deltaTime)
+    {this->t += deltaT;}
   //printf("time is: t=%f\n", t );
-  update_desired_place ();
-  jump (NULL);
+  updateDesiredPlace();
+  jump(NULL);
 }
 
@@ -76,5 +76,5 @@
    bound entity's position on the track.
 */
-void Camera::update_desired_place ()
+void Camera::updateDesiredPlace ()
 {
   switch(cameraMode)
@@ -89,6 +89,6 @@
 	if( bound != NULL)
 	  {
-	    bound->get_lookat (&lookat);
-	    orx->get_world()->calc_camera_pos (&lookat, &plFocus);
+	    bound->getLookat (&lookat);
+	    orx->getWorld()->calcCameraPos (&lookat, &plFocus);
 	    Quaternion *fr;
 	    if(t < 20.0)
@@ -101,5 +101,5 @@
 		
 		Vector op(1.0, 0.0, 0.0);
-		float angle = angle_deg(op, *start);
+		float angle = angleDeg(op, *start);
 		printf("angle is: %f\n", angle);
 
@@ -144,7 +144,7 @@
 
 	    Vector ursp(0.0, 0.0, 0.0);
-	    desired_place.r = /*plFocus.r -*/ ursp - res->apply(r); 
-
-	    printf("desired place is: %f, %f, %f\n", desired_place.r.x, desired_place.r.y, desired_place.r.z);
+	    desiredPlace.r = /*plFocus.r -*/ ursp - res->apply(r); 
+
+	    printf("desired place is: %f, %f, %f\n", desiredPlace.r.x, desiredPlace.r.y, desiredPlace.r.z);
 	    //plLastBPlace = *bound->get_placement();
 	  } 
@@ -153,12 +153,12 @@
     case SMOTH_FOLLOW:
       {
-	Placement *plBound = bound->get_placement();
+	Placement *plBound = bound->getPlacement();
 	Location lcBound;
 	if(bound != null)
 	  {
-	    bound->get_lookat(&lcBound);
+	    bound->getLookat(&lcBound);
 	    Vector vDirection(0.0, 0.0, 1.0);
 	    vDirection = plBound->w.apply(vDirection);
-	    desired_place.r = (vDirection * ((lcBound.dist-10.0)/* / l*/)) + Vector(0,0,5.0);
+	    desiredPlace.r = (vDirection * ((lcBound.dist-10.0)/* / l*/)) + Vector(0,0,5.0);
 	  }
 	break;
@@ -169,9 +169,9 @@
 	if(bound != null)
 	  {
-	    Placement *plBound = bound->get_placement();
+	    Placement *plBound = bound->getPlacement();
 	    Vector vDirection(0.0, 0.0, 1.0);
 	    Vector eclipticOffset(0.0, 0.0, 5.0);
 	    vDirection = plBound->w.apply(vDirection);
-	    desired_place.r = plBound->r - vDirection*10 + eclipticOffset;
+	    desiredPlace.r = plBound->r - vDirection*10 + eclipticOffset;
 	  }
 	break;
@@ -182,11 +182,11 @@
       if( bound != NULL && world != NULL )
 	{
-	  bound->get_lookat (&lookat);
-	  world->calc_camera_pos (&lookat, &desired_place);
+	  bound->getLookat (&lookat);
+	  world->calcCameraPos (&lookat, &desiredPlace);
 	} 
       else
 	{
-	  desired_place.r = Vector (0,0,0);
-	  desired_place.w = Quaternion (); 
+	  desiredPlace.r = Vector (0,0,0);
+	  desiredPlace.w = Quaternion (); 
 	}
       break;
@@ -206,5 +206,7 @@
   // view
   // TO DO: implement options for frustum generation
-  glFrustum(-1.0, 1.0, -1.0, 1.0, 1.5, 250.0);
+  //glFrustum(-1.0, 1.0, -1.0, 1.0, 1.5, 250.0);
+  gluPerspective(60, 1.2f, 0.1, 250);
+  
   //Vector up(0,0,1);
   //Vector dir(1,0,0);
@@ -235,14 +237,14 @@
   // rotation
   float matrix[4][4];
-  actual_place.w.conjugate().matrix (matrix);
+  actualPlace.w.conjugate().matrix (matrix);
   /* orientation and */
   glMultMatrixf ((float*)matrix);
   /*  translation */
-  glTranslatef (-actual_place.r.x, -actual_place.r.y,- actual_place.r.z);
-  //Placement *plBound = bound->get_placement();
+  glTranslatef (-actualPlace.r.x, -actualPlace.r.y,- actualPlace.r.z);
+//Placement *plBound = bound->get_placement();
 
   // ===== second camera control calculation option
   /*
-    gluLookAt(actual_place.r.x, actual_place.r.y, actual_place.r.z, 
+   gluLookAt(actual_place.r.x, actual_place.r.y, actual_place.r.z, 
               plBound->r.x, plBound->r.y, plBound->r.z,
               0.0, 0.0, 1.0);
@@ -263,11 +265,11 @@
   if( plc == NULL)
     {
-      actual_place = desired_place;
+      actualPlace = desiredPlace;
       //printf("Camera|jump: camer@ %f, %f, %f\n\n", actual_place.r.x, actual_place.r.y, actual_place.r.z);
     }
   else
     {
-      desired_place = *plc;
-      actual_place = *plc;
+      desiredPlace = *plc;
+      actualPlace = *plc;
     }
 }
@@ -277,7 +279,7 @@
   \param entity: The enitity to bind the camera to
 	
-	This sets the focus of the camera to the given entity. This means that it will use the given WorldEntity's
-	Location and get_lookat() to determine the viewpoint the camera will render from.
-	Note that you cannot bind a camera to a free entity.
+  This sets the focus of the camera to the given entity. This means that it will use the given WorldEntity's
+  Location and get_lookat() to determine the viewpoint the camera will render from.
+  Note that you cannot bind a camera to a free entity.
 */
 void Camera::bind (WorldEntity* entity)
@@ -285,8 +287,8 @@
   if( entity != NULL)
     {
-      if( entity->isFree ()) printf("Cannot bind camera to free entity");
+      if( entity->isFree()) printf("Cannot bind camera to free entity");
       else 
 	{
-	  bound = entity;
+	  this->bound = entity;
 	}
     } 
@@ -298,2 +300,13 @@
   this->world = world;
 }
+
+
+/**
+   \brief destroy, reset the camera so that it doesn't perform anything anymore
+
+*/
+void Camera::destroy()
+{
+  this->bound = NULL;
+  this->world = NULL;
+}
