[Orxonox-commit 3886] r8560 - in code/branches/dockingsystem2: data/levels src/modules/docking

dafrick at orxonox.net dafrick at orxonox.net
Tue May 24 16:33:48 CEST 2011


Author: dafrick
Date: 2011-05-24 16:33:48 +0200 (Tue, 24 May 2011)
New Revision: 8560

Modified:
   code/branches/dockingsystem2/data/levels/docking.oxw
   code/branches/dockingsystem2/src/modules/docking/Dock.cc
   code/branches/dockingsystem2/src/modules/docking/DockToShip.cc
   code/branches/dockingsystem2/src/modules/docking/DockingController.cc
   code/branches/dockingsystem2/src/modules/docking/DockingTarget.cc
Log:
Some cleanup.


Modified: code/branches/dockingsystem2/data/levels/docking.oxw
===================================================================
--- code/branches/dockingsystem2/data/levels/docking.oxw	2011-05-24 12:50:24 UTC (rev 8559)
+++ code/branches/dockingsystem2/data/levels/docking.oxw	2011-05-24 14:33:48 UTC (rev 8560)
@@ -1,6 +1,6 @@
 <LevelInfo
  name = "Transporter"
- description = "Level with a Transporter. Demostrates the docking system."
+ description = "Level with a Transporter. Demonstrates the docking system."
  tags = ""
 />
 
@@ -26,8 +26,6 @@
 
     <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" />
 
-
-
     <?lua for i = 1, 10, 1 do ?>
       <SpawnPoint position="<?lua print(math.random() * 200 - 100) ?>,<?lua print(math.random() * 200 - 100) ?>,<?lua print(math.random() * 200 - 100) ?>" lookat="0,0,0" spawnclass="SpaceShip" pawndesign="spaceshipassff" />
     <?lua end ?>
@@ -112,8 +110,8 @@
                 </execute>
             </events>
             <attached>
-                <DistanceTrigger position="0,0,0" distance="30" target="Pawn" beaconMode="exclude" targetname="bcnDestroyer" name="dockMe" />
-                <Billboard material="Examples/Flare" colour="1.0, 0, 0" />
+                <DistanceTrigger position="0,0,-200" distance="30" target="Pawn" beaconMode="exclude" targetname="bcnDestroyer" name="dockMe" />
+                <Billboard position="0,0,-200" material="Examples/Flare" colour="1.0, 0, 0" />
             </attached>
         </Dock>
 

Modified: code/branches/dockingsystem2/src/modules/docking/Dock.cc
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/Dock.cc	2011-05-24 12:50:24 UTC (rev 8559)
+++ code/branches/dockingsystem2/src/modules/docking/Dock.cc	2011-05-24 14:33:48 UTC (rev 8560)
@@ -28,7 +28,7 @@
 
 /**
     @file Dock.cc
-	@brief Docking system main class
+    @brief Docking system main class
 */
 
 #include "Dock.h"
@@ -89,19 +89,19 @@
         if(pTrigger != NULL)
         {
             if(!pTrigger->isForPlayer()) {  // The PlayerTrigger is not exclusively for Pawns which means we cannot extract one.
-                COUT(2) << "Docking:execute PlayerTrigger was not triggered by a player.." << std::endl;
+                COUT(4) << "Docking:execute PlayerTrigger was not triggered by a player.." << std::endl;
                 return false;
             }
             pawn = pTrigger->getTriggeringPlayer();
         }
         else
         {
-            COUT(2) << "Docking::execute Not a player trigger, can't extract pawn from it.." << std::endl;
+            COUT(4) << "Docking::execute Not a player trigger, can't extract pawn from it.." << std::endl;
             return false;
         }
         if(pawn == NULL)
         {
-            COUT(2) << "Docking::execute Can't retrieve Pawn from Trigger. (" << trigger->getIdentifier()->getName() << ")" << std::endl;
+            COUT(4) << "Docking::execute Can't retrieve Pawn from Trigger. (" << trigger->getIdentifier()->getName() << ")" << std::endl;
             return false;
         }
 
@@ -157,7 +157,7 @@
         // Check if player is a candidate
         if(candidates.find(player) == candidates.end())
         {
-            COUT(0) << "Dock::dock Player is not a candidate!" << std::endl;
+            COUT(2) << "Dock::dock Player is not a candidate!" << std::endl;
             return false;
         }
 
@@ -176,7 +176,7 @@
     {
         if(docked.find(player) == docked.end())
         {
-            COUT(0) << "Dock::dockingAnimationFinished Player is not currently docked." << std::endl;
+            COUT(2) << "Dock::dockingAnimationFinished Player is not currently docked." << std::endl;
             return false;
         }
 
@@ -189,7 +189,7 @@
         // Check if player is docked to this Dock
         if(docked.find(player) == docked.end())
         {
-            COUT(0) << "Dock::undock Player is not docked to this Dock." << std::endl;
+            COUT(2) << "Dock::undock Player is not docked to this Dock." << std::endl;
             return false;
         }
 
@@ -207,7 +207,7 @@
     }
 
     bool Dock::undockingAnimationFinished(PlayerInfo* player) {
-        COUT(0) << "Dock::undockingAnimationFinished executed" << std::endl;
+        COUT(4) << "Dock::undockingAnimationFinished executed" << std::endl;
         return true;
     }
 

Modified: code/branches/dockingsystem2/src/modules/docking/DockToShip.cc
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/DockToShip.cc	2011-05-24 12:50:24 UTC (rev 8559)
+++ code/branches/dockingsystem2/src/modules/docking/DockToShip.cc	2011-05-24 14:33:48 UTC (rev 8560)
@@ -42,7 +42,7 @@
     DockToShip::DockToShip(BaseObject* creator) : DockingEffect(creator)
     {
         RegisterObject(DockToShip);
-        COUT(0) << "DockToShip instance created.." << endl;
+        COUT(4) << "DockToShip instance created.." << endl;
     }
 
     DockToShip::~DockToShip()
@@ -68,7 +68,7 @@
 
     bool DockToShip::docking(PlayerInfo* player)
     {
-        COUT(0) << "DockToShip::attach" << endl;
+        COUT(4) << "DockToShip::attach" << endl;
 
         DockingTarget *target = DockingEffect::findTarget(this->target);
         if (target == NULL) {
@@ -78,7 +78,7 @@
 
         ControllableEntity *dockTo = (ControllableEntity*) target->getParent();
         if (dockTo == NULL) {
-            COUT(0) << "Parent is not a ControllableEntity.." << std::endl;
+            COUT(2) << "Parent is not a ControllableEntity.." << std::endl;
             return false;
         }
 
@@ -91,7 +91,7 @@
 
     bool DockToShip::release(PlayerInfo* player)
     {
-        COUT(0) << "DockToShip::release" << endl;
+        COUT(4) << "DockToShip::release" << endl;
 
         player->stopTemporaryControl();
 

Modified: code/branches/dockingsystem2/src/modules/docking/DockingController.cc
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/DockingController.cc	2011-05-24 12:50:24 UTC (rev 8559)
+++ code/branches/dockingsystem2/src/modules/docking/DockingController.cc	2011-05-24 14:33:48 UTC (rev 8560)
@@ -92,7 +92,7 @@
 
         if (docking)
         {
-            COUT(0) << "DockingController::takeControl Taking over control." << std::endl;
+            COUT(4) << "DockingController::takeControl Taking over control." << std::endl;
 
             entity->setDestroyWhenPlayerLeft(false);
             player->pauseControl();
@@ -103,15 +103,15 @@
 
     void DockingController::positionReached()
     {
-        COUT(0) << "DockingController::positionReached() called." << std::endl;
+        COUT(4) << "DockingController::positionReached() called." << std::endl;
 
         assert(this->player);
         assert(this->dock);
 
         // stop spaceship
-        dock->attach(entity);
+        entity->setPosition(dock->getWorldPosition());
         entity->setVelocity(0, 0, 0);
-        entity->setOrientation(dock->getOrientation());
+        entity->setOrientation(dock->getWorldOrientation());
 
         // give control back to player
         player->startControl(entity);

Modified: code/branches/dockingsystem2/src/modules/docking/DockingTarget.cc
===================================================================
--- code/branches/dockingsystem2/src/modules/docking/DockingTarget.cc	2011-05-24 12:50:24 UTC (rev 8559)
+++ code/branches/dockingsystem2/src/modules/docking/DockingTarget.cc	2011-05-24 14:33:48 UTC (rev 8560)
@@ -28,7 +28,7 @@
 
 /**
     @file DockingTarget.cc
-	@brief Docking system main class
+    @brief Docking system main class
 */
 
 #include "DockingTarget.h"
@@ -54,7 +54,7 @@
         SUPER(DockingTarget, XMLPort, xmlelement, mode);
         XMLPortParam(DockingTarget, "name", setName, getName, xmlelement, mode);
 
-        COUT(0) << "DockingTarget with name '" << this->getName() << "' created.." << std::endl;
+        COUT(4) << "DockingTarget with name '" << this->getName() << "' created.." << std::endl;
     }
 
 




More information about the Orxonox-commit mailing list