Changeset 7127 for code/branches/presentation3/src/modules
- Timestamp:
- Jun 9, 2010, 9:32:58 PM (15 years ago)
- Location:
- code/branches/presentation3/src/modules
- Files:
-
- 64 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation3/src/modules/designtools/CreateStars.h
r7028 r7127 32 32 #include "util/Math.h" 33 33 #include "core/BaseObject.h" 34 34 35 35 namespace orxonox 36 36 { … … 61 61 } 62 62 63 void setColour(const orxonox::ColourValue& colour) { 63 void setColour(const orxonox::ColourValue& colour) { 64 64 this->colour_ = colour; 65 65 } 66 66 67 const ColourValue& getColour() const { 67 const ColourValue& getColour() const { 68 68 return this->colour_; 69 69 } … … 109 109 return this->radius_; 110 110 } 111 111 112 112 Vector3 PolarToCartesian(float alpha, float beta, float radius); 113 113 … … 119 119 unsigned int radius_; 120 120 float alpha_; 121 float colourDiff_; 121 float colourDiff_; 122 122 float alphaDiff_; 123 123 float radiusDiff_; 124 124 125 125 }; 126 126 } -
code/branches/presentation3/src/modules/designtools/SkyboxGenerator.cc
r7039 r7127 46 46 47 47 48 48 49 49 namespace orxonox 50 50 { … … 68 68 } 69 69 70 void SkyboxGenerator::setConfigValues( ) 70 void SkyboxGenerator::setConfigValues( ) 71 71 { 72 72 SetConfigValue(skyboxPrefix_, "SkyboxFile_"); … … 83 83 return; 84 84 } 85 85 86 86 ControllableEntity* ce = HumanController::getLocalControllerSingleton()->getControllableEntity(); 87 87 Camera* camera = ce->getCamera(); 88 88 assert(ce); 89 89 90 90 Ogre::RenderWindow* w = GraphicsManager::getInstance().getRenderWindow(); 91 91 92 92 93 switch (iterateOverDirections_) 93 switch (iterateOverDirections_) 94 94 { 95 95 case 0 : … … 105 105 iterateOverDirections_++; 106 106 break; 107 107 108 108 case 2 : 109 109 w->writeContentsToFile(skyboxPrefix_+"lf.png"); 110 ce->yaw(Degree(90)); 110 ce->yaw(Degree(90)); 111 111 iterateOverDirections_++; 112 112 break; … … 114 114 case 3 : 115 115 w->writeContentsToFile(skyboxPrefix_+"bk.png"); 116 ce->yaw(Degree(90)); 116 ce->yaw(Degree(90)); 117 117 iterateOverDirections_++; 118 118 break; … … 120 120 case 4 : 121 121 w->writeContentsToFile(skyboxPrefix_+"rt.png"); 122 ce->yaw(Degree(90)); 123 ce->pitch(Degree(90)); 122 ce->yaw(Degree(90)); 123 ce->pitch(Degree(90)); 124 124 iterateOverDirections_++; 125 125 break; … … 127 127 case 5 : 128 128 w->writeContentsToFile(skyboxPrefix_+"up.png"); 129 ce->pitch(Degree(180)); 129 ce->pitch(Degree(180)); 130 130 iterateOverDirections_++; 131 131 break; … … 136 136 iterateOverDirections_++; 137 137 break; 138 138 139 139 case 7 : 140 140 camera->getOgreCamera()->setAspectRatio(aspectRatio_); … … 152 152 } 153 153 154 void SkyboxGenerator::createSkybox( ) 154 void SkyboxGenerator::createSkybox( ) 155 155 { 156 156 SkyboxGenerator::getInstance().takeScreenshot_ = true; -
code/branches/presentation3/src/modules/designtools/SkyboxGenerator.h
r6994 r7127 32 32 #include "tools/interfaces/Tickable.h" 33 33 #include <OgreMath.h> 34 35 34 35 36 36 namespace orxonox 37 37 { … … 39 39 { 40 40 friend class Singleton<SkyboxGenerator>; 41 41 42 42 public: 43 43 SkyboxGenerator(); … … 49 49 private: 50 50 static SkyboxGenerator* singletonPtr_s; 51 std::string skyboxPrefix_; 51 std::string skyboxPrefix_; 52 52 bool takeScreenshot_; 53 53 int iterateOverDirections_; -
code/branches/presentation3/src/modules/objects/Planet.cc
r7104 r7127 105 105 this->mesh_.getEntity()->setCastShadows(this->bCastShadows_); 106 106 this->mesh_.setVisible(this->isVisible()); 107 107 108 108 float scaleFactor = this->getScale(); 109 109 110 110 #if OGRE_VERSION >= 0x010700 111 111 Ogre::Mesh::LodValueList distList; … … 113 113 Ogre::Mesh::LodDistanceList distList; 114 114 #endif 115 115 116 116 distList.push_back(10.0f*scaleFactor); 117 117 distList.push_back(19.0f*scaleFactor); … … 124 124 distList.push_back(54.0f*scaleFactor); 125 125 distList.push_back(55.0f*scaleFactor); 126 126 127 127 float reductionValue = 0.2f; 128 128 129 129 this->mesh_.getEntity()->getMesh()->generateLodLevels(distList, Ogre::ProgressiveMesh::VRQ_PROPORTIONAL, reductionValue); 130 130 billboard_.setBillboardSet(this->getScene()->getSceneManager(), this->atmosphere_, Vector3(0,0,0)); 131 131 132 132 this->attachOgreObject(this->billboard_.getBillboardSet()); 133 133 this->billboard_.getBillboardSet()->setUseAccurateFacing(true); -
code/branches/presentation3/src/modules/objects/eventsystem/EventListener.cc
r6856 r7127 61 61 return; 62 62 } 63 63 64 64 COUT(4) << "EventListener, processing event: originator: " << event.originator_->getIdentifier()->getName() << " (&" << event.originator_ << ")" << ", activate: " << event.activate_ << ", name: " << event.name_ << std::endl; 65 65 -
code/branches/presentation3/src/modules/objects/triggers/CheckPoint.cc
r7045 r7127 38 38 CreateFactory(CheckPoint); 39 39 40 CheckPoint::CheckPoint(BaseObject* creator) 40 CheckPoint::CheckPoint(BaseObject* creator) 41 41 : DistanceTrigger(creator) 42 42 , RadarViewable(creator, static_cast<WorldEntity*>(this)) -
code/branches/presentation3/src/modules/objects/triggers/DistanceMultiTrigger.cc
r6906 r7127 40 40 namespace orxonox 41 41 { 42 42 43 43 CreateFactory(DistanceMultiTrigger); 44 44 45 45 /** 46 46 @brief 47 Default Constructor. Registers the object and initializes default values. 47 Default Constructor. Registers the object and initializes default values. 48 48 */ 49 49 DistanceMultiTrigger::DistanceMultiTrigger(BaseObject* creator) : MultiTrigger(creator) 50 50 { 51 51 RegisterObject(DistanceMultiTrigger); 52 52 53 53 this->distance_ = 100.0f; 54 54 this->targetName_ = BLANKSTRING; … … 98 98 continue; 99 99 } 100 100 101 101 Vector3 distanceVec = entity->getWorldPosition() - this->getWorldPosition(); 102 102 // If the object is no longer in range. … … 154 154 if(this->singleTargetMode_) 155 155 entity = entity->getParent(); 156 156 157 157 // If no queue has been created, yet. 158 158 if(queue == NULL) … … 166 166 } 167 167 } 168 168 169 169 return queue; 170 170 } 171 171 172 172 } -
code/branches/presentation3/src/modules/objects/triggers/DistanceMultiTrigger.h
r6906 r7127 56 56 class _ObjectsExport DistanceMultiTrigger : public MultiTrigger 57 57 { 58 58 59 59 public: 60 60 DistanceMultiTrigger(BaseObject* creator); //!< Default Constructor. Registers the object and initializes default values. 61 61 ~DistanceMultiTrigger(); //!< Destructor. 62 62 63 63 void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a DistanceMultiTrigger object through XML. 64 64 … … 75 75 inline const std::string& getTargetName(void) 76 76 { return this->targetName_; } 77 77 78 78 /** 79 79 @brief Set the distance at which the DistanceMultiTrigger triggers. … … 88 88 inline float getDistance() const 89 89 { return this->distance_; } 90 90 91 91 protected: 92 92 virtual std::queue<MultiTriggerState*>* letTrigger(void); //!< This method is called by the MultiTrigger to get information about new trigger events that need to be looked at. … … 106 106 inline bool removeFromRange(WorldEntity* entity) 107 107 { WeakPtr<WorldEntity>* weakptr = this->range_.find(entity)->second; bool erased = this->range_.erase(entity) > 0; if(erased) delete weakptr; return erased; } 108 108 109 109 private: 110 110 float distance_; //!< The distance at which the DistanceMultiTrigger triggers. 111 111 std::string targetName_; //!< The target name, used in singleTargetMode. 112 112 bool singleTargetMode_; //!< To indicate whe the MultiDistanceTrigger is in single-target-mode. 113 113 114 114 std::map<WorldEntity*, WeakPtr<WorldEntity>* > range_; //!< The set of entities that currently are in range of the DistanceMultiTrigger. 115 115 116 116 }; 117 117 118 118 } 119 119 -
code/branches/presentation3/src/modules/objects/triggers/DistanceTrigger.cc
r6935 r7127 136 136 continue; 137 137 } 138 138 139 139 Vector3 distanceVec = entity->getWorldPosition() - this->getWorldPosition(); 140 140 if (distanceVec.length() < this->distance_) -
code/branches/presentation3/src/modules/objects/triggers/DistanceTriggerBeacon.cc
r6906 r7127 35 35 36 36 CreateFactory(DistanceTriggerBeacon); 37 37 38 38 DistanceTriggerBeacon::DistanceTriggerBeacon(BaseObject* creator) : StaticEntity(creator) 39 39 { 40 40 RegisterObject(DistanceTriggerBeacon); 41 41 } 42 42 43 43 } -
code/branches/presentation3/src/modules/objects/triggers/DistanceTriggerBeacon.h
r6906 r7127 39 39 class _ObjectsExport DistanceTriggerBeacon : public StaticEntity 40 40 { 41 41 42 42 public: 43 43 -
code/branches/presentation3/src/modules/objects/triggers/EventMultiTrigger.cc
r6864 r7127 52 52 EventMultiTrigger::~EventMultiTrigger() 53 53 { 54 54 55 55 } 56 56 … … 61 61 this->setBroadcast(true); 62 62 } 63 63 64 64 void EventMultiTrigger::XMLEventPort(Element& xmlelement, XMLPort::Mode mode) 65 65 { -
code/branches/presentation3/src/modules/objects/triggers/EventMultiTrigger.h
r6864 r7127 44 44 class _ObjectsExport EventMultiTrigger : public MultiTrigger 45 45 { 46 46 47 47 public: 48 48 EventMultiTrigger(BaseObject* creator); -
code/branches/presentation3/src/modules/objects/triggers/MultiTrigger.cc
r6864 r7127 47 47 /*static*/ const std::string MultiTrigger::or_s = "or"; 48 48 /*static*/ const std::string MultiTrigger::xor_s = "xor"; 49 49 50 50 CreateFactory(MultiTrigger); 51 51 … … 65 65 this->bSwitch_ = false; 66 66 this->bStayActive_ = false; 67 67 68 68 this->remainingActivations_ = INF_s; 69 69 this->maxNumSimultaniousTriggerers_ = INF_s; … … 75 75 76 76 this->parentTrigger_ = NULL; 77 77 78 78 this->targetMask_.exclude(Class(BaseObject)); 79 79 80 80 this->setSyncMode(0x0); 81 81 } 82 82 83 83 /** 84 84 @brief … … 95 95 } 96 96 } 97 97 98 98 /** 99 99 @brief … … 117 117 //TODO: Maybe nicer with explicit subgroup, e.g. triggers 118 118 XMLPortObject(MultiTrigger, MultiTrigger, "", addTrigger, getTrigger, xmlelement, mode); 119 119 120 120 COUT(4) << "MultiTrigger '" << this->getName() << "' (&" << this << ") created." << std::endl; 121 121 } 122 122 123 123 124 124 /** … … 131 131 { 132 132 // If this is the first tick. 133 //TODO: Determine need for this, else kick it out. 133 //TODO: Determine need for this, else kick it out. 134 134 if(this->bFirstTick_) 135 135 { … … 174 174 delete state; 175 175 } 176 176 177 177 queue->pop(); 178 178 } … … 185 185 MultiTriggerState* state; 186 186 float timeRemaining; 187 187 188 188 // Go through all pending states. 189 189 for(int size = this->stateQueue_.size(); size >= 1; size--) … … 212 212 this->triggered_.erase(state->originator); 213 213 } 214 214 215 215 bStateChanged = true; 216 216 } … … 229 229 230 230 bool bFire = true; 231 231 232 232 // Add the originator to the objects activating this MultiTrigger. 233 233 if(bActive == true) … … 266 266 else 267 267 this->fire(bActive, state->originator); 268 268 269 269 bStateChanged = true; 270 270 } … … 289 289 } 290 290 } 291 291 292 292 // Remove the state from the state queue. 293 293 this->stateQueue_.pop_front(); … … 509 509 return returnVal; 510 510 } 511 511 512 512 return true; 513 513 } 514 514 515 515 /** 516 516 @brief … … 547 547 return; 548 548 } 549 549 550 550 MultiTriggerContainer* container = new MultiTriggerContainer(this, this, originator); 551 551 this->fireEvent(status, container); … … 563 563 { 564 564 ClassTreeMask& targetMask = this->getTargetMask(); 565 565 566 566 for(ClassTreeMaskObjectIterator it = targetMask.begin(); it != targetMask.end(); ++it) 567 567 { … … 580 580 { 581 581 assert(state); 582 582 583 583 // If the originator is no target of this MultiTrigger. 584 584 if(!this->isTarget(state->originator)) 585 585 return false; 586 586 587 587 // Add it ot the state queue. 588 588 this->stateQueue_.push_back(std::pair<float, MultiTriggerState*>(this->delay_, state)); -
code/branches/presentation3/src/modules/objects/triggers/MultiTrigger.h
r6864 r7127 94 94 MultiTrigger(BaseObject* creator); //!< Constructor. Registers the objects and initializes default values. 95 95 ~MultiTrigger(); //!< Destructor. 96 96 97 97 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a MultiTrigger object through XML. 98 98 virtual void tick(float dt); //!< A method that is executed each tick. 99 99 100 100 bool isActive(BaseObject* triggerer = NULL); //!< Get whether the MultiTrigger is active for a given object. 101 101 … … 215 215 void addTargets(const std::string& targets); //!< Add some target to the MultiTrigger. 216 216 void removeTargets(const std::string& targets); //!< Remove some target from the MultiTrigger. 217 217 218 218 void addTrigger(MultiTrigger* trigger); //!< Adds a MultiTrigger as a sub-trigger to the trigger. 219 219 const MultiTrigger* getTrigger(unsigned int index) const; //!< Get the sub-trigger of this MultiTrigger at the given index. 220 220 221 221 protected: 222 222 virtual std::queue<MultiTriggerState*>* letTrigger(void); //!< This method is called by the MultiTrigger to get information about new trigger events that need to be looked at. 223 223 224 224 void changeTriggered(BaseObject* originator = NULL); //!< This method can be called by any class inheriting from MultiTrigger to change it's triggered status for a specified originator. 225 225 226 226 bool isModeTriggered(BaseObject* triggerer = NULL); //!< Checks whetherx the MultiTrigger is triggered concerning it's sub-triggers. 227 227 bool isTriggered(BaseObject* triggerer = NULL); //!< Get whether the MultiTrigger is triggered for a given object. … … 236 236 inline void addParentTrigger(MultiTrigger* parent) 237 237 { this->parentTrigger_ = parent; } 238 238 239 239 /** 240 240 @brief Get the target mask used to identify the targets of this MultiTrigger. … … 248 248 //TODO: Check if something mus be done here. 249 249 virtual void notifyMaskUpdate(void) {} 250 250 251 251 private: 252 252 static const int INF_s; //!< Magic number for infinity. … … 257 257 258 258 void subTrigggerActivityChanged(BaseObject* originator); //!< This method is called by any sub-trigger to advertise changes in it's state to it's parent-trigger. 259 259 260 260 bool addState(MultiTriggerState* state); //!< Helper method. Adds a state to the state queue, where the state will wait to become active. 261 261 262 262 bool checkAnd(BaseObject* triggerer); //!< Checks whether the sub-triggers amount to true for the 'and' mode for a given object. 263 263 bool checkOr(BaseObject* triggerer); //!< Checks whether the sub-triggers amount to true for the 'or' mode for a given object. … … 276 276 bool bSwitch_; //!< Bool for the switch-mode, if true the MultiTrigger behaves like a switch. 277 277 bool bStayActive_; //!< Bool for the stay-active-mode, if true the MultiTrigger stays active after its last activation.; 278 278 279 279 int remainingActivations_; //!< The remaining activations of this MultiTrigger. 280 280 int maxNumSimultaniousTriggerers_; //!< The maximum number of objects simultaniously trigggering this MultiTrigger. … … 287 287 MultiTrigger* parentTrigger_; 288 288 std::set<MultiTrigger*> subTriggers_; //!< The sub-triggers of this MultiTrigger. 289 289 290 290 std::set<BaseObject*> active_; //!< The set of all objects the MultiTrigger is active for. 291 291 std::set<BaseObject*> triggered_; //!< The set of all objects the MultiTrigger is triggered for. 292 292 293 293 std::deque< std::pair<float, MultiTriggerState*> > stateQueue_; //!< The queue of states waiting to become active. 294 294 295 295 ClassTreeMask targetMask_; //!< The target mask, masking all objects that can trigger this MultiTrigger. 296 296 297 297 }; 298 298 -
code/branches/presentation3/src/modules/objects/triggers/MultiTriggerContainer.cc
r6859 r7127 40 40 41 41 CreateUnloadableFactory(MultiTriggerContainer); 42 42 43 43 /** 44 44 @brief … … 73 73 MultiTriggerContainer::~MultiTriggerContainer() 74 74 { 75 75 76 76 } 77 77 -
code/branches/presentation3/src/modules/objects/triggers/MultiTriggerContainer.h
r6856 r7127 50 50 class _ObjectsExport MultiTriggerContainer : public BaseObject 51 51 { 52 52 53 53 public: 54 54 MultiTriggerContainer(BaseObject* creator); //!< Default constructor. Registers the object and creates an empty container. … … 68 68 inline BaseObject* getData(void) 69 69 { return this->data_; } 70 70 71 71 private: 72 72 MultiTrigger* originator_; //!< The originator. 73 73 BaseObject* data_; //!< The data. 74 74 }; 75 75 76 76 } 77 77 -
code/branches/presentation3/src/modules/overlays/hud/GametypeFadingMessage.h
r7031 r7127 46 46 47 47 void fadingmessage(const GametypeInfo* gtinfo, const std::string& message); 48 48 49 49 private: 50 50 PlayerInfo* owner_; -
code/branches/presentation3/src/modules/overlays/hud/GametypeStaticMessage.cc
r7062 r7127 37 37 { 38 38 CreateFactory(GametypeStaticMessage); 39 40 39 40 41 41 GametypeStaticMessage::GametypeStaticMessage(BaseObject* creator) : OverlayText(creator) 42 42 { -
code/branches/presentation3/src/modules/overlays/hud/GametypeStaticMessage.h
r7062 r7127 49 49 50 50 void staticmessage(const GametypeInfo* gtinfo, const std::string& message, const ColourValue& colour); 51 51 52 52 private: 53 53 PlayerInfo* owner_; -
code/branches/presentation3/src/modules/overlays/hud/GametypeStatus.cc
r6994 r7127 39 39 namespace orxonox 40 40 { 41 CreateFactory(GametypeStatus); 41 CreateFactory(GametypeStatus); 42 42 43 /*static*/ bool GametypeStatus::noCaption_s = false; 43 /*static*/ bool GametypeStatus::noCaption_s = false; 44 44 SetConsoleCommand(GametypeStatus, setGametypeStatus, true); 45 45 … … 109 109 GametypeStatus::noCaption_s = !bValue; 110 110 } 111 111 112 112 } -
code/branches/presentation3/src/modules/overlays/hud/GametypeStatus.h
r6994 r7127 51 51 PlayerInfo* owner_; 52 52 static bool noCaption_s; 53 53 54 54 }; 55 55 } -
code/branches/presentation3/src/modules/overlays/hud/HUDNavigation.cc
r7109 r7127 402 402 void HUDNavigation::changedOwner() 403 403 { 404 404 405 405 const std::set<RadarViewable*>& respawnObjects = this->getOwner()->getScene()->getRadar()->getRadarObjects(); 406 406 for ( std::set<RadarViewable*>::const_iterator it = respawnObjects.begin(); it != respawnObjects.end(); ++it ) -
code/branches/presentation3/src/modules/overlays/hud/HUDNavigation.h
r7051 r7127 50 50 51 51 void setConfigValues(); 52 52 53 53 virtual void XMLPort ( Element& xmlElement, XMLPort::Mode mode ); 54 54 virtual void tick ( float dt ); … … 76 76 77 77 }; 78 78 79 79 bool showObject( RadarViewable* rv ); 80 80 -
code/branches/presentation3/src/modules/overlays/hud/HUDRadar.cc
r6984 r7127 45 45 namespace orxonox 46 46 { 47 CreateFactory(HUDRadar); 47 CreateFactory(HUDRadar); 48 48 49 49 HUDRadar::HUDRadar(BaseObject* creator) -
code/branches/presentation3/src/modules/overlays/hud/HUDRadar.h
r6942 r7127 69 69 virtual void objectChanged( RadarViewable* rv ); 70 70 void radarTick(float dt); 71 71 72 72 void gatherObjects(); 73 73 -
code/branches/presentation3/src/modules/pickup/DroppedPickup.cc
r6540 r7127 41 41 namespace orxonox 42 42 { 43 43 44 44 CreateFactory(DroppedPickup); 45 45 46 46 /** 47 47 @brief … … 51 51 { 52 52 RegisterObject(DroppedPickup); 53 53 54 54 } 55 55 … … 67 67 */ 68 68 DroppedPickup::DroppedPickup(BaseObject* creator, Pickupable* pickup, PickupCarrier* carrier, float triggerDistance) : PickupSpawner(creator, pickup, triggerDistance, 5, 1) 69 { 69 { 70 70 RegisterObject(DroppedPickup); 71 71 72 72 this->setPosition(carrier->getCarrierPosition()); 73 73 this->setActive(false); 74 74 75 75 //TODO: Do more elegantly. 76 76 this->startRespawnTimer(); -
code/branches/presentation3/src/modules/pickup/DroppedPickup.h
r6540 r7127 41 41 namespace orxonox 42 42 { 43 43 44 44 /** 45 45 @brief -
code/branches/presentation3/src/modules/pickup/Pickup.h
r7008 r7127 165 165 private: 166 166 void initialize(void); //!< Initializes the member variables. 167 167 168 168 //TODO: Problems, when there are more Timers needed? Solutions? 169 169 Timer durationTimer_; //!< Timer at the disposal of each Class implementing Pickup. -
code/branches/presentation3/src/modules/pickup/PickupCollection.cc
r7094 r7127 42 42 namespace orxonox 43 43 { 44 44 45 45 CreateFactory(PickupCollection); 46 46 … … 52 52 { 53 53 RegisterObject(PickupCollection); 54 54 55 55 this->pickupCollectionIdentifier_ = new PickupCollectionIdentifier(this); 56 56 } 57 57 58 58 /** 59 59 @brief … … 69 69 } 70 70 } 71 71 72 72 /** 73 73 @brief … … 77 77 { 78 78 SUPER(PickupCollection, XMLPort, xmlelement, mode); 79 79 80 80 XMLPortObject(PickupCollection, Pickupable, "pickupables", addPickupable, getPickupable, xmlelement, mode); 81 81 82 82 this->initializeIdentifier(); 83 83 } 84 84 85 85 /** 86 86 @brief … … 94 94 } 95 95 } 96 96 97 97 /** 98 98 @brief … … 103 103 { 104 104 SUPER(PickupCollection, changedUsed); 105 105 106 106 //! Change used for all Pickupables this PickupCollection consists of. 107 107 for(std::vector<WeakPtr<Pickupable> >::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++) … … 110 110 } 111 111 } 112 112 113 113 /** 114 114 @brief … … 119 119 { 120 120 SUPER(PickupCollection, changedCarrier); 121 121 122 122 //! Change the PickupCarrier for all Pickupables this PickupCollection consists of. 123 123 for(std::vector<WeakPtr<Pickupable> >::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++) … … 126 126 } 127 127 } 128 128 129 129 /** 130 130 @brief … … 135 135 { 136 136 SUPER(PickupCollection, changedPickedUp); 137 137 138 138 //! Change the pickedUp status for all Pickupables this PickupCollection consists of. 139 139 for(std::vector<WeakPtr<Pickupable> >::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++) … … 142 142 } 143 143 } 144 144 145 145 /** 146 146 @brief … … 154 154 if(item == NULL) 155 155 item = new PickupCollection(this); 156 156 157 157 SUPER(PickupCollection, clone, item); 158 158 159 159 PickupCollection* pickup = dynamic_cast<PickupCollection*>(item); 160 160 //! Clone all Pickupables this PickupCollection consist of. … … 167 167 pickup->initializeIdentifier(); 168 168 } 169 169 170 170 /** 171 171 @brief … … 183 183 return false; 184 184 } 185 185 186 186 return true; 187 187 } 188 188 189 189 /** 190 190 @brief … … 198 198 return this->pickupCollectionIdentifier_; 199 199 } 200 200 201 201 /** 202 202 @brief … … 211 211 if(pickup == NULL) 212 212 return false; 213 213 214 214 WeakPtr<Pickupable> ptr = pickup; //!< Create a weak pointer to be able to test in the constructor if the Pointer is still valid. 215 215 this->pickups_.push_back(ptr); 216 216 return true; 217 217 } 218 218 219 219 /** 220 220 @brief … … 229 229 return this->pickups_[index].get(); 230 230 } 231 231 232 232 /** 233 233 @brief … … 245 245 return true; 246 246 } 247 247 248 248 } -
code/branches/presentation3/src/modules/pickup/PickupCollection.h
r6731 r7127 53 53 class _PickupExport PickupCollection : public Pickupable, public BaseObject 54 54 { 55 55 56 56 public: 57 57 58 58 PickupCollection(BaseObject* creator); //!< Default Constructor. 59 59 virtual ~PickupCollection(); //!< Destructor. 60 60 61 61 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Creates an instance of this Class through XML. 62 62 … … 64 64 virtual void changedCarrier(void); //!< Is called when the pickup has changed its PickupCarrier. 65 65 virtual void changedPickedUp(void); //!< Is called when the pickup has transited from picked up to dropped or the other way around. 66 66 67 67 virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input OrxonoxClass. 68 68 69 69 virtual bool isTarget(PickupCarrier* carrier) const; //!< Get whether a given class, represented by the input Identifier, is a target of this PickupCollection. 70 70 71 71 virtual const PickupIdentifier* getPickupIdentifier(void); //!< Get the PickupIdentifier of this PickupCollection. 72 72 73 73 bool addPickupable(Pickupable* pickup); //!< Add the input Pickupable to list of Pickupables combined by this PickupCollection. 74 74 const Pickupable* getPickupable(unsigned int index); //!< Get the Pickupable at the given index. 75 75 76 76 protected: 77 77 void initializeIdentifier(void); //!< Initializes the PickupIdentifier for this pickup. 78 78 79 79 virtual bool createSpawner(void); //!< Facilitates the creation of a PickupSpawner upon dropping of the Pickupable. 80 80 81 81 PickupCollectionIdentifier* pickupCollectionIdentifier_; //!< The PickupCollectionIdentifier of this PickupCollection. Is used to distinguish different PickupCollections amongst themselves. 82 82 83 83 private: 84 84 85 85 std::vector<WeakPtr<Pickupable> > pickups_; //!< The list of the pointers of all the Pickupables this PickupCollection consists of. They are weak pointers to facilitate testing, whether the pointers are still valid. 86 86 87 87 }; 88 88 89 89 } 90 90 -
code/branches/presentation3/src/modules/pickup/PickupCollectionIdentifier.cc
r6538 r7127 38 38 namespace orxonox 39 39 { 40 40 41 41 /** 42 42 @brief … … 47 47 RegisterObject(PickupCollectionIdentifier); 48 48 } 49 49 50 50 /** 51 51 @brief … … 54 54 PickupCollectionIdentifier::~PickupCollectionIdentifier() 55 55 { 56 56 57 57 } 58 58 … … 70 70 PickupIdentifier* temp = const_cast<PickupIdentifier*>(identifier); 71 71 const PickupCollectionIdentifier* collectionIdentifier = dynamic_cast<PickupCollectionIdentifier*>(temp); 72 72 73 73 //! If the input PickupIdentifier 'identifier' is no PickupCollectionIdentifier then just the two PickupIdentifiers are compared. 74 74 if(collectionIdentifier == NULL) … … 76 76 return this->PickupIdentifier::compare(identifier); 77 77 } 78 78 79 79 //! If the number of Pickupables each of the two PickupCollectionIdentifiers contain differ, the one with less is considered smaller. 80 80 if(this->identifiers_.size() != collectionIdentifier->identifiers_.size()) 81 81 return this->identifiers_.size()-collectionIdentifier->identifiers_.size(); 82 82 83 83 //! Compare the Pickupables of the two PickupCollectionIdentifiers one after the other. the one with the first 'smaller' one is considered smaller. 84 84 std::set<const PickupIdentifier*, PickupIdentifierCompare>::const_iterator it2 = collectionIdentifier->identifiers_.begin(); 85 85 for(std::set<const PickupIdentifier*, PickupIdentifierCompare>::const_iterator it = this->identifiers_.begin(); it != this->identifiers_.end(); it++) 86 86 { 87 87 88 88 if((*it)->compare(*it2) < 0) 89 89 return -1; … … 91 91 return 1; 92 92 } 93 93 94 94 //! Means they are equal. 95 95 return 0; 96 96 } 97 97 98 98 /** 99 99 @brief … … 106 106 this->identifiers_.insert(identifier); 107 107 } 108 108 109 109 } 110 110 -
code/branches/presentation3/src/modules/pickup/PickupCollectionIdentifier.h
r6538 r7127 54 54 class _PickupExport PickupCollectionIdentifier : public PickupIdentifier 55 55 { 56 56 57 57 public: 58 58 PickupCollectionIdentifier(Pickupable* pickup); //!< Constructor. 59 59 ~PickupCollectionIdentifier(); //!< Destructor. 60 60 61 61 virtual int compare(const PickupIdentifier* identifier) const; //!< Compares a PickupCollectionIdentifier with a PickupIdentifier. 62 62 63 63 void addPickup(const PickupIdentifier* identifier); //!< Add a Pickupable to the PickupCollectionIdentifier. 64 64 65 65 private: 66 66 std::set<const PickupIdentifier*, PickupIdentifierCompare> identifiers_; //!< The set of PickupIdentifiers of the Pickupables the PickupCollection with this PickupCollectionIdentifier consists of, ordered by the rule set by PickupIdentifierCompare. 67 67 68 68 }; 69 69 70 70 } 71 71 -
code/branches/presentation3/src/modules/pickup/PickupManager.cc
r7110 r7127 51 51 // Register tolua_open function when loading the library 52 52 DeclareToluaInterface(Pickup); 53 53 54 54 ManageScopedSingleton(PickupManager, ScopeID::Root, false); 55 55 56 56 /*static*/ const std::string PickupManager::guiName_s = "PickupInventory"; 57 57 58 58 /** 59 59 @brief … … 69 69 } 70 70 this->defaultRepresentation_ = new PickupRepresentation(); 71 71 72 72 COUT(3) << "PickupManager created." << std::endl; 73 73 } 74 74 75 75 /** 76 76 @brief … … 82 82 if(this->defaultRepresentation_ != NULL) 83 83 this->defaultRepresentation_->destroy(); 84 84 85 85 this->representations_.clear(); 86 86 87 87 COUT(3) << "PickupManager destroyed." << std::endl; 88 88 } 89 89 90 90 /** 91 91 @brief … … 100 100 */ 101 101 bool PickupManager::registerRepresentation(const PickupIdentifier* identifier, PickupRepresentation* representation) 102 { 102 { 103 103 if(identifier == NULL || representation == NULL || this->representations_.find(identifier) != this->representations_.end()) //!< If the Pickupable already has a Representation registered. 104 104 return false; 105 105 106 106 this->representations_[identifier] = representation; 107 107 108 108 COUT(4) << "PickupRepresentation " << representation << " registered with the PickupManager." << std::endl; 109 109 return true; 110 110 } 111 111 112 112 /** 113 113 @brief … … 121 121 */ 122 122 bool PickupManager::unregisterRepresentation(const PickupIdentifier* identifier, PickupRepresentation* representation) 123 { 123 { 124 124 if(identifier == NULL || representation == NULL) 125 125 return false; 126 126 127 127 std::map<const PickupIdentifier*, PickupRepresentation*, PickupIdentifierCompare>::iterator it = this->representations_.find(identifier); 128 128 if(it == this->representations_.end()) //!< If the Pickupable is not registered in the first place. 129 129 return false; 130 130 131 131 this->representations_.erase(it); 132 132 133 133 COUT(4) << "PickupRepresentation " << representation << " unregistered with the PickupManager." << std::endl; 134 134 return true; 135 135 } 136 136 137 137 /** 138 138 @brief … … 151 151 return this->defaultRepresentation_; 152 152 } 153 153 154 154 return it->second; 155 155 } … … 158 158 { 159 159 this->pickupsList_.clear(); 160 160 161 161 PlayerInfo* player = GUIManager::getInstance().getPlayer(PickupManager::guiName_s); 162 162 PickupCarrier* carrier = NULL; … … 221 221 if(pickup == NULL || it == this->pickupsList_.end() || it->second.get() == NULL) 222 222 return; 223 223 224 224 if(!pickup->isPickedUp()) 225 225 return; … … 229 229 pickup->setUsed(use); 230 230 } 231 231 232 232 } -
code/branches/presentation3/src/modules/pickup/PickupManager.h
r6996 r7127 60 60 { // tolua_export 61 61 friend class Singleton<PickupManager>; 62 62 63 63 public: 64 64 PickupManager(); 65 65 virtual ~PickupManager(); 66 66 67 67 static PickupManager& getInstance() { return Singleton<PickupManager>::getInstance(); } // tolua_export 68 68 69 69 bool registerRepresentation(const PickupIdentifier* identifier, PickupRepresentation* representation); //!< Registers a PickupRepresentation together with the PickupIdentifier of the Pickupable the PickupRepresentation represents. 70 70 bool unregisterRepresentation(const PickupIdentifier* identifier, PickupRepresentation* representation); //!< Unegisters a PickupRepresentation together with the PickupIdentifier of the Pickupable the PickupRepresentation represents. 71 71 PickupRepresentation* getRepresentation(const PickupIdentifier* identifier); //!< Get the PickupRepresentation representing the Pickupable with the input PickupIdentifier. 72 72 73 73 // tolua_begin 74 74 int getNumPickups(void); … … 80 80 bool isValidPickup(orxonox::Pickupable* pickup) { std::map<Pickupable*, WeakPtr<Pickupable> >::iterator it = this->pickupsList_.find(pickup); if(it == this->pickupsList_.end()) return false; return it->second.get() != NULL; } 81 81 // tolua_end 82 82 83 83 private: 84 84 static PickupManager* singletonPtr_s; 85 85 static const std::string guiName_s; 86 86 87 87 PickupRepresentation* defaultRepresentation_; //!< The default PickupRepresentation. 88 88 std::map<const PickupIdentifier*, PickupRepresentation*, PickupIdentifierCompare> representations_; //!< Map linking PickupIdentifiers (representing types if Pickupables) and PickupRepresentations. … … 92 92 93 93 std::vector<PickupCarrier*>* getAllCarriers(PickupCarrier* carrier); 94 94 95 95 }; // tolua_export 96 96 97 97 } // tolua_export 98 98 -
code/branches/presentation3/src/modules/pickup/PickupPrereqs.h
r7034 r7127 65 65 namespace orxonox 66 66 { 67 67 68 68 class DroppedPickup; 69 69 class Pickup; -
code/branches/presentation3/src/modules/pickup/PickupRepresentation.cc
r6725 r7127 41 41 namespace orxonox 42 42 { 43 43 44 44 CreateFactory(PickupRepresentation); 45 45 46 46 /** 47 47 @brief … … 52 52 { 53 53 RegisterObject(PickupRepresentation); 54 54 55 55 this->initialize(); 56 56 } 57 57 58 58 /** 59 59 @brief … … 63 63 { 64 64 RegisterObject(PickupRepresentation); 65 65 66 66 this->initialize(); 67 67 } 68 68 69 69 /** 70 70 @brief … … 75 75 if(this->spawnerRepresentation_ != NULL) 76 76 this->spawnerRepresentation_->destroy(); 77 77 78 78 if(this->pickup_ != NULL) 79 79 PickupManager::getInstance().unregisterRepresentation(this->pickup_->getPickupIdentifier(), this); 80 80 } 81 81 82 82 /** 83 83 @brief … … 91 91 this->inventoryRepresentation_ = "Default"; 92 92 } 93 93 94 94 /** 95 95 @brief … … 99 99 { 100 100 SUPER(PickupRepresentation, XMLPort, xmlelement, mode); 101 101 102 102 XMLPortParam(PickupRepresentation, "pickupName", setPickupName, getPickupName, xmlelement, mode); 103 103 XMLPortParam(PickupRepresentation, "pickupDescription", setPickupDescription, getPickupDescription, xmlelement, mode); … … 106 106 XMLPortObject(PickupRepresentation, Pickupable, "pickup", setPickup, getPickup, xmlelement, mode); 107 107 XMLPortObject(PickupRepresentation, StaticEntity, "spawner-representation", setSpawnerRepresentation, getSpawnerRepresentationIndex, xmlelement, mode); 108 108 109 109 PickupManager::getInstance().registerRepresentation(this->pickup_->getPickupIdentifier(), this); //!< Registers the PickupRepresentation with the PickupManager through the PickupIdentifier of the Pickupable it represents. 110 110 111 111 if(this->spawnerRepresentation_ != NULL) 112 112 this->spawnerRepresentation_->setVisible(false); 113 113 114 114 COUT(4) << "PickupRepresentation created: name: '" << this->name_ << "', description: '" << this->description_ << "', spawnerTemplate: '" << this->spawnerTemplate_ << "'." << std::endl; 115 115 } 116 116 117 117 /** 118 118 @brief … … 136 136 this->addTemplate(this->spawnerTemplate_); 137 137 } 138 138 139 139 StaticEntity* representation = this->spawnerRepresentation_; 140 140 representation->setVisible(true); 141 141 142 142 this->addTemplate(this->spawnerTemplate_); 143 143 this->spawnerRepresentation_->setVisible(false); 144 144 145 145 return representation; 146 146 } 147 147 148 148 /** 149 149 @brief … … 171 171 return representation; 172 172 } 173 173 174 174 } -
code/branches/presentation3/src/modules/pickup/PickupRepresentation.h
r6711 r7127 56 56 : public BaseObject 57 57 { // tolua_export 58 58 59 59 public: 60 60 PickupRepresentation(); //!< Constructor 61 61 PickupRepresentation(BaseObject* creator); //!< Default constructor. 62 62 virtual ~PickupRepresentation(); //!< Destructor. 63 63 64 64 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 65 65 66 66 /** 67 67 @brief Set the name of the Pickupable represented by this PickupRepresentation. … … 102 102 inline void setPickup(Pickupable* pickup) 103 103 { this->pickup_ = pickup; } 104 104 105 105 /** 106 106 @brief Get the name of the Pickupable represented by this PickupRepresentation. … … 138 138 inline const Pickupable* getPickup(unsigned int index) 139 139 { if(index == 0) return this->pickup_; return NULL; } 140 140 141 141 StaticEntity* getSpawnerRepresentation(PickupSpawner* spawner); //!< Get a spawnerRepresentation for a specific PickupSpawner. 142 142 143 143 private: 144 144 void initialize(void); //!< Initializes the member variables of this PickupRepresentation. 145 145 StaticEntity* getDefaultSpawnerRepresentation(PickupSpawner* spawner); //!< Get the default spawnerRepresentation for a specific PickupSpawner. 146 146 147 147 std::string name_; //!< The name of the Pickupable represented by this PickupRepresentation. 148 148 std::string description_; //!< The description of the Pickupable represented by this PickupRepresentation. … … 150 150 StaticEntity* spawnerRepresentation_; //!< The spawnerRepresentation of this PickupRepresentation. 151 151 std::string inventoryRepresentation_; //!< The name of an image representing the pickup in the PickupInventory. TODO: Exact format and placement of image? 152 152 153 153 Pickupable* pickup_; //!< The Pickupable that is represented by this PickupRepresentation. 154 154 155 155 }; // tolua_export 156 156 157 157 } // tolua_export 158 158 159 159 #endif // _PickupRepresentation_H__ -
code/branches/presentation3/src/modules/pickup/PickupSpawner.cc
r7086 r7127 55 55 { 56 56 RegisterObject(PickupSpawner); 57 57 58 58 this->initialize(); 59 59 } … … 76 76 { 77 77 RegisterObject(PickupSpawner); 78 78 79 79 this->initialize(); 80 80 81 81 this->pickup_ = pickup; 82 82 … … 84 84 this->respawnTime_ = respawnTime; 85 85 this->setMaxSpawnedItems(maxSpawnedItems); 86 86 87 87 if(this->pickup_ == NULL) 88 88 { … … 132 132 133 133 XMLPortObject(PickupSpawner, Pickupable, "pickup", setPickupable, getPickupable, xmlelement, mode); 134 134 135 135 XMLPortParam(PickupSpawner, "triggerDistance", setTriggerDistance, getTriggerDistance, xmlelement, mode); 136 136 XMLPortParam(PickupSpawner, "respawnTime", setRespawnTime, getRespawnTime, xmlelement, mode); 137 137 XMLPortParam(PickupSpawner, "maxSpawnedItems", setMaxSpawnedItems, getMaxSpawnedItems, xmlelement, mode); 138 138 139 139 if(this->pickup_ == NULL) 140 140 { … … 150 150 } 151 151 } 152 152 153 153 /** 154 154 @brief … … 161 161 this->setVisible(this->isActive()); 162 162 } 163 163 164 164 /** 165 165 @brief … … 172 172 { 173 173 SUPER(PickupSpawner, tick, dt); 174 174 175 175 //! If the PickupSpawner is active. 176 176 if (this->isActive()) 177 177 { 178 178 SmartPtr<PickupSpawner> temp = this; // create a smart pointer to keep the PickupSpawner alive until we iterated through all Pawns (in case a Pawn takes the last pickup) 179 179 180 180 //! Iterate trough all Pawns. 181 181 for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it) … … 191 191 } 192 192 } 193 193 194 194 /** 195 195 @brief … … 203 203 this->spawnsRemaining_ = items; 204 204 } 205 205 206 206 /** 207 207 @brief … … 230 230 } 231 231 } 232 232 233 233 /** 234 234 @brief … … 239 239 this->respawnTimer_.setTimer(this->respawnTime_, false, createExecutor(createFunctor(&PickupSpawner::respawnTimerCallback, this))); 240 240 } 241 241 242 242 /** 243 243 @brief … … 258 258 return; 259 259 } 260 260 261 261 this->pickup_ = pickup; 262 262 } 263 263 264 264 /** 265 265 @brief … … 285 285 { 286 286 COUT(4) << "PickupSpawner (&" << this << ") triggered and active." << std::endl; 287 287 288 288 PickupCarrier* carrier = dynamic_cast<PickupCarrier*>(pawn); 289 289 if(carrier == NULL) … … 292 292 return; 293 293 } 294 294 295 295 if(!carrier->isTarget(this->pickup_)) 296 296 { … … 298 298 return; 299 299 } 300 300 301 301 PickupCarrier* target = carrier->getTarget(this->pickup_); 302 302 Pickupable* pickup = this->getPickup(); 303 303 304 304 if(target != NULL && pickup != NULL) 305 305 { … … 317 317 if(target == NULL) 318 318 COUT(1) << "PickupSpawner (&" << this << "): Pickupable has no target." << std::endl; 319 319 320 320 if(pickup == NULL) 321 321 { … … 335 335 @return 336 336 The Pickupable created. 337 */ 337 */ 338 338 Pickupable* PickupSpawner::getPickup(void) 339 339 { … … 343 343 return NULL; 344 344 } 345 345 346 346 Pickupable* pickup = this->pickup_->clone(); 347 347 return pickup; -
code/branches/presentation3/src/modules/pickup/PickupSpawner.h
r6540 r7127 101 101 protected: 102 102 void decrementSpawnsRemaining(void); //!< Decrements the number of remaining spawns. 103 103 104 104 void startRespawnTimer(void); 105 105 106 106 virtual Pickupable* getPickup(void); //!< Creates a new Pickupable. 107 107 108 108 void setPickupable(Pickupable* pickup); //!< Sets a Pickupable for the PickupSpawner to spawn. 109 109 const Pickupable* getPickupable(void); //!< Get the Pickupable that is spawned by this PickupSpawner. 110 110 111 111 Pickupable* pickup_; //!< The pickup to be spawned. 112 112 113 113 private: 114 114 void initialize(void); 115 115 116 116 void trigger(Pawn* pawn); //!< Method called when a Pawn is close enough. 117 117 void respawnTimerCallback(); //!< Method called when the timer runs out. -
code/branches/presentation3/src/modules/pickup/items/DronePickup.cc
r7034 r7127 49 49 50 50 CreateFactory(DronePickup); 51 51 52 52 /** 53 53 @brief … … 57 57 { 58 58 RegisterObject(DronePickup); 59 59 60 60 this->initialize(); 61 61 } 62 62 63 63 /** 64 64 @brief … … 67 67 DronePickup::~DronePickup() 68 68 { 69 69 70 70 } 71 71 72 72 /** 73 @brief 73 @brief 74 74 Initializes the member variables. 75 75 */ … … 80 80 this->droneTemplate_ = ""; 81 81 } 82 82 83 83 /** 84 84 @brief … … 91 91 this->pickupIdentifier_->addParameter(type, val); 92 92 } 93 93 94 94 /** 95 95 @brief … … 100 100 SUPER(DronePickup, XMLPort, xmlelement, mode); 101 101 XMLPortParam(DronePickup, "droneTemplate", setDroneTemplate, getDroneTemplate, xmlelement, mode); 102 102 103 103 this->initializeIdentifier(); 104 104 } 105 105 106 106 void DronePickup::setDroneTemplate(std::string templatename){ 107 107 droneTemplate_ = templatename; 108 } 109 108 } 109 110 110 const std::string& DronePickup::getDroneTemplate() const 111 111 { … … 120 120 { 121 121 SUPER(DronePickup, changedUsed); 122 122 123 123 //! If the pickup is not picked up nothing must be done. 124 124 if(!this->isPickedUp()) 125 125 return; 126 126 127 127 //! If the pickup has transited to used. 128 128 if(this->isUsed()) … … 132 132 if(pawn == NULL) //!< If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed. 133 133 this->destroy(); 134 134 135 135 //Attach to pawn 136 136 Drone* drone = new Drone(pawn->getCreator()); // this is neccessary because the projectiles fired need a valid creator for the particlespawner (when colliding against something) … … 143 143 droneController->setOwner(pawn); 144 144 } 145 145 146 146 Vector3 spawnPosition = pawn->getWorldPosition() + Vector3(30,0,-30); 147 147 drone->setPosition(spawnPosition); 148 148 149 149 //! The pickup has been used up. 150 150 this->setUsed(false); … … 159 159 } 160 160 } 161 161 162 162 /** 163 163 @brief … … 170 170 PickupCarrier* carrier = this->getCarrier(); 171 171 Pawn* pawn = dynamic_cast<Pawn*>(carrier); 172 172 173 173 if(pawn == NULL) 174 174 { 175 175 COUT(1) << "Invalid PickupCarrier in DronePickup." << std::endl; 176 176 } 177 177 178 178 return pawn; 179 179 } 180 180 181 181 /** 182 182 @brief … … 189 189 if(item == NULL) 190 190 item = new DronePickup(this); 191 191 192 192 SUPER(DronePickup, clone, item); 193 193 194 194 DronePickup* pickup = dynamic_cast<DronePickup*>(item); 195 195 pickup->setDroneTemplate(this->getDroneTemplate()); 196 196 197 197 pickup->initializeIdentifier(); 198 198 } -
code/branches/presentation3/src/modules/pickup/items/DronePickup.h
r7034 r7127 47 47 48 48 namespace orxonox { 49 49 50 50 51 51 class _PickupExport DronePickup : public Pickup, public Tickable 52 52 { 53 53 public: 54 54 55 55 DronePickup(BaseObject* creator); //!< Constructor. 56 56 virtual ~DronePickup(); //!< Destructor. 57 57 58 58 virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode); //!< Method for creating a DronePickup object through XML. 59 59 60 60 virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around. 61 61 virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input OrxonoxClass. 62 62 63 63 void setDroneTemplate(std::string templatename); 64 const std::string& getDroneTemplate() const; 65 64 const std::string& getDroneTemplate() const; 65 66 66 protected: 67 67 void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup. 68 68 69 69 private: 70 70 void initialize(void); //!< Initializes the member variables. 71 71 std::string droneTemplate_; 72 72 Pawn* carrierToPawnHelper(void); //!< Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails. 73 74 73 75 74 75 76 76 }; 77 77 } -
code/branches/presentation3/src/modules/pickup/items/HealthPickup.cc
r7008 r7127 45 45 namespace orxonox 46 46 { 47 47 48 48 /*static*/ const std::string HealthPickup::healthTypeLimited_s = "limited"; 49 49 /*static*/ const std::string HealthPickup::healthTypeTemporary_s = "temporary"; 50 50 /*static*/ const std::string HealthPickup::healthTypePermanent_s = "permanent"; 51 51 52 52 CreateFactory(HealthPickup); 53 53 54 54 /** 55 55 @brief … … 59 59 { 60 60 RegisterObject(HealthPickup); 61 61 62 62 this->initialize(); 63 63 } 64 64 65 65 /** 66 66 @brief … … 69 69 HealthPickup::~HealthPickup() 70 70 { 71 72 } 73 74 /** 75 @brief 71 72 } 73 74 /** 75 @brief 76 76 Initializes the member variables. 77 77 */ 78 78 void HealthPickup::initialize(void) 79 { 79 { 80 80 this->health_ = 0; 81 81 this->healthRate_ = 0; … … 83 83 this->maxHealthSave_ = 0; 84 84 this->maxHealthOverwrite_ = 0; 85 85 86 86 this->addTarget(ClassIdentifier<Pawn>::getIdentifier()); 87 87 } 88 88 89 89 /** 90 90 @brief … … 98 98 std::string val1 = stream.str(); 99 99 this->pickupIdentifier_->addParameter(type1, val1); 100 100 101 101 std::string val2 = this->getHealthType(); 102 102 std::string type2 = "healthType"; 103 103 this->pickupIdentifier_->addParameter(type2, val2); 104 104 105 105 stream.clear(); 106 106 stream << this->getHealthRate(); … … 109 109 this->pickupIdentifier_->addParameter(type3, val3); 110 110 } 111 111 112 112 /** 113 113 @brief … … 117 117 { 118 118 SUPER(HealthPickup, XMLPort, xmlelement, mode); 119 119 120 120 XMLPortParam(HealthPickup, "health", setHealth, getHealth, xmlelement, mode); 121 121 XMLPortParam(HealthPickup, "healthRate", setHealthRate, getHealthRate, xmlelement, mode); 122 122 XMLPortParam(HealthPickup, "healthType", setHealthType, getHealthType, xmlelement, mode); 123 123 124 124 if(!this->isContinuous()) 125 125 this->healthRate_ = 0.0; 126 126 127 127 this->initializeIdentifier(); 128 128 } 129 129 130 130 /** 131 131 @brief … … 138 138 { 139 139 SUPER(HealthPickup, tick, dt); 140 140 141 141 if(this->isContinuous() && this->isUsed()) 142 142 { … … 144 144 if(pawn == NULL) //!< If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed. 145 145 this->destroy(); 146 146 147 147 //! Calculate the health that is added this tick. 148 148 float health = dt*this->getHealthRate(); … … 152 152 float fullHealth = pawn->getHealth() + health; 153 153 this->setHealth(this->getHealth()-health); 154 154 155 155 switch(this->getHealthTypeDirect()) 156 156 { … … 173 173 COUT(1) << "Invalid healthType in HealthPickup." << std::endl; 174 174 } 175 175 176 176 //! If all health has been transfered. 177 177 if(this->getHealth() == 0) … … 181 181 } 182 182 } 183 183 184 184 /** 185 185 @brief … … 193 193 if(!this->isPickedUp()) 194 194 return; 195 195 196 196 //! If the pickup has transited to used. 197 197 if(this->isUsed()) … … 202 202 if(pawn == NULL) //!< If the PickupCarrier is no Pawn, then this pickup is useless and therefore is destroyed. 203 203 this->destroy(); 204 204 205 205 float health = 0; 206 206 switch(this->getHealthTypeDirect()) … … 226 226 COUT(1) << "Invalid healthType in HealthPickup." << std::endl; 227 227 } 228 228 229 229 //! The pickup has been used up. 230 230 this->setUsed(false); … … 237 237 PickupCarrier* carrier = this->getCarrier(); 238 238 Pawn* pawn = dynamic_cast<Pawn*>(carrier); 239 239 240 240 if(pawn == NULL) 241 241 { … … 244 244 return; 245 245 } 246 246 247 247 if(pawn->getMaxHealth() == this->maxHealthOverwrite_) 248 248 { … … 252 252 } 253 253 } 254 254 255 255 //! If either the pickup can only be used once or it is continuous and used up, it is destroyed upon setting it to unused. 256 256 if(this->isOnce() || (this->isContinuous() && this->getHealth() == 0)) … … 260 260 } 261 261 } 262 262 263 263 /** 264 264 @brief … … 271 271 PickupCarrier* carrier = this->getCarrier(); 272 272 Pawn* pawn = dynamic_cast<Pawn*>(carrier); 273 273 274 274 if(pawn == NULL) 275 275 { 276 276 COUT(1) << "Invalid PickupCarrier in HealthPickup." << std::endl; 277 277 } 278 278 279 279 return pawn; 280 280 } 281 281 282 282 /** 283 283 @brief … … 297 297 pickup->setHealthRate(this->getHealthRate()); 298 298 pickup->setHealthTypeDirect(this->getHealthTypeDirect()); 299 299 300 300 pickup->initializeIdentifier(); 301 301 } 302 302 303 303 /** 304 304 @brief … … 322 322 } 323 323 } 324 324 325 325 /** 326 326 @brief … … 341 341 } 342 342 } 343 343 344 344 /** 345 345 @brief … … 356 356 else 357 357 { 358 COUT(1) << "Invalid healthSpeed in HealthPickup." << std::endl; 359 } 360 } 361 358 COUT(1) << "Invalid healthSpeed in HealthPickup." << std::endl; 359 } 360 } 361 362 362 /** 363 363 @brief -
code/branches/presentation3/src/modules/pickup/items/HealthPickup.h
r6709 r7127 45 45 46 46 namespace orxonox { 47 47 48 48 //! Enum for the type of the HealthPickup 49 49 namespace pickupHealthType … … 56 56 }; 57 57 } 58 58 59 59 /** 60 60 @brief … … 71 71 { 72 72 public: 73 73 74 74 HealthPickup(BaseObject* creator); //!< Constructor. 75 75 virtual ~HealthPickup(); //!< Destructor. 76 76 77 77 virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode); //!< Method for creating a HealthPickup object through XML. 78 78 virtual void tick(float dt); //!< Is called every tick. 79 79 80 80 virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around. 81 81 virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input OrxonoxClass. 82 82 83 83 /** 84 84 @brief Get the health that is transfered to the Pawn upon usage of this pickup. … … 93 93 inline float getHealthRate(void) 94 94 { return this->healthRate_; } 95 95 96 96 /** 97 97 @brief Get the type of HealthPickup, this pickup is. 98 @return Returns the health type as an enum. 98 @return Returns the health type as an enum. 99 99 */ 100 100 inline pickupHealthType::Value getHealthTypeDirect(void) 101 101 { return this->healthType_; } 102 102 const std::string& getHealthType(void); //!< Get the health type of this pickup. 103 103 104 104 protected: 105 105 void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup. … … 107 107 void setHealth(float health); //!< Sets the health. 108 108 void setHealthRate(float speed); //!< Set the rate at which health is transferred if the pickup is continuous. 109 109 110 110 /** 111 111 @brief Set the health type of this pickup. … … 115 115 { this->healthType_ = type; } 116 116 void setHealthType(std::string type); //!< Set the type of the HealthPickup. 117 117 118 118 private: 119 119 void initialize(void); //!< Initializes the member variables. 120 120 Pawn* carrierToPawnHelper(void); //!< Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails. 121 121 122 122 float health_; //!< The health that is transferred to the Pawn. 123 123 float healthRate_; //!< The rate at which the health is transferred. … … 125 125 float maxHealthOverwrite_; //!< Helper to remember with which value we overwrote the maxHealh, to detect if someone else changed it as well. 126 126 pickupHealthType::Value healthType_; //!< The type of the HealthPickup. 127 127 128 128 //! Strings for the health types. 129 129 static const std::string healthTypeLimited_s; 130 130 static const std::string healthTypeTemporary_s; 131 131 static const std::string healthTypePermanent_s; 132 132 133 133 }; 134 134 } -
code/branches/presentation3/src/modules/pickup/items/InvisiblePickup.h
r7112 r7127 44 44 45 45 namespace orxonox { 46 46 47 47 /** 48 48 @brief … … 57 57 { 58 58 public: 59 59 60 60 InvisiblePickup(BaseObject* creator); //!< Constructor. 61 61 virtual ~InvisiblePickup(); //!< Destructor. … … 63 63 virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around. 64 64 virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input OrxonoxClass. 65 65 66 66 /** 67 67 @brief Checks whether the Pawn is invisible. … … 72 72 inline float getDuration() 73 73 { return this->duration_; } 74 74 75 75 protected: 76 76 bool setInvisible(bool invisibility); //!< Set the Pawn to be invisible or visible again. … … 78 78 void initializeIdentifier(void); 79 79 virtual void pickupTimerCallback(void); //!< Function that gets called when the timer ends. 80 80 81 81 private: 82 82 void initialize(void); //!< Initializes the member variables. -
code/branches/presentation3/src/modules/pickup/items/MetaPickup.cc
r6709 r7127 40 40 41 41 namespace orxonox { 42 42 43 43 CreateFactory(MetaPickup); 44 44 45 45 //! Setting the static variables to their values. 46 46 /*static*/ const std::string MetaPickup::metaTypeNone_s = "none"; 47 47 /*static*/ const std::string MetaPickup::metaTypeUse_s = "use"; 48 48 /*static*/ const std::string MetaPickup::metaTypeDrop_s = "drop"; 49 49 50 50 /** 51 51 @brief … … 55 55 { 56 56 RegisterObject(MetaPickup); 57 57 58 58 this->initialize(); 59 59 } 60 60 61 61 /** 62 62 @brief … … 65 65 MetaPickup::~MetaPickup() 66 66 { 67 68 } 69 67 68 } 69 70 70 /** 71 71 @brief … … 75 75 { 76 76 this->addTarget(ClassIdentifier<PickupCarrier>::getIdentifier()); 77 77 78 78 this->setActivationTypeDirect(pickupActivationType::immediate); 79 79 this->setDurationTypeDirect(pickupDurationType::once); 80 80 this->metaType_ = pickupMetaType::none; 81 81 } 82 82 83 83 /** 84 84 @brief … … 91 91 this->pickupIdentifier_->addParameter(type, val); 92 92 } 93 93 94 94 /** 95 95 @brief … … 99 99 { 100 100 SUPER(MetaPickup, XMLPort, xmlelement, mode); 101 101 102 102 XMLPortParam(MetaPickup, "metaType", setMetaType, getMetaType, xmlelement, mode); 103 103 104 104 this->initializeIdentifier(); 105 105 } 106 106 107 107 /** 108 108 @brief … … 113 113 { 114 114 SUPER(MetaPickup, changedUsed); 115 115 116 116 //! If the MetaPickup transited to used. 117 117 if(this->isUsed()) … … 144 144 } 145 145 } 146 146 147 147 /** 148 148 @brief … … 155 155 if(item == NULL) 156 156 item = new MetaPickup(this); 157 157 158 158 SUPER(MetaPickup, clone, item); 159 159 160 160 MetaPickup* pickup = dynamic_cast<MetaPickup*>(item); 161 161 pickup->setMetaTypeDirect(this->getMetaTypeDirect()); 162 162 163 163 pickup->initializeIdentifier(); 164 164 } 165 165 166 166 /** 167 167 @brief … … 184 184 } 185 185 } 186 186 187 187 /** 188 188 @brief … … 206 206 } 207 207 } 208 208 209 209 } -
code/branches/presentation3/src/modules/pickup/items/MetaPickup.h
r6709 r7127 51 51 }; 52 52 } 53 53 54 54 /** 55 55 @brief … … 60 60 class _PickupExport MetaPickup : public Pickup 61 61 { 62 62 63 63 public: 64 64 MetaPickup(BaseObject* creator); //!< Constructor. Registers and initializes the object. 65 65 virtual ~MetaPickup(); //!< Destructor. 66 66 67 67 virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode); //!< Method for creating a MetaPickup object through XML. 68 68 69 69 virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around. 70 70 virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input OrxonoxClass. 71 71 72 72 /** 73 73 @brief Returns the meta type of the MetaPickup. … … 77 77 { return this->metaType_; } 78 78 const std::string& getMetaType(void); //!< Get the meta type of this MetaPickup. 79 79 80 80 protected: 81 81 void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup. 82 82 83 83 /** 84 84 @brief Set the meta type of the MetaPickup. … … 88 88 { this->metaType_ = type; } 89 89 void setMetaType(const std::string& type); //!< Set the meta type of this MetaPickup. 90 90 91 91 private: 92 92 void initialize(void); //!< Initializes the member variables. 93 93 94 94 pickupMetaType::Value metaType_; //!< The meta type of the MetaPickup, determines which actions are taken. 95 95 96 96 //! Static strings for the meta types. 97 97 static const std::string metaTypeNone_s; 98 98 static const std::string metaTypeUse_s; 99 99 static const std::string metaTypeDrop_s; 100 101 100 101 102 102 }; 103 103 -
code/branches/presentation3/src/modules/pickup/items/ShieldPickup.cc
r6998 r7127 79 79 PickupCarrier* carrier = this->getCarrier(); 80 80 Pawn* pawn = dynamic_cast<Pawn*>(carrier); 81 81 82 82 if(pawn == NULL) 83 83 { … … 86 86 return pawn; 87 87 } 88 88 89 89 /** 90 90 @brief … … 117 117 std::string val2 = stream.str(); 118 118 this->pickupIdentifier_->addParameter(type2, val2); 119 119 120 120 stream.clear(); 121 121 stream << this->getShieldAbsorption(); … … 269 269 270 270 void ShieldPickup::pickupTimerCallback(void) 271 { 271 { 272 272 this->setUsed(false); 273 273 } -
code/branches/presentation3/src/modules/pickup/items/SpeedPickup.cc
r6755 r7127 137 137 if(engine == NULL) //!< If the PickupCarrier is no Engine, then this pickup is useless and therefore is destroyed. 138 138 this->destroy(); 139 139 140 140 //! If the pickup has transited to used. 141 141 if(this->isUsed()) … … 156 156 engine->setSpeedAdd(0.0f); 157 157 engine->setSpeedMultiply(1.0f); 158 158 159 159 if(this->isOnce()) 160 160 { … … 186 186 COUT(1) << "Invalid PickupCarrier in SpeedPickup." << std::endl; 187 187 } 188 188 189 189 return engine; 190 190 } … … 269 269 270 270 void SpeedPickup::pickupTimerCallback(void) 271 { 271 { 272 272 this->setUsed(false); 273 273 } -
code/branches/presentation3/src/modules/pickup/items/SpeedPickup.h
r6709 r7127 78 78 protected: 79 79 void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup. 80 80 81 81 virtual void pickupTimerCallback(void); //!< Function that gets called when timer ends. 82 82 -
code/branches/presentation3/src/modules/questsystem/Quest.h
r7072 r7127 105 105 virtual bool fail(PlayerInfo* player); //!< Fails the Quest. 106 106 virtual bool complete(PlayerInfo* player); //!< Completes the Quest. 107 107 108 108 bool addListener(QuestListener* listener); //!< Adds a QuestListener to the list of QuestListeners listening to this Quest. 109 109 -
code/branches/presentation3/src/modules/questsystem/QuestEffectBeacon.cc
r6945 r7127 112 112 MultiTriggerContainer* mTrigger = orxonox_cast<MultiTriggerContainer*>(trigger); 113 113 Pawn* pawn = NULL; 114 114 115 115 //! If the trigger is neither a Playertrigger nor a MultiTrigger (i.e. a MultitriggerContainer) we can do anything with it. 116 116 if(pTrigger == NULL && mTrigger == NULL) 117 117 return false; 118 119 // If the trigger is a PlayerTrigger. 118 119 // If the trigger is a PlayerTrigger. 120 120 if(pTrigger != NULL) 121 121 { … … 125 125 pawn = pTrigger->getTriggeringPlayer(); 126 126 } 127 127 128 128 // If the trigger is a MultiTrigger (i.e. a MultiTriggerContainer) 129 129 if(mTrigger != NULL) -
code/branches/presentation3/src/modules/questsystem/QuestItem.cc
r6945 r7127 42 42 43 43 CreateUnloadableFactory(QuestItem); 44 44 45 45 /** 46 46 @brief … … 50 50 { 51 51 this->registered_ = false; 52 52 53 53 RegisterObject(QuestItem); 54 54 } -
code/branches/presentation3/src/modules/questsystem/QuestManager.cc
r7072 r7127 74 74 QuestManager::~QuestManager() 75 75 { 76 76 77 77 } 78 78 … … 250 250 return numQuests; 251 251 } 252 252 253 253 Quest* QuestManager::getParentQuest(PlayerInfo* player, int index) 254 254 { … … 272 272 return numQuests; 273 273 } 274 274 275 275 Quest* QuestManager::getSubQuest(Quest* quest, PlayerInfo* player, int index) 276 276 { … … 295 295 return numHints; 296 296 } 297 297 298 298 QuestHint* QuestManager::getHints(Quest* quest, PlayerInfo* player, int index) 299 299 { -
code/branches/presentation3/src/modules/questsystem/QuestNotification.cc
r6945 r7127 35 35 36 36 CreateUnloadableFactory(QuestNotification); 37 37 38 38 /** 39 39 @brief -
code/branches/presentation3/src/modules/questsystem/notifications/Notification.cc
r6945 r7127 41 41 42 42 CreateUnloadableFactory(Notification); 43 43 44 44 /** 45 45 @brief … … 69 69 Notification::~Notification() 70 70 { 71 71 72 72 } 73 73 -
code/branches/presentation3/src/modules/questsystem/notifications/NotificationManager.cc
r6945 r7127 66 66 NotificationManager::~NotificationManager() 67 67 { 68 68 69 69 } 70 70 … … 227 227 int identifier = this->listenerList_.find(listener)->second; 228 228 std::multimap<std::time_t, Notification*>* map = this->notificationLists_.find(identifier)->second; 229 229 230 230 // Make sure all Notifications are removed. 231 231 std::multimap<std::time_t, Notification*>::iterator it = map->begin(); -
code/branches/presentation3/src/modules/questsystem/notifications/NotificationQueue.cc
r6945 r7127 57 57 { 58 58 this->registered_ = false; 59 59 60 60 RegisterObject(NotificationQueue); 61 61 this->initialize(); … … 431 431 // Unregister the NotificationQueue with the NotificationManager. 432 432 NotificationManager::getInstance().unregisterNotification(container->notification, this); 433 433 434 434 this->removeElement(container->overlay); 435 435 this->containers_.erase(container); -
code/branches/presentation3/src/modules/weapons/RocketController.cc
r7021 r7127 28 28 29 29 #include "RocketController.h" 30 #include "projectiles/SimpleRocket.h" 30 #include "projectiles/SimpleRocket.h" 31 31 #include "util/Math.h" 32 32 #include "weapons/projectiles/SimpleRocket.h" … … 66 66 this->moveToTargetPosition(); 67 67 } 68 69 68 69 70 70 } 71 71 … … 102 102 103 103 104 if (distance > 1000 && this->rocket_->getVelocity().squaredLength()<160000) 104 if (distance > 1000 && this->rocket_->getVelocity().squaredLength()<160000) 105 105 this->rocket_->setAcceleration(this->rocket_->getOrientation()*Vector3(-20,-20,-20)); 106 106 if (distance <1000) this->rocket_->setAcceleration(0,0,0); -
code/branches/presentation3/src/modules/weapons/RocketController.h
r7039 r7127 50 50 RocketController(BaseObject* creator); 51 51 virtual ~RocketController(); 52 52 53 53 virtual void tick(float dt); 54 54 SimpleRocket* getRocket() const … … 64 64 Vector3 targetPosition_; 65 65 WeakPtr<PlayerInfo> player_; 66 66 67 67 WeakPtr<WorldEntity> target_; 68 68 -
code/branches/presentation3/src/modules/weapons/projectiles/Rocket.cc
r7018 r7127 167 167 this->localAngularVelocity_ = 0; 168 168 } 169 169 170 170 if( GameMode::isMaster() ) 171 171 { 172 172 if( this->bDestroy_ ) 173 173 this->destroy(); 174 174 175 175 } 176 176 } -
code/branches/presentation3/src/modules/weapons/projectiles/SimpleRocket.cc
r7025 r7127 71 71 this->fire_ = new ParticleEmitter(this); 72 72 this->attach(this->fire_); 73 73 74 74 this->fire_->setOrientation(this->getOrientation()); 75 75 this->fire_->setSource("Orxonox/simplerocketfire"); … … 90 90 91 91 92 92 93 93 /** 94 94 * @brief updates state of rocket, disables fire if no fuel … … 107 107 this->localAngularVelocity_ = 0; 108 108 109 109 110 110 if (this->fuel_) 111 111 { 112 if (this->destroyTimer_.getRemainingTime()< (static_cast<float>(this->FUEL_PERCENTAGE)/100) *this->lifetime_ ) 112 if (this->destroyTimer_.getRemainingTime()< (static_cast<float>(this->FUEL_PERCENTAGE)/100) *this->lifetime_ ) 113 113 this->fuel_=false; 114 114 } else 115 115 this->disableFire(); 116 116 117 if( this->bDestroy_ ) 117 if( this->bDestroy_ ) 118 118 this->destroy(); 119 119 } 120 120 121 121 } 122 122 … … 127 127 void SimpleRocket::disableFire() 128 128 { 129 this->setAcceleration(0,0,0); 129 this->setAcceleration(0,0,0); 130 130 this->fire_->detachFromParent(); 131 131 } … … 137 137 SimpleRocket::~SimpleRocket() 138 138 { 139 if (this->isInitialized()) 139 if (this->isInitialized()) 140 140 { 141 141 if( GameMode::isMaster() ) -
code/branches/presentation3/src/modules/weapons/projectiles/SimpleRocket.h
r7095 r7127 98 98 */ 99 99 inline void rotatePitch(float value) 100 { 100 { 101 101 this->rotatePitch(Vector2(value, 0)); } 102 102 /** … … 105 105 */ 106 106 inline void rotateRoll(float value) 107 { 107 { 108 108 this->rotateRoll(Vector2(value, 0)); } 109 109 … … 124 124 Vector3 localAngularVelocity_; 125 125 float damage_; 126 bool bDestroy_; 126 bool bDestroy_; 127 127 bool fuel_; //!< Bool is true while the rocket "has fuel" 128 128 -
code/branches/presentation3/src/modules/weapons/weaponmodes/SimpleRocketFire.cc
r7095 r7127 54 54 55 55 this->setMunitionName("TargetSeeking Rockets"); 56 this->setDefaultSoundWithVolume("sounds/Rocket_launch.ogg",0.4); 56 this->setDefaultSoundWithVolume("sounds/Rocket_launch.ogg",0.4); 57 57 // The firing sound of the Rocket is played in Rocket.cc (because of OpenAl sound positioning) 58 58 }
Note: See TracChangeset
for help on using the changeset viewer.