Changeset 8599
- Timestamp:
- May 26, 2011, 3:44:07 PM (14 years ago)
- Location:
- code/branches/portals2
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/portals2/data/levels/portals.oxw
r8511 r8599 36 36 37 37 <PortalEndPoint position="0,0,0" id="1" distance="40" target="MobileEntity" design="PortalDefault" reenterDelay="0"/> 38 <PortalEndPoint position="- 100,0,0" id="2" distance="40" target="MobileEntity" design="PortalDefault" reenterDelay="0"/>38 <PortalEndPoint position="-300,0,0" id="2" distance="40" target="MobileEntity" design="PortalDefault" reenterDelay="0"/> 39 39 <PortalLink fromID="1" toID="2" /> 40 40 <PortalLink fromID="2" toID="1" /> -
code/branches/portals2/doc/api/groups/Portals.dox
r8483 r8599 3 3 @ingroup Modules 4 4 5 This module allows you to place @ref modules::PortalEndPoint "PortalEndPoints" in space and connect pairs of them with a @ref modules::PortalLink "PortalLink" in orderallow fast travelling from A to B.5 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. 6 6 7 7 @section FastHowTo Fast HowTo: Including portals in a level … … 53 53 @subsection Templates "Templates" 54 54 In order to make @ref orxonox::PortalEndPoint "PortalEndPoints" visible in the game there must be something visible. 55 The idea above is to define or include arbitrary Templates which make a PortalEndPoint visible and later use themby setting the design attribute of a @ref orxonox::PortalEndPoint "PortalEndPoint" to the template name55 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 56 56 @subsection Parameters "Parameters" 57 57 - position: 3d-coordinate in space 58 - distance (default: 50): distance at which a valid entity gets pulled in by the @ref orxonox::PortalEndPoint (if the end point is an entrance)58 - distance (default: 50): distance at which a valid entity gets pulled in (if the end point is an entrance). 59 59 - target (default: "Pawn"): the class which is able to enter this end point (if it is an entrance) 60 - design: the name of the @ref orxonox::Template " Template" above60 - design: the name of the @ref orxonox::Template "design template" 61 61 */ 62 62 -
code/branches/portals2/src/modules/portals/PortalEndPoint.cc
r8511 r8599 1 /* 2 * ORXONOX - the hottest 3D action shooter ever to exist 3 * > www.orxonox.net < 4 * 5 * 6 * License notice: 7 * 8 * This program is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU General Public License 10 * as published by the Free Software Foundation; either version 2 11 * of the License, or (at your option) any later version. 12 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with this program; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 21 * 22 * Author: 23 * Andreas Büchel 24 * Co-authors: 25 * ... 26 * 27 */ 28 1 29 #include "PortalEndPoint.h" 2 30 #include "core/XMLPort.h" … … 64 92 if(originatingTrigger == 0) 65 93 { 66 // COUT(1) << "originator no DistanceMultiTrigger\n" << std::endl;67 94 return true; 68 95 } … … 106 133 this->jumpOutTimes_[entity] = std::time(0); 107 134 this->recentlyJumpedOut_.insert(entity); 108 135 136 // adjust 109 137 entity->setPosition(this->getWorldPosition()); 110 138 entity->rotate(this->getWorldOrientation()); 111 139 entity->setVelocity(this->getWorldOrientation() * entity->getVelocity()); 112 entity->setVelocity(entity->getVelocity() * 1.5);113 140 } 114 141 -
code/branches/portals2/src/modules/portals/PortalEndPoint.h
r8511 r8599 1 /* 2 * ORXONOX - the hottest 3D action shooter ever to exist 3 * > www.orxonox.net < 4 * 5 * 6 * License notice: 7 * 8 * This program is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU General Public License 10 * as published by the Free Software Foundation; either version 2 11 * of the License, or (at your option) any later version. 12 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with this program; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 21 * 22 * Author: 23 * Andreas Büchel 24 * Co-authors: 25 * ... 26 * 27 */ 28 1 29 /** 2 30 * @file PortalEndPoint.h … … 98 126 int reenterDelay_; 99 127 std::map<MobileEntity *, time_t> jumpOutTimes_; //!< Stores the time at which a certain MobileEntity @ref jumpOut "jumped out" of this PortalEndPoint 100 std::set<MobileEntity *> recentlyJumpedOut_; 128 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. 101 129 }; 102 130 -
code/branches/portals2/src/modules/portals/PortalLink.cc
r8511 r8599 1 /* 2 * ORXONOX - the hottest 3D action shooter ever to exist 3 * > www.orxonox.net < 4 * 5 * 6 * License notice: 7 * 8 * This program is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU General Public License 10 * as published by the Free Software Foundation; either version 2 11 * of the License, or (at your option) any later version. 12 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with this program; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 21 * 22 * Author: 23 * Andreas Büchel 24 * Co-authors: 25 * ... 26 * 27 */ 28 1 29 #include "PortalLink.h" 2 30 #include "core/XMLPort.h" … … 37 65 if(entrance == 0) 38 66 { 39 // TODO COUT40 67 return; 41 68 } … … 45 72 if(endpoints == PortalLink::links_s.end()) // entrance has no corresponding exit 46 73 return; 47 74 48 75 endpoints->second->jumpOut(entity); 49 76 } 50 51 52 77 } -
code/branches/portals2/src/modules/portals/PortalLink.h
r8466 r8599 1 /* 2 * ORXONOX - the hottest 3D action shooter ever to exist 3 * > www.orxonox.net < 4 * 5 * 6 * License notice: 7 * 8 * This program is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU General Public License 10 * as published by the Free Software Foundation; either version 2 11 * of the License, or (at your option) any later version. 12 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with this program; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 21 * 22 * Author: 23 * Andreas Büchel 24 * Co-authors: 25 * ... 26 * 27 */ 28 1 29 /** 2 30 @file PortalLink.h … … 45 73 return this->toID_; 46 74 } 47 static void use(MobileEntity * entity, PortalEndPoint * entrance); // 75 /*! \brief Let an entity enter a certain PortalEndPoint 76 \param entity pointer to the entity which is entering a PortalEndPoint 77 \param entrance pointer to the PortalEndPoint to enter 78 */ 79 static void use(MobileEntity * entity, PortalEndPoint * entrance); //!< let entity enter the PortalEndPoint pointed to by entrance 48 80 protected: 49 81 private: 50 static std::map<PortalEndPoint *, PortalEndPoint *> links_s; 51 unsigned int fromID_; 52 unsigned int toID_; 53 PortalEndPoint* from_; 54 PortalEndPoint* to_; 55 float activationRadius_; 56 bool isNowPortable(WorldEntity * ent); 82 static std::map<PortalEndPoint *, PortalEndPoint *> links_s; //!< maps entrances to exits 83 unsigned int fromID_; //!< id of the entrance of this Link 84 unsigned int toID_; //!< id of the exit of this Link 85 PortalEndPoint* from_; //!< pointer to this Link's entrance 86 PortalEndPoint* to_; //!< pointer to this Link's exit 57 87 }; 58 59 88 } 60 89
Note: See TracChangeset
for help on using the changeset viewer.