Changeset 9939 for code/trunk/src/modules
- Timestamp:
- Dec 21, 2013, 11:16:54 PM (11 years ago)
- Location:
- code/trunk
- Files:
-
- 19 edited
- 23 copied
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/modules/CMakeLists.txt
r9348 r9939 39 39 ADD_SUBDIRECTORY(docking) 40 40 ADD_SUBDIRECTORY(towerdefense) 41 ADD_SUBDIRECTORY(invader) -
code/trunk/src/modules/docking/Dock.cc
r9667 r9939 69 69 XMLPortObject(Dock, DockingAnimation, "animations", addAnimation, getAnimation, xmlelement, mode); 70 70 XMLPortEventSink(Dock, BaseObject, "execute", execute, xmlelement, mode); 71 XMLPortEventSink(Dock, BaseObject, "undocking", undocking, xmlelement, mode); 72 71 73 } 72 74 … … 76 78 77 79 XMLPortEventSink(Dock, BaseObject, "execute", execute, xmlelement, mode); 78 } 80 81 XMLPortEventSink(Dock, BaseObject, "undocking", undocking, xmlelement, mode); 82 } 83 84 85 bool Dock::undocking(bool bTriggered, BaseObject* trigger) 86 { 87 88 PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger); 89 PlayerInfo* player = NULL; 90 91 // Check whether it is a player trigger and extract pawn from it 92 if(pTrigger != NULL) 93 { 94 if(!pTrigger->isForPlayer()) { // The PlayerTrigger is not exclusively for Pawns which means we cannot extract one. 95 orxout(verbose, context::docking) << "Docking:execute PlayerTrigger was not triggered by a player.." << endl; 96 return false; 97 } 98 player = pTrigger->getTriggeringPlayer(); 99 } 100 else 101 { 102 orxout(verbose, context::docking) << "Docking::execute Not a player trigger, can't extract pawn from it.." << endl; 103 return false; 104 } 105 if(player == NULL) 106 { 107 orxout(verbose, context::docking) << "Docking::execute Can't retrieve PlayerInfo from Trigger. (" << trigger->getIdentifier()->getName() << ")" << endl; 108 return false; 109 } 110 111 if(bTriggered) 112 { 113 // Add player to this Docks candidates 114 candidates_.insert(player); 115 116 // Show docking dialog 117 this->showUndockingDialogHelper(player); 118 } 119 else 120 { 121 // Remove player from candidates list 122 candidates_.erase(player); 123 } 124 125 return true; 126 } 127 128 79 129 80 130 bool Dock::execute(bool bTriggered, BaseObject* trigger) … … 119 169 return true; 120 170 } 171 172 173 void Dock::showUndockingDialogHelper(PlayerInfo* player) 174 { 175 assert(player); 176 177 if(!player->isHumanPlayer()) 178 return; 179 180 if(GameMode::isMaster()) 181 { 182 if(GameMode::showsGraphics()) 183 GUIManager::showGUI("UndockingDialog"); 184 } 185 else 186 callStaticNetworkFunction(Dock::showDockingDialog, player->getClientID()); 187 188 } 121 189 122 190 void Dock::showDockingDialogHelper(PlayerInfo* player) … … 177 245 if (animations_.empty()) 178 246 return dockingAnimationFinished(player); 247 179 248 else 180 249 DockingAnimation::invokeAnimation(true, player, animations_); -
code/trunk/src/modules/docking/Dock.h
r9667 r9939 62 62 // Trigger interface 63 63 bool execute(bool bTriggered, BaseObject* trigger); 64 bool undocking(bool bTriggered, BaseObject* trigger); 64 65 65 66 // XML interface … … 85 86 void dock() 86 87 { this->dock(HumanController::getLocalControllerSingleton()->getPlayer()); } 88 void undock() 89 { this->undock(HumanController::getLocalControllerSingleton()->getPlayer()); } 87 90 static unsigned int getNumberOfActiveDocks(); 88 91 static Dock* getActiveDockAtIndex(unsigned int index); … … 95 98 // Network functions 96 99 void showDockingDialogHelper(PlayerInfo* player); 100 void showUndockingDialogHelper(PlayerInfo* player); 97 101 static void showDockingDialog(); 98 102 -
code/trunk/src/modules/docking/MoveToDockingTarget.cc
r9667 r9939 66 66 { 67 67 //TODO: Investigate strange things... 68 68 //this->parent_->detach((WorldEntity*)player->getControllableEntity()); 69 69 70 //TODO: Check the issue with this detach call. 71 //I have removed the line because the detach call only caused a warning and terminated. And because I didn't find a attach call either. 72 //Didn't find the need for the line. 70 73 this->parent_->undockingAnimationFinished(player); 71 74 return true; -
code/trunk/src/modules/objects/ForceField.cc
r9667 r9939 45 45 /*static*/ const std::string ForceField::modeSphere_s = "sphere"; 46 46 /*static*/ const std::string ForceField::modeInvertedSphere_s = "invertedSphere"; 47 48 /*static*/ const std::string ForceField::modeHomogen_s = "homogen"; 49 47 50 /*static*/ const std::string ForceField::modeNewtonianGravity_s = "newtonianGravity"; 48 51 /*static*/ const float ForceField::gravConstant_ = 6.673e-11; 49 52 /*static*/ const float ForceField::attenFactor_ = 1; 53 50 54 51 55 /** … … 89 93 XMLPortParam(ForceField, "length", setLength , getLength , xmlelement, mode).defaultValues(2000); 90 94 XMLPortParam(ForceField, "mode", setMode, getMode, xmlelement, mode); 95 XMLPortParam(ForceField, "forcedirection", setForceDirection, getForceDirection, xmlelement, mode).defaultValues(Vector3(0,-400,0)); 91 96 } 92 97 … … 196 201 } 197 202 } 203 else if(this->mode_ == forceFieldMode::homogen) 204 { 205 // Iterate over all objects that could possibly be affected by the ForceField. 206 for (ObjectList<MobileEntity>::iterator it = ObjectList<MobileEntity>::begin(); it != ObjectList<MobileEntity>::end(); ++it) 207 { 208 Vector3 distanceVector = it->getWorldPosition() - this->getWorldPosition(); 209 float distance = distanceVector.length(); 210 if (distance < this->radius_ && distance > this->massRadius_) 211 { 212 // Add a Acceleration in forceDirection_. 213 // Vector3(0,0,0) is the direction, where the force should work. 214 it->addAcceleration(forceDirection_ , Vector3(0,0,0)); 215 } 216 } 217 } 198 218 } 199 219 … … 214 234 else if(mode == ForceField::modeNewtonianGravity_s) 215 235 this->mode_ = forceFieldMode::newtonianGravity; 236 237 else if(mode == ForceField::modeHomogen_s) 238 this->mode_ = forceFieldMode::homogen; 239 216 240 else 217 241 { … … 239 263 case forceFieldMode::newtonianGravity: 240 264 return ForceField::modeNewtonianGravity_s; 265 266 case forceFieldMode::homogen: 267 return ForceField::modeHomogen_s; 268 241 269 default: 242 270 return ForceField::modeTube_s; -
code/trunk/src/modules/objects/ForceField.h
r9667 r9939 1 1 2 /* 2 3 * ORXONOX - the hottest 3D action shooter ever to exist … … 57 58 sphere, //!< The ForceField has a spherical shape. 58 59 invertedSphere, //!< The ForceField has a spherical shape but "inverted" behavior. 59 newtonianGravity //!< The ForceField imitates Newtonian gravitation for use in stellar bodies. 60 newtonianGravity, //!< The ForceField imitates Newtonian gravitation for use in stellar bodies. 61 homogen //!< Local homogenous Force field with changeable direction for the Space Station 60 62 }; 61 63 } … … 66 68 67 69 The following parameters can be set to specify the behavior of the ForceField. 70 - @b forcedirection The direction and the strength of the homogenous force field. Default is 0,-400,0. 68 71 - @b velocity The amount of force the ForceField excerts. Default is 100. 69 72 - @b diameter The diameter of the ForceField. Default is 500. … … 147 150 { return this->halfLength_*2; } 148 151 152 inline void setForceDirection(Vector3 forcedir) 153 { this->forceDirection_ = forcedir; } 154 155 inline Vector3 getForceDirection() 156 { return this->forceDirection_; } 157 158 149 159 void setMode(const std::string& mode); //!< Set the mode of the ForceField. 150 160 const std::string& getMode(void); //!< Get the mode of the ForceField. … … 156 166 static const std::string modeInvertedSphere_s; 157 167 static const std::string modeNewtonianGravity_s; 168 169 static const std::string modeHomogen_s; 158 170 159 171 float velocity_; //!< The velocity of the ForceField. … … 167 179 //! Attenuation factor for Newtonian ForceFields 168 180 static const float attenFactor_; 181 Vector3 forceDirection_; 169 182 }; 170 183 } -
code/trunk/src/modules/overlays/OverlaysPrereqs.h
r9526 r9939 80 80 class BarColour; 81 81 class ChatOverlay; 82 class CountDown; 82 83 class DeathMessage; 83 84 class GametypeFadingMessage; -
code/trunk/src/modules/overlays/debugging/CMakeLists.txt
r5781 r9939 2 2 DebugFPSText.cc 3 3 DebugRTRText.cc 4 DebugPositionText.cc 4 5 ) -
code/trunk/src/modules/overlays/hud/CMakeLists.txt
r9348 r9939 18 18 PauseNotice.cc 19 19 LastTeamStandingInfos.cc 20 CountDown.cc 20 21 ) -
code/trunk/src/modules/overlays/hud/HUDNavigation.cc
r9667 r9939 74 74 OrxonoxOverlay(context) 75 75 { 76 RegisterObject(HUDNavigation) 77 ;this->setConfigValues();76 RegisterObject(HUDNavigation); 77 this->setConfigValues(); 78 78 79 79 // Set default values -
code/trunk/src/modules/overlays/hud/HUDRadar.cc
r9667 r9939 25 25 * Co-authors: 26 26 * Reto Grieder 27 * Wolfgang Roenninger 27 28 * 28 29 */ … … 41 42 #include "Scene.h" 42 43 #include "Radar.h" 44 #include "core/config/ConfigValueIncludes.h" 43 45 44 46 namespace orxonox … … 50 52 { 51 53 RegisterObject(HUDRadar); 54 this->setConfigValues(); 52 55 53 56 this->marker_ = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton() … … 60 63 this->setHalfDotSizeDistance(3000.0f); 61 64 this->setMaximumDotSize(0.1f); 65 this->setMaximumDotSize3D(0.07f); 62 66 63 67 this->shapeMaterials_[RadarViewable::Dot] = "RadarDot.png"; 64 68 this->shapeMaterials_[RadarViewable::Triangle] = "RadarTriangle.png"; 65 69 this->shapeMaterials_[RadarViewable::Square] = "RadarSquare.png"; 66 this->setDetectionLimit( 10000.0f );67 70 this->owner_ = 0; 71 72 this->map3DFront_ = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton() 73 .createOverlayElement("Panel", "HUDRadar_mapDreiDFront_" + getUniqueNumberString())); 74 this->map3DFront_->setMaterialName("Orxonox/Radar3DFront"); 75 this->overlay_->add2D(this->map3DFront_); 76 this->map3DFront_->hide(); 77 78 this->map3DBack_ = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton() 79 .createOverlayElement("Panel", "HUDRadar_mapDreiDBack_" + getUniqueNumberString())); 80 this->map3DBack_->setMaterialName("Orxonox/Radar3DBack"); 81 this->overlay_->add2D(this->map3DBack_); 82 this->map3DBack_->hide(); 83 68 84 } 69 85 … … 73 89 { 74 90 Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->marker_); 91 Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->map3DFront_); 92 Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->map3DBack_); 93 75 94 for (std::map<RadarViewable*,Ogre::PanelOverlayElement*>::iterator it = this->radarObjects_.begin(); 76 95 it != this->radarObjects_.end(); ++it) … … 80 99 } 81 100 } 101 102 103 104 void HUDRadar::setConfigValues() 105 { 106 SetConfigValue(RadarMode_, true); 107 } 82 108 83 109 void HUDRadar::XMLPort(Element& xmlelement, XMLPort::Mode mode) … … 88 114 XMLPortParam(HUDRadar, "halfDotSizeDistance", setHalfDotSizeDistance, getHalfDotSizeDistance, xmlelement, mode); 89 115 XMLPortParam(HUDRadar, "maximumDotSize", setMaximumDotSize, getMaximumDotSize, xmlelement, mode); 116 XMLPortParam(HUDRadar, "maximumDotSize3D", setMaximumDotSize3D, getMaximumDotSize3D, xmlelement, mode); 117 XMLPortParam(HUDRadar, "material2D", set2DMaterial, get2DMaterial, xmlelement, mode); 118 XMLPortParam(HUDRadar, "material3DMiddle", set3DMaterial, get3DMaterial, xmlelement, mode); 119 XMLPortParam(HUDRadar, "material3DFront", set3DMaterialFront, get3DMaterialFront, xmlelement, mode); 120 XMLPortParam(HUDRadar, "material3DBack", set3DMaterialBack, get3DMaterialBack, xmlelement, mode); 121 XMLPortParam(HUDRadar, "mapAngle3D", setMapAngle, getMapAngle, xmlelement, mode); 122 XMLPortParam(HUDRadar, "detectionLimit", setDetectionLimit, getDetectionLimit, xmlelement, mode); 90 123 } 91 124 … … 152 185 // update the distances for all objects 153 186 std::map<RadarViewable*,Ogre::PanelOverlayElement*>::iterator it; 187 188 189 if(RadarMode_) 190 { 191 this->setBackgroundMaterial(material3D_); 192 this->map3DFront_->_notifyZOrder(this->overlay_->getZOrder() * 100 + 250); // it seems that the ZOrder of overlayelements is 100 times the ZOrder of the overlay 193 this->map3DBack_->_notifyZOrder(this->overlay_->getZOrder() * 100 - 250); // 250 a little bit buffer so that the two shels are displayed all in the front / in the back 194 this->map3DFront_->show(); 195 this->map3DBack_->show(); 196 } 197 else 198 { 199 this->setBackgroundMaterial(material2D_); 200 this->map3DFront_->hide(); 201 this->map3DBack_->hide(); 202 } 203 154 204 for( it = this->radarObjects_.begin(); it != this->radarObjects_.end(); ++it ) 155 205 { … … 165 215 float distance = (wePointer->getWorldPosition() - this->owner_->getPosition()).length(); 166 216 // calculate the size with 1/distance dependency for simplicity (instead of exp(-distance * lambda) 167 float size = maximumDotSize_ * halfDotSizeDistance_ / (halfDotSizeDistance_ + distance) * it->first->getRadarObjectScale(); 217 218 float size; 219 if(RadarMode_) 220 size = maximumDotSize3D_ * halfDotSizeDistance_ / (halfDotSizeDistance_ + distance) * it->first->getRadarObjectScale(); 221 else 222 size = maximumDotSize_ * halfDotSizeDistance_ / (halfDotSizeDistance_ + distance) * it->first->getRadarObjectScale(); 168 223 it->second->setDimensions(size, size); 169 224 170 225 // calc position on radar... 171 Vector2 coord = get2DViewcoordinates(this->owner_->getPosition(), this->owner_->getOrientation() * WorldEntity::FRONT, this->owner_->getOrientation() * WorldEntity::UP, wePointer->getWorldPosition()); 226 Vector2 coord; 227 228 if(RadarMode_) 229 { 230 coord = get3DProjection(this->owner_->getPosition(), this->owner_->getOrientation() * WorldEntity::FRONT, this->owner_->getOrientation() * WorldEntity::UP, wePointer->getWorldPosition(), 0.6435011, detectionLimit_); 231 232 // set zOrder on screen 233 bool overXZPlain = isObjectHigherThanShipOnMap(this->owner_->getPosition(), this->owner_->getOrientation() * WorldEntity::FRONT, this->owner_->getOrientation() * WorldEntity::UP, wePointer->getWorldPosition(), this->mapAngle_); 234 235 int zOrder = determineMap3DZOrder(this->owner_->getPosition(), this->owner_->getOrientation() * WorldEntity::FRONT, this->owner_->getOrientation() * WorldEntity::UP, wePointer->getWorldPosition(), detectionLimit_); 236 if(overXZPlain == false /*&& (it->second->getZOrder() > 100 * this->overlay_->getZOrder())*/) // it appears that zOrder of attached Overlayelements is 100 times the zOrder of the Overlay 237 it->second->_notifyZOrder(this->overlay_->getZOrder() * 100 - 70 + zOrder); 238 if(overXZPlain == true /*&& (it->second->getZOrder() <= 100 * this->overlay_->getZOrder())*/) 239 it->second->_notifyZOrder(this->overlay_->getZOrder() * 100 + 70 + zOrder); 240 } 241 else 242 coord = get2DViewcoordinates(this->owner_->getPosition(), this->owner_->getOrientation() * WorldEntity::FRONT, this->owner_->getOrientation() * WorldEntity::UP, wePointer->getWorldPosition()); 243 172 244 coord *= math::pi / 3.5f; // small adjustment to make it fit the texture 173 245 it->second->setPosition((1.0f + coord.x - size) * 0.5f, (1.0f - coord.y - size) * 0.5f); 246 174 247 if( distance < detectionLimit_ || detectionLimit_ < 0 ) 175 248 it->second->show(); … … 182 255 this->marker_->setDimensions(size * 1.5f, size * 1.5f); 183 256 this->marker_->setPosition((1.0f + coord.x - size * 1.5f) * 0.5f, (1.0f - coord.y - size * 1.5f) * 0.5f); 257 if(RadarMode_) 258 this->marker_->_notifyZOrder(it->second->getZOrder() -1); 184 259 this->marker_->show(); 185 260 } -
code/trunk/src/modules/overlays/hud/HUDRadar.h
r9667 r9939 35 35 #include <map> 36 36 #include <vector> 37 #include <string> 37 38 38 39 #include "util/OgreForwardRefs.h" … … 51 52 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 52 53 virtual void changedOwner(); 54 void setConfigValues(); 53 55 54 56 private: … … 57 59 void setHalfDotSizeDistance(float distance) { this->halfDotSizeDistance_ = distance; } 58 60 59 void setDetectionLimit( float limit ) 60 { this->detectionLimit_ = limit; } 61 float getDetectionLimit() const 62 { return this->detectionLimit_; } 61 void setDetectionLimit( float limit ) { this->detectionLimit_ = limit; } 62 float getDetectionLimit() const { return this->detectionLimit_; } 63 63 64 64 float getMaximumDotSize() const { return this->maximumDotSize_; } 65 65 void setMaximumDotSize(float size) { this->maximumDotSize_ = size; } 66 66 67 float getMaximumDotSize3D() const { return this->maximumDotSize3D_; } 68 void setMaximumDotSize3D(float size) { this->maximumDotSize3D_ = size;} 69 70 std::string get2DMaterial() const {return this->material2D_; } 71 void set2DMaterial(std::string material2D) { this->material2D_ = material2D; } 72 73 std::string get3DMaterial() const {return this->material3D_; } 74 void set3DMaterial(std::string material3D) { this->material3D_ = material3D; } 75 76 std::string get3DMaterialFront() const {return this->material3DFront_; } 77 void set3DMaterialFront(std::string material3DFront) { this->material3DFront_ = material3DFront; } 78 79 std::string get3DMaterialBack() const {return this->material3DBack_; } 80 void set3DMaterialBack(std::string material3DBack) { this->material3DBack_ = material3DBack; } 81 67 82 float getRadarSensitivity() const { return this->sensitivity_; } 68 83 // used also by RadarListener interface! 69 84 void setRadarSensitivity(float sensitivity) { this->sensitivity_ = sensitivity; } 85 86 // Determines angle between line of sight and x/z-plain on the 3D minimap 87 float getMapAngle() const { return this->mapAngle_; } 88 void setMapAngle(float mapAngle) { this->mapAngle_ = mapAngle; } 70 89 71 90 // RadarListener interface … … 85 104 Ogre::PanelOverlayElement* marker_; 86 105 106 bool RadarMode_; // Determines, if Radar runs in 3D or 2D Mode 107 87 108 float halfDotSizeDistance_; 88 109 float maximumDotSize_; 110 float maximumDotSize3D_; 111 float mapAngle_; 112 113 std::string material2D_; //Material name for 2D map 114 std::string material3D_; //Material names For the 3D minimap 115 std::string material3DFront_; 116 std::string material3DBack_; 117 118 Ogre::PanelOverlayElement* map3DFront_; //Overlayelements for the 3D minimap to be able to draw the points in a semi 3D matter 119 Ogre::PanelOverlayElement* map3DBack_; 89 120 90 121 float sensitivity_; -
code/trunk/src/modules/pong/Pong.cc
r9667 r9939 47 47 #include "PongBot.h" 48 48 #include "PongAI.h" 49 49 50 namespace orxonox 50 51 { … … 117 118 } 118 119 } 120 119 121 } 120 122 -
code/trunk/src/modules/pong/PongBall.cc
r9667 r9939 40 40 41 41 #include "PongBat.h" 42 43 #include "sound/WorldSound.h" 44 #include "core/XMLPort.h" 42 45 43 46 namespace orxonox … … 66 69 67 70 this->registerVariables(); 71 72 //initialize sound 73 if (GameMode::isMaster()) 74 { 75 this->defScoreSound_ = new WorldSound(this->getContext()); 76 this->defScoreSound_->setVolume(1.0f); 77 this->defBatSound_ = new WorldSound(this->getContext()); 78 this->defBatSound_->setVolume(0.4f); 79 this->defBoundarySound_ = new WorldSound(this->getContext()); 80 this->defBoundarySound_->setVolume(0.5f); 81 } 82 else 83 { 84 this->defScoreSound_ = 0; 85 this->defBatSound_ = 0; 86 this->defBoundarySound_ = 0; 87 } 68 88 } 69 89 … … 81 101 delete[] this->batID_; 82 102 } 103 } 104 105 //xml port for loading sounds 106 void PongBall::XMLPort(Element& xmlelement, XMLPort::Mode mode) 107 { 108 SUPER(PongBall, XMLPort, xmlelement, mode); 109 XMLPortParam(PongBall, "defScoreSound", setDefScoreSound, getDefScoreSound, xmlelement, mode); 110 XMLPortParam(PongBall, "defBatSound", setDefBatSound, getDefBatSound, xmlelement, mode); 111 XMLPortParam(PongBall, "defBoundarySound", setDefBoundarySound, getDefBoundarySound, xmlelement, mode); 83 112 } 84 113 … … 117 146 if (position.z > this->fieldHeight_ / 2 || position.z < -this->fieldHeight_ / 2) 118 147 { 119 // Its velocity in z-direction is inverted (i.e. it bounces off). 148 defBoundarySound_->play(); //play boundary sound 149 // Its velocity in z-direction is inverted (i.e. it bounces off). 120 150 velocity.z = -velocity.z; 121 151 // And its position is set as to not overstep the boundary it has just crossed. … … 142 172 if (fabs(distance) <= 1) // If the bat is there to parry. 143 173 { 144 // Set the ball to be exactly at the boundary. 174 defBatSound_->play(); //play bat sound 175 // Set the ball to be exactly at the boundary. 145 176 position.x = this->fieldWidth_ / 2; 146 177 // Invert its velocity in x-direction (i.e. it bounces off). … … 155 186 else if (GameMode::isMaster() && position.x > this->fieldWidth_ / 2 * (1 + this->relMercyOffset_)) 156 187 { 188 defScoreSound_->play();//play score sound 157 189 if (this->getGametype() && this->bat_[0]) 158 190 { … … 169 201 if (fabs(distance) <= 1) // If the bat is there to parry. 170 202 { 171 // Set the ball to be exactly at the boundary. 203 defBatSound_->play(); //play bat sound 204 // Set the ball to be exactly at the boundary. 172 205 position.x = -this->fieldWidth_ / 2; 173 206 // Invert its velocity in x-direction (i.e. it bounces off). … … 182 215 else if (GameMode::isMaster() && position.x < -this->fieldWidth_ / 2 * (1 + this->relMercyOffset_)) 183 216 { 217 defScoreSound_->play();//play score sound 184 218 if (this->getGametype() && this->bat_[1]) 185 219 { … … 262 296 this->bat_[1] = orxonox_cast<PongBat*>(Synchronisable::getSynchronisable(this->batID_[1])); 263 297 } 298 299 void PongBall::setDefScoreSound(const std::string &pongSound) 300 { 301 if( defScoreSound_ ) 302 defScoreSound_->setSource(pongSound); 303 else 304 assert(0); // This should never happen, because soundpointer is only available on master 305 } 306 307 const std::string& PongBall::getDefScoreSound() 308 { 309 if( defScoreSound_ ) 310 return defScoreSound_->getSource(); 311 else 312 assert(0); 313 return BLANKSTRING; 314 } 315 316 void PongBall::setDefBatSound(const std::string &pongSound) 317 { 318 if( defBatSound_ ) 319 defBatSound_->setSource(pongSound); 320 else 321 assert(0); // This should never happen, because soundpointer is only available on master 322 } 323 324 const std::string& PongBall::getDefBatSound() 325 { 326 if( defBatSound_ ) 327 return defBatSound_->getSource(); 328 else 329 assert(0); 330 return BLANKSTRING; 331 } 332 333 void PongBall::setDefBoundarySound(const std::string &pongSound) 334 { 335 if( defBoundarySound_ ) 336 defBoundarySound_->setSource(pongSound); 337 else 338 assert(0); // This should never happen, because soundpointer is only available on master 339 } 340 341 const std::string& PongBall::getDefBoundarySound() 342 { 343 if( defBoundarySound_ ) 344 return defBoundarySound_->getSource(); 345 else 346 assert(0); 347 return BLANKSTRING; 348 } 264 349 } -
code/trunk/src/modules/pong/PongBall.h
r9667 r9939 42 42 #include "worldentities/MovableEntity.h" 43 43 44 44 45 namespace orxonox 45 46 { … … 63 64 64 65 virtual void tick(float dt); 66 67 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 65 68 66 69 /** … … 123 126 static const float MAX_REL_Z_VELOCITY; 124 127 128 void setDefScoreSound(const std::string& engineSound); 129 const std::string& getDefScoreSound(); 130 void setDefBatSound(const std::string& engineSound); 131 const std::string& getDefBatSound(); 132 void setDefBoundarySound(const std::string& engineSound); 133 const std::string& getDefBoundarySound(); 134 125 135 private: 126 136 void registerVariables(); … … 135 145 unsigned int* batID_; //!< The object IDs of the bats, to be able to synchronize them over the network. 136 146 float relMercyOffset_; //!< Offset, that makes the player not loose, when, in all fairness, he would have. 147 WorldSound* defScoreSound_; 148 WorldSound* defBatSound_; 149 WorldSound* defBoundarySound_; 137 150 }; 138 151 } -
code/trunk/src/modules/pong/PongScore.cc
r9667 r9939 41 41 42 42 #include "Pong.h" 43 #include "sound/WorldSound.h" ///////////////////////////// 43 44 44 45 namespace orxonox -
code/trunk/src/modules/pong/PongScore.h
r9667 r9939 124 124 WeakPtr<PlayerInfo> player1_; //!< Store information about left player permanently. 125 125 WeakPtr<PlayerInfo> player2_; //!< Same for the right player. To end the game properly. 126 WorldSound* scoreSound_; 127 126 128 }; 127 129 } -
code/trunk/src/modules/weapons/weaponmodes/HsW01.h
r9667 r9939 59 59 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 60 60 61 pr ivate:61 protected: 62 62 /** 63 63 @brief Set the mesh. … … 109 109 { return this->delay_; } 110 110 111 v oid shot();111 virtual void shot(); 112 112 void muzzleflash(); 113 113
Note: See TracChangeset
for help on using the changeset viewer.