[Orxonox-commit 3925] r8599 - in code/branches/portals2: data/levels doc/api/groups src/modules/portals

anbueche at orxonox.net anbueche at orxonox.net
Thu May 26 15:44:07 CEST 2011


Author: anbueche
Date: 2011-05-26 15:44:07 +0200 (Thu, 26 May 2011)
New Revision: 8599

Modified:
   code/branches/portals2/data/levels/portals.oxw
   code/branches/portals2/doc/api/groups/Portals.dox
   code/branches/portals2/src/modules/portals/PortalEndPoint.cc
   code/branches/portals2/src/modules/portals/PortalEndPoint.h
   code/branches/portals2/src/modules/portals/PortalLink.cc
   code/branches/portals2/src/modules/portals/PortalLink.h
Log:
comments and license added

Modified: code/branches/portals2/data/levels/portals.oxw
===================================================================
--- code/branches/portals2/data/levels/portals.oxw	2011-05-26 12:56:54 UTC (rev 8598)
+++ code/branches/portals2/data/levels/portals.oxw	2011-05-26 13:44:07 UTC (rev 8599)
@@ -35,7 +35,7 @@
     </Template>
 
     <PortalEndPoint position="0,0,0" id="1" distance="40" target="MobileEntity" design="PortalDefault" reenterDelay="0"/>
-    <PortalEndPoint position="-100,0,0" id="2" distance="40" target="MobileEntity" design="PortalDefault" reenterDelay="0"/>
+    <PortalEndPoint position="-300,0,0" id="2" distance="40" target="MobileEntity" design="PortalDefault" reenterDelay="0"/>
     <PortalLink fromID="1" toID="2" />
     <PortalLink fromID="2" toID="1" />
 

Modified: code/branches/portals2/doc/api/groups/Portals.dox
===================================================================
--- code/branches/portals2/doc/api/groups/Portals.dox	2011-05-26 12:56:54 UTC (rev 8598)
+++ code/branches/portals2/doc/api/groups/Portals.dox	2011-05-26 13:44:07 UTC (rev 8599)
@@ -2,7 +2,7 @@
     @addtogroup Portals Portals
     @ingroup Modules
 
-    This module allows you to place @ref modules::PortalEndPoint "PortalEndPoints" in space and connect pairs of them with a @ref modules::PortalLink "PortalLink" in order allow fast travelling from A to B.
+    This module allows you to place @ref orxonox::PortalEndPoint "PortalEndPoints" in space and connect pairs of them with a @ref orxonox::PortalLink "PortalLink" in order to allow fast travelling from A to B.
 
     @section FastHowTo Fast HowTo: Including portals in a level
     The simplest way to use portals is show by the following piece of xml-code
@@ -52,12 +52,12 @@
     step by step
     @subsection Templates "Templates"
     In order to make @ref orxonox::PortalEndPoint "PortalEndPoints" visible in the game there must be something visible.
-    The idea above is to define or include arbitrary Templates which make a PortalEndPoint visible and later use them by setting the design attribute of a @ref orxonox::PortalEndPoint "PortalEndPoint" to the template name
+    The idea (as shown above) is to define or include arbitrary Templates which make a PortalEndPoint visible and use them later by setting the design attribute of a @ref orxonox::PortalEndPoint "PortalEndPoint" to the template name
     @subsection Parameters "Parameters"
      - position: 3d-coordinate in space
-     - distance (default: 50): distance at which a valid entity gets pulled in by the @ref orxonox::PortalEndPoint (if the end point is an entrance)
+     - distance (default: 50): distance at which a valid entity gets pulled in (if the end point is an entrance).
      - target (default: "Pawn"): the class which is able to enter this end point (if it is an entrance)
-     - design: the name of the @ref orxonox::Template "Template" above
+     - design: the name of the @ref orxonox::Template "design template"
 */
 
 /**

Modified: code/branches/portals2/src/modules/portals/PortalEndPoint.cc
===================================================================
--- code/branches/portals2/src/modules/portals/PortalEndPoint.cc	2011-05-26 12:56:54 UTC (rev 8598)
+++ code/branches/portals2/src/modules/portals/PortalEndPoint.cc	2011-05-26 13:44:07 UTC (rev 8599)
@@ -1,3 +1,31 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Andreas Büchel
+ *   Co-authors:
+ *      ...
+ *
+ */
+
 #include "PortalEndPoint.h"
 #include "core/XMLPort.h"
 #include "objects/triggers/MultiTriggerContainer.h"
@@ -63,7 +91,6 @@
         DistanceMultiTrigger * originatingTrigger = orxonox_cast<DistanceMultiTrigger *>(cont->getOriginator());
         if(originatingTrigger == 0)
         {
-            // COUT(1) << "originator no DistanceMultiTrigger\n" << std::endl;
             return true;
         }
         
@@ -105,11 +132,11 @@
     {
         this->jumpOutTimes_[entity] = std::time(0);
         this->recentlyJumpedOut_.insert(entity);
-        
+
+		// adjust
         entity->setPosition(this->getWorldPosition());
         entity->rotate(this->getWorldOrientation());
         entity->setVelocity(this->getWorldOrientation() * entity->getVelocity());
-        entity->setVelocity(entity->getVelocity() * 1.5);
     }
 
 }

Modified: code/branches/portals2/src/modules/portals/PortalEndPoint.h
===================================================================
--- code/branches/portals2/src/modules/portals/PortalEndPoint.h	2011-05-26 12:56:54 UTC (rev 8598)
+++ code/branches/portals2/src/modules/portals/PortalEndPoint.h	2011-05-26 13:44:07 UTC (rev 8599)
@@ -1,3 +1,31 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Andreas Büchel
+ *   Co-authors:
+ *      ...
+ *
+ */
+
 /**
  *  @file PortalEndPoint.h
  *  @brief Declaration of the PortalEndPoint class.
@@ -97,7 +125,7 @@
 
             int reenterDelay_;
             std::map<MobileEntity *, time_t> jumpOutTimes_;   //!< Stores the time at which a certain MobileEntity @ref jumpOut "jumped out" of this PortalEndPoint
-            std::set<MobileEntity *> recentlyJumpedOut_;
+            std::set<MobileEntity *> recentlyJumpedOut_;   //!< Stores the entities witch recently jumped out of this PortalEndPoint and haven't left the activation radius yet. This is needed in order to prevent them from beeing pulled into the PortalEndPoint they have just come out of.
     };
 
 }

Modified: code/branches/portals2/src/modules/portals/PortalLink.cc
===================================================================
--- code/branches/portals2/src/modules/portals/PortalLink.cc	2011-05-26 12:56:54 UTC (rev 8598)
+++ code/branches/portals2/src/modules/portals/PortalLink.cc	2011-05-26 13:44:07 UTC (rev 8599)
@@ -1,3 +1,31 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Andreas Büchel
+ *   Co-authors:
+ *      ...
+ *
+ */
+
 #include "PortalLink.h"
 #include "core/XMLPort.h"
 #include "objects/triggers/MultiTriggerContainer.h"
@@ -36,7 +64,6 @@
     {
         if(entrance == 0)
         {
-            // TODO COUT
             return;
         }
         
@@ -44,9 +71,7 @@
         
         if(endpoints == PortalLink::links_s.end())  // entrance has no corresponding exit
             return;
-        
+
         endpoints->second->jumpOut(entity);
     }
-
-
 }

Modified: code/branches/portals2/src/modules/portals/PortalLink.h
===================================================================
--- code/branches/portals2/src/modules/portals/PortalLink.h	2011-05-26 12:56:54 UTC (rev 8598)
+++ code/branches/portals2/src/modules/portals/PortalLink.h	2011-05-26 13:44:07 UTC (rev 8599)
@@ -1,3 +1,31 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Andreas Büchel
+ *   Co-authors:
+ *      ...
+ *
+ */
+
 /**
     @file PortalLink.h
     @brief Declaration of the PortalLink class
@@ -44,18 +72,19 @@
             {
                 return this->toID_;
             }
-            static void use(MobileEntity * entity, PortalEndPoint * entrance);   //
+            /*! \brief Let an entity enter a certain PortalEndPoint
+                \param entity pointer to the entity which is entering a PortalEndPoint
+                \param entrance pointer to the PortalEndPoint to enter
+             */
+            static void use(MobileEntity * entity, PortalEndPoint * entrance);   //!< let entity enter the PortalEndPoint pointed to by entrance
         protected:
         private:
-            static std::map<PortalEndPoint *, PortalEndPoint *> links_s;
-            unsigned int fromID_;
-            unsigned int toID_;
-            PortalEndPoint* from_;
-            PortalEndPoint* to_;
-            float activationRadius_;
-            bool isNowPortable(WorldEntity * ent);
+            static std::map<PortalEndPoint *, PortalEndPoint *> links_s;   //!< maps entrances to exits
+            unsigned int fromID_;   //!< id of the entrance of this Link
+            unsigned int toID_;   //!< id of the exit of this Link
+            PortalEndPoint* from_;   //!< pointer to this Link's entrance
+            PortalEndPoint* to_;   //!< pointer to this Link's exit
     };
-
 }
 
 #endif /* _Portals_H__ */




More information about the Orxonox-commit mailing list