[Orxonox-commit 5124] r9789 - in code/branches/spacestationentry: data/levels src/modules/docking

agermann at orxonox.net agermann at orxonox.net
Mon Nov 18 16:05:56 CET 2013


Author: agermann
Date: 2013-11-18 16:05:55 +0100 (Mon, 18 Nov 2013)
New Revision: 9789

Modified:
   code/branches/spacestationentry/data/levels/dockingToASpaceStation.oxw
   code/branches/spacestationentry/src/modules/docking/Dock.cc
   code/branches/spacestationentry/src/modules/docking/Dock.h
Log:
Erstellung einer neuen Funktion execute2 in Dock.cc um ein Ausdocken zu realisieren.

Modified: code/branches/spacestationentry/data/levels/dockingToASpaceStation.oxw
===================================================================
--- code/branches/spacestationentry/data/levels/dockingToASpaceStation.oxw	2013-11-18 14:18:13 UTC (rev 9788)
+++ code/branches/spacestationentry/data/levels/dockingToASpaceStation.oxw	2013-11-18 15:05:55 UTC (rev 9789)
@@ -82,21 +82,13 @@
             <execute>
                 <EventListener event="dockMe" />
             </execute>
+	
             <activity>
                 <EventListener event=notGameEnd />
             </activity>
         </events>
         <attached>
-                    <Billboard position="0,0,0" material="Flares/ringflare2" colour="0.2,0.4,0.8" scale=1 />
-	<BlinkingBillboard position="10,0,0" material="Examples/Flare" colour="1, 0.3, 1, 0.1" amplitude=0.2 frequency=0.4 phase=0 quadratic=1 />
-	<BlinkingBillboard position="20,0,0" material="Examples/Flare" colour="1, 0.3, 1, 0.1" amplitude=0.2 frequency=0.4 phase=0 quadratic=1 />
-	<BlinkingBillboard position="30,0,0" material="Examples/Flare" colour="1, 0.3, 1, 0.1" amplitude=0.2 frequency=0.4 phase=0 quadratic=1 />
-	<BlinkingBillboard position="0,10,0" material="Examples/Flare" colour="0.3, 1, 1, 0.1" amplitude=0.2 frequency=0.4 phase=0 quadratic=1 />
-	<BlinkingBillboard position="0,20,0" material="Examples/Flare" colour="0.3, 1, 1, 0.1" amplitude=0.2 frequency=0.4 phase=0 quadratic=1 />
-	<BlinkingBillboard position="0,30,0" material="Examples/Flare" colour="0.3, 1, 1, 0.1" amplitude=0.2 frequency=0.4 phase=0 quadratic=1 />
-	<BlinkingBillboard position="0,0,10" material="Examples/Flare" colour="0.3, 0.3, 1, 1" amplitude=0.2 frequency=0.4 phase=0 quadratic=1 />
-	<BlinkingBillboard position="0,0,20" material="Examples/Flare" colour="0.3, 0.3, 1, 1" amplitude=0.2 frequency=0.4 phase=0 quadratic=1 />
-	<BlinkingBillboard position="0,0,30" material="Examples/Flare" colour="0.3, 0.3, 1, 1" amplitude=0.2 frequency=0.4 phase=0 quadratic=1 />
+            <Billboard position="0,0,0" material="Flares/ringflare2" colour="0.2,0.4,0.8" scale=1 />
             <DistanceTrigger position="0,0,0" distance="200" target="Pawn"
                 beaconMode="exclude" targetname="bcnDestroyer" name="dockMe"
             />
@@ -104,7 +96,34 @@
 
     </Dock>
 
+   <!-- Docking (Ausdocken)-->
+    <Dock position="100,-1950,100" roll=0 yaw=0 >
+        <animations>
+            <MoveToDockingTarget target="spaceShip" />
+        </animations>
+        <effects>
+            <DockToShip target="destroyer" />
+        </effects>
+        <events>
+            <execute>
+                <EventListener event="undockMe" />
+            </execute>
+	
+            <activity>
+                <EventListener event=notGameEnd />
+            </activity>
+        </events>
+        <attached>
+            <Billboard position="0,0,0" material="Flares/ringflare2" colour="0.2,0.4,0.8" scale=1 />
+            <DistanceTrigger position="0,0,0" distance="5" target="Pawn"
+                beaconMode="exclude" targetname="bcnDestroyer" name="undockMe"
+            />
+        </attached>
 
+    </Dock>
+
+	
+
     
     <!--SpaceShip
         template            = "spaceshipcollateraldamage"
@@ -144,14 +163,14 @@
 
 <!-- Schwerkraftfeld -->
 
-<ForceField position="2500,-92000,2500" mode="sphere" diameter="182000" velocity="-5000" />
-<ForceField position="2500,-92000,-2500" mode="sphere" diameter="182000" velocity="-5000" />
-<ForceField position="-2500,-92000,2500" mode="sphere" diameter="182000" velocity="-5000" />
-<ForceField position="-2500,-92000,-2500" mode="sphere" diameter="182000" velocity="-5000" />
+<ForceField position="2500,-92000,2500" mode="sphere" diameter="184000" velocity="-5000" />
+<ForceField position="2500,-92000,-2500" mode="sphere" diameter="184000" velocity="-5000" />
+<ForceField position="-2500,-92000,2500" mode="sphere" diameter="184000" velocity="-5000" />
+<ForceField position="-2500,-92000,-2500" mode="sphere" diameter="184000" velocity="-5000" />
 
-<!-- Ausgang -->
+<!-- Ausgang Trigger Falsch
 
-  <StaticEntity position="120,-1950,120" direction="0,-1,0" collisionType=static mass=100000 friction=0.01 >
+  <StaticEntity position="100,-1950,100" direction="0,-1,0" collisionType=static mass=100000 friction=0.01 >
       <attached>
         <Model position="0,0,0" mesh="cube.mesh" scale3D="4,4,4" />
       </attached>
@@ -160,7 +179,7 @@
       </collisionShapes>
   </StaticEntity>
 
-<DistanceTrigger name="ausgang" position="120,-1950,120"  target="Pawn" distance=50 stayActive="false" delay=0 />
+<DistanceTrigger name="ausgang" position="100,-1950,100"  target="Pawn" distance=50 stayActive="false" delay=0 />
     <Script code="undock" onLoad="false">
         <events>
             <trigger>
@@ -168,6 +187,7 @@
             </trigger>
         </events>
     </Script>
+-->
 
 
 

Modified: code/branches/spacestationentry/src/modules/docking/Dock.cc
===================================================================
--- code/branches/spacestationentry/src/modules/docking/Dock.cc	2013-11-18 14:18:13 UTC (rev 9788)
+++ code/branches/spacestationentry/src/modules/docking/Dock.cc	2013-11-18 15:05:55 UTC (rev 9789)
@@ -68,6 +68,7 @@
         XMLPortObject(Dock, DockingEffect, "effects", addEffect, getEffect, xmlelement, mode);
         XMLPortObject(Dock, DockingAnimation, "animations", addAnimation, getAnimation, xmlelement, mode);
         XMLPortEventSink(Dock, BaseObject, "execute", execute, xmlelement, mode);
+
     }
 
     void Dock::XMLEventPort(Element& xmlelement, XMLPort::Mode mode)
@@ -75,6 +76,8 @@
         SUPER(Dock, XMLEventPort, xmlelement, mode);
 
         XMLPortEventSink(Dock, BaseObject, "execute", execute, xmlelement, mode);
+
+   //     XMLPortEventSink(Dock, BaseObject, "execute2", execute2, xmlelement, mode);
     }
 
     bool Dock::execute(bool bTriggered, BaseObject* trigger)
@@ -119,6 +122,50 @@
         return true;
     }
 
+    /*bool Dock::execute2(bool bTriggered, BaseObject* trigger)
+        {
+    	orxout(user_warning)<<"execute2"<<endl;
+            PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger);
+            PlayerInfo* player = NULL;
+
+            // Check whether it is a player trigger and extract pawn from it
+            if(pTrigger != NULL)
+            {
+                if(!pTrigger->isForPlayer()) {  // The PlayerTrigger is not exclusively for Pawns which means we cannot extract one.
+                    orxout(verbose, context::docking) << "Docking:execute PlayerTrigger was not triggered by a player.." << endl;
+                    return false;
+                }
+                player = pTrigger->getTriggeringPlayer();
+            }
+            else
+            {
+                orxout(verbose, context::docking) << "Docking::execute Not a player trigger, can't extract pawn from it.." << endl;
+                return false;
+            }
+            if(player == NULL)
+            {
+                orxout(verbose, context::docking) << "Docking::execute Can't retrieve PlayerInfo from Trigger. (" << trigger->getIdentifier()->getName() << ")" << endl;
+                return false;
+            }
+
+            if(bTriggered)
+            {
+                // Add player to this Docks candidates
+                docked_.insert(player);
+
+                // Show docking dialog
+                this->showDockingDialogHelper(player);
+            }
+            else
+            {
+                // Remove player from candidates list
+                docked_.erase(player);
+            }
+
+            return true;
+        }
+
+*/
     void Dock::showDockingDialogHelper(PlayerInfo* player)
     {
         assert(player);
@@ -176,6 +223,7 @@
 
         if (animations_.empty())
             return dockingAnimationFinished(player);
+
         else
             DockingAnimation::invokeAnimation(true, player, animations_);
 

Modified: code/branches/spacestationentry/src/modules/docking/Dock.h
===================================================================
--- code/branches/spacestationentry/src/modules/docking/Dock.h	2013-11-18 14:18:13 UTC (rev 9788)
+++ code/branches/spacestationentry/src/modules/docking/Dock.h	2013-11-18 15:05:55 UTC (rev 9789)
@@ -61,6 +61,7 @@
 
             // Trigger interface
             bool execute(bool bTriggered, BaseObject* trigger);
+        //    bool execute2(bool bTriggered, BaseObject* trigger);
 
             // XML interface
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);




More information about the Orxonox-commit mailing list