[Orxonox-commit 2150] r6866 - in code/branches/fps: data/levels src/orxonox src/orxonox/controllers src/orxonox/worldentities src/orxonox/worldentities/pawns

freicy at orxonox.net freicy at orxonox.net
Mon May 10 12:40:50 CEST 2010


Author: freicy
Date: 2010-05-10 12:40:49 +0200 (Mon, 10 May 2010)
New Revision: 6866

Modified:
   code/branches/fps/data/levels/empty_level.oxw
   code/branches/fps/src/orxonox/Scene.cc
   code/branches/fps/src/orxonox/controllers/HumanController.cc
   code/branches/fps/src/orxonox/controllers/NewHumanController.cc
   code/branches/fps/src/orxonox/worldentities/CameraPosition.cc
   code/branches/fps/src/orxonox/worldentities/ControllableEntity.h
   code/branches/fps/src/orxonox/worldentities/pawns/CMakeLists.txt
Log:
commit by cyrill

Modified: code/branches/fps/data/levels/empty_level.oxw
===================================================================
--- code/branches/fps/data/levels/empty_level.oxw	2010-05-10 09:02:12 UTC (rev 6865)
+++ code/branches/fps/data/levels/empty_level.oxw	2010-05-10 10:40:49 UTC (rev 6866)
@@ -16,8 +16,14 @@
     ambientlight = "0.8, 0.8, 0.8"
     skybox       = "Orxonox/Starbox"
   >
-    
+  
+  <MovableEntity position="0,0,0" rotationrate="10" >
+    <attached>
+      <Model scale="100" mesh="ast2.mesh" shadow=false />
+    </attached>
+  </MovableEntity>
+        
     <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
-    <SpawnPoint position="0,0,100" spawnclass=SpaceShip pawndesign=spaceshipassff />
+    <SpawnPoint position="0,0,20" spawnclass=FpsPlayer pawndesign=spaceshipassff />
   </Scene>
 </Level>

Modified: code/branches/fps/src/orxonox/Scene.cc
===================================================================
--- code/branches/fps/src/orxonox/Scene.cc	2010-05-10 09:02:12 UTC (rev 6865)
+++ code/branches/fps/src/orxonox/Scene.cc	2010-05-10 10:40:49 UTC (rev 6866)
@@ -337,7 +337,7 @@
         // get the WorldEntity pointers
         SmartPtr<WorldEntity> object0 = static_cast<WorldEntity*>(colObj0->getUserPointer());
         SmartPtr<WorldEntity> object1 = static_cast<WorldEntity*>(colObj1->getUserPointer());
-
+	
         // false means that bullet will assume we didn't modify the contact
         bool modified = false;
         if (object0->isCollisionCallbackActive())

Modified: code/branches/fps/src/orxonox/controllers/HumanController.cc
===================================================================
--- code/branches/fps/src/orxonox/controllers/HumanController.cc	2010-05-10 09:02:12 UTC (rev 6865)
+++ code/branches/fps/src/orxonox/controllers/HumanController.cc	2010-05-10 10:40:49 UTC (rev 6866)
@@ -40,6 +40,7 @@
 
 namespace orxonox
 {
+    
     SetConsoleCommand(HumanController, moveFrontBack, true).setAsInputCommand();
     SetConsoleCommand(HumanController, moveRightLeft, true).setAsInputCommand();
     SetConsoleCommand(HumanController, moveUpDown,    true).setAsInputCommand();

Modified: code/branches/fps/src/orxonox/controllers/NewHumanController.cc
===================================================================
--- code/branches/fps/src/orxonox/controllers/NewHumanController.cc	2010-05-10 09:02:12 UTC (rev 6865)
+++ code/branches/fps/src/orxonox/controllers/NewHumanController.cc	2010-05-10 10:40:49 UTC (rev 6866)
@@ -209,7 +209,7 @@
 
                 if (!controlPaused_ )
                 {
-                    if (this->getControllableEntity() && (this->getControllableEntity()->isExactlyA(ClassByString("SpaceShip")) || this->getControllableEntity()->isExactlyA(ClassByString("Rocket"))))
+                    if (this->getControllableEntity() && (this->getControllableEntity()->isExactlyA(ClassByString("SpaceShip")) || this->getControllableEntity()->isExactlyA(ClassByString("Rocket")) || this->getControllableEntity()->isExactlyA(ClassByString("FpsPlayer"))))
                         this->showOverlays();
 
                     this->crossHairOverlay_->setPosition(Vector2(static_cast<float>(this->currentYaw_)/2*-1+.5f-overlaySize_/2, static_cast<float>(this->currentPitch_)/2*-1+.5f-overlaySize_/2));
@@ -424,7 +424,8 @@
         if (this->controlMode_ == 0 || (this->controllableEntity_ && this->controllableEntity_->isInMouseLook()))
             HumanController::yaw(value);
 
-        this->currentYaw_ = value.x;
+        if (this->getControllableEntity() && !this->getControllableEntity()->isExactlyA(ClassByString("FpsPlayer")))
+            this->currentYaw_ = value.x;
     }
 
     void NewHumanController::pitch(const Vector2& value)
@@ -433,7 +434,8 @@
         if (this->controlMode_ == 0 || (this->controllableEntity_ && this->controllableEntity_->isInMouseLook()))
             HumanController::pitch(value);
 
-        this->currentPitch_ = value.x;
+        if (this->getControllableEntity() && !this->getControllableEntity()->isExactlyA(ClassByString("FpsPlayer")))
+            this->currentPitch_ = value.x;
     }
 
     void NewHumanController::changeMode()

Modified: code/branches/fps/src/orxonox/worldentities/CameraPosition.cc
===================================================================
--- code/branches/fps/src/orxonox/worldentities/CameraPosition.cc	2010-05-10 09:02:12 UTC (rev 6865)
+++ code/branches/fps/src/orxonox/worldentities/CameraPosition.cc	2010-05-10 10:40:49 UTC (rev 6866)
@@ -64,11 +64,11 @@
 
     void CameraPosition::attachCamera(Camera* camera)
     {
-        if (!this->bDrag_)
+        
+        this->attach(camera);
+		  if (!this->bDrag_)
             camera->setDrag(false);
 
-        this->attach(camera);
-
         if (this->bDrag_)
             camera->setDrag(true);
     }

Modified: code/branches/fps/src/orxonox/worldentities/ControllableEntity.h
===================================================================
--- code/branches/fps/src/orxonox/worldentities/ControllableEntity.h	2010-05-10 09:02:12 UTC (rev 6865)
+++ code/branches/fps/src/orxonox/worldentities/ControllableEntity.h	2010-05-10 10:40:49 UTC (rev 6866)
@@ -161,6 +161,8 @@
             inline void setHudTemplate(const std::string& name)
                 { this->hudtemplate_ = name; }
 
+            Ogre::SceneNode* cameraPositionRootNode_;
+
         private:
             void setXMLController(Controller* controller);
 
@@ -207,7 +209,6 @@
             Camera* camera_;
             bool bMouseLook_;
             float mouseLookSpeed_;
-            Ogre::SceneNode* cameraPositionRootNode_;
             std::list<SmartPtr<CameraPosition> > cameraPositions_;
             CameraPosition* currentCameraPosition_;
             std::string cameraPositionTemplate_;

Modified: code/branches/fps/src/orxonox/worldentities/pawns/CMakeLists.txt
===================================================================
--- code/branches/fps/src/orxonox/worldentities/pawns/CMakeLists.txt	2010-05-10 09:02:12 UTC (rev 6865)
+++ code/branches/fps/src/orxonox/worldentities/pawns/CMakeLists.txt	2010-05-10 10:40:49 UTC (rev 6866)
@@ -1,4 +1,5 @@
 ADD_SOURCE_FILES(ORXONOX_SRC_FILES
+  FpsPlayer.cc
   Spectator.cc
   Pawn.cc
   SpaceShip.cc




More information about the Orxonox-commit mailing list