Changeset 8200 for code/branches/portals
- Timestamp:
- Apr 7, 2011, 12:55:24 PM (14 years ago)
- Location:
- code/branches/portals
- Files:
-
- 9 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
code/branches/portals/data/levels/portals.oxw
r8177 r8200 27 27 28 28 29 <PortalEndPoint position="0,0,0" material="Examples/Flare" id="1"/> 30 <PortalEndPoint position="-100,0,0" material="Examples/Flare" id="2"/> 31 <PortalLink fromID="1" toID="2" /> 29 <PortalEndPoint position="0,0,0" id="1"> 30 <attached> 31 <Billboard material="Examples/Flare" /> 32 </attached> 33 </PortalEndPoint> 34 <PortalEndPoint position="-100,0,0" id="2"> 35 <attached> 36 <Billboard material="Examples/Flare2" /> 37 </attached> 38 </PortalEndPoint> 39 <PortalLink fromID="1" toID="2" /> 32 40 33 41 <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" /> -
code/branches/portals/src/modules/CMakeLists.txt
r7401 r8200 32 32 ADD_SUBDIRECTORY(pickup) 33 33 ADD_SUBDIRECTORY(pong) 34 ADD_SUBDIRECTORY(portals) 34 35 ADD_SUBDIRECTORY(questsystem) 35 36 ADD_SUBDIRECTORY(weapons) -
code/branches/portals/src/modules/objects/triggers/MultiTrigger.cc
r7601 r8200 116 116 } 117 117 118 // Check if the object is active (this is NOT MultiTrigger::isActive()!) 118 // Check if the object is active (this is NOT MultiTrigger::isActive()!), it is whether the MultiTrigger actually does anything, ever. 119 119 if (!this->BaseObject::isActive()) 120 120 return; … … 205 205 { 206 206 // If the MultiTrigger has not exceeded its remaining activations. 207 if(this-> remainingActivations_ > 0)207 if(this->hasRemainingActivations()) 208 208 { 209 209 this->active_.insert(state->originator); … … 218 218 { 219 219 // If the MultiTrigger doesn't stay active or hasn't' exceeded its remaining activations. 220 if(!this->getStayActive() || this-> remainingActivations_ > 0)220 if(!this->getStayActive() || this->hasRemainingActivations()) 221 221 this->active_.erase(state->originator); 222 222 else -
code/branches/portals/src/modules/objects/triggers/TriggerBase.h
r7652 r8200 186 186 { if(activations >= 0 || activations == INF_s) this->remainingActivations_ = activations; } 187 187 188 inline bool hasRemainingActivations(void) 189 { return this->remainingActivations_ == INF_s || this->remainingActivations_ > 0; } 190 188 191 /** 189 192 @brief Adds the parent of a MultiTrigger. -
code/branches/portals/src/modules/portals/CMakeLists.txt
r8199 r8200 9 9 TOLUA_FILES 10 10 PCH_FILE 11 P ickupPrecompiledHeaders.h11 PortalsPrecompiledHeaders.h 12 12 LINK_LIBRARIES 13 13 orxonox -
code/branches/portals/src/modules/portals/PortalEndPoint.cc
r8199 r8200 8 8 std::map<unsigned int, PortalEndPoint *> PortalEndPoint::idMap_s; 9 9 10 PortalEndPoint::PortalEndPoint(BaseObject* creator) : StaticEntity(creator), id_(0), material_(""), billboard_(0)10 PortalEndPoint::PortalEndPoint(BaseObject* creator) : DistanceMultiTrigger(creator), id_(0) 11 11 { 12 12 RegisterObject(PortalEndPoint); … … 22 22 SUPER(PortalEndPoint, XMLPort, xmlelement, mode); 23 23 XMLPortParam(PortalEndPoint, "id", setID, getID, xmlelement, mode); 24 XMLPortParamExtern(PortalEndPoint, Billboard, this->billboard_, "material", setMaterial, getMaterial, xmlelement, mode);25 XMLPortParamExtern(PortalEndPoint, Billboard, this->billboard_, "colour", setColour, getColour, xmlelement, mode).defaultValues(ColourValue::White);26 24 27 25 if(mode == XMLPort::LoadObject) … … 33 31 void PortalEndPoint::tick(float dt) 34 32 { 35 SUPER(PortalEndPoint, tick );33 SUPER(PortalEndPoint, tick, dt); 36 34 } 37 35 -
code/branches/portals/src/modules/portals/PortalEndPoint.h
r8199 r8200 1 1 #ifndef _PortalEndPoint_H__ 2 2 #define _PortalEndPoint_H__ 3 4 #include "portals/PortalsPrereqs.h" 3 5 4 6 #include <set> … … 6 8 #include <map> 7 9 8 #include " StaticEntity.h"10 #include "worldentities/StaticEntity.h" 9 11 #include "graphics/Billboard.h" 10 #include " modules/objects/triggers/DistanceMultiTrigger.h"12 #include "objects/triggers/DistanceMultiTrigger.h" 11 13 12 14 namespace orxonox 13 15 { 14 class _ OrxonoxExport PortalEndPoint : public DistanceMultiTrigger16 class _PortalsExport PortalEndPoint : public DistanceMultiTrigger 15 17 { 16 18 public: … … 36 38 unsigned int id_; 37 39 std::set<WorldEntity *> recentlyJumpedOut_; //!< Entities which recently jumped out of this EndPoint, hence they shouldn't be pulled in again if the endpoint is the beginning of a link 38 Billboard billboard_;39 40 }; 40 41 -
code/branches/portals/src/modules/portals/PortalLink.cc
r8199 r8200 7 7 CreateFactory(PortalLink); 8 8 9 PortalLink::PortalLink(BaseObject* creator) : BaseObject(creator), fromID_(0), toID_(0), from_(0), to_(0), activationRadius_(20)9 PortalLink::PortalLink(BaseObject* creator) : EventListener(creator), fromID_(0), toID_(0), from_(0), to_(0), activationRadius_(20) 10 10 { 11 11 RegisterObject(PortalLink); … … 32 32 void PortalLink::tick(float dt) 33 33 { 34 SUPER(PortalLink, tick )34 SUPER(PortalLink, tick, dt); 35 35 } 36 36 37 37 void PortalLink::processEvent(Event& event) 38 38 { 39 SUPER(PortalLink, processEvent);39 EventListener::processEvent(event); 40 40 if(!event.activate_) 41 41 { … … 53 53 return; 54 54 } 55 to_->jumpOut(e ntity);55 to_->jumpOut(eventEntity); 56 56 } 57 57 -
code/branches/portals/src/modules/portals/PortalLink.h
r8199 r8200 2 2 #define _PortalLink_H__ 3 3 4 #include " OrxonoxPrereqs.h"4 #include "portals/PortalsPrereqs.h" 5 5 #include "tools/interfaces/Tickable.h" 6 6 #include "core/BaseObject.h" … … 12 12 namespace orxonox 13 13 { 14 class _ OrxonoxExport PortalLink : public EventListener14 class _PortalsExport PortalLink : public EventListener 15 15 { 16 16 public:
Note: See TracChangeset
for help on using the changeset viewer.