Changeset 9945 for code/trunk
- Timestamp:
- Jan 3, 2014, 1:50:22 PM (11 years ago)
- Location:
- code/trunk/src
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/libraries/util/Math.cc
r9939 r9945 204 204 orxonox::Vector2 get3DProjection(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition, const float mapangle, const float detectionlimit) 205 205 { 206 207 orxonox::Vector3 distance = otherposition - myposition;// get vector from Ship to object208 209 // new coordinate system: x_axsis: mydirection(points front)210 // y_axsis: myorthonormal(points up)211 // z_axsis: myside(points right)212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 206 // Orxonox Vectors: x_direction you are looking, y_direction points up, z_direction points to the right 207 orxonox::Vector3 distance = otherposition - myposition; // get vector from Ship to object 208 209 // new coordinate system: x_axsis: mydirection (points front) 210 // y_axsis: myorthonormal (points up) 211 // z_axsis: myside (points right) 212 213 orxonox::Vector3 myside = mydirection.crossProduct(myorthonormal); // get 3. base vector 214 215 distance = 4*distance / detectionlimit; // shrink vector on map 216 if(distance.length() > 1.0f) // if object would wander outside of the map 217 { 218 distance = distance / distance.length(); 219 } 220 221 // perform a coordinate transformation to get distance in relation of the position of the ship 222 orxonox::Vector3 distanceShip = getTransformedVector(distance, mydirection, myorthonormal, myside); 223 224 // calculate 2D vector on the map (with angle between x/z - plain and line of sight) 225 float xcoordinate = distanceShip.z; // z; cause x direction on screen is to the right side 226 float ycoordinate = distanceShip.x*sin(mapangle)+distanceShip.y*cos(mapangle); 227 return orxonox::Vector2(xcoordinate , ycoordinate); 228 228 } 229 229 … … 243 243 bool isObjectHigherThanShipOnMap(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition, const float mapangle) 244 244 { 245 246 247 248 // new coordinate system: x_axsis: mydirection(points front)249 // y_axsis: myorthonormal(points up)250 // z_axsis: myside(points right)251 252 253 254 255 256 257 258 259 260 261 245 // Orxonox Vectors: x_direction you are looking, y_direction points up, z_direction points to the right 246 orxonox::Vector3 distance = otherposition - myposition; 247 248 // new coordinate system: x_axsis: mydirection (points front) 249 // y_axsis: myorthonormal (points up) 250 // z_axsis: myside (points right) 251 252 orxonox::Vector3 myside = mydirection.crossProduct(myorthonormal); // get vector from Ship to object 253 254 255 // perform a coordinate transformation to get distance in relation of the position of the ship 256 orxonox::Vector3 distanceShip = getTransformedVector(distance, mydirection, myorthonormal, myside); 257 258 if(distanceShip.y >= 0) 259 return true; 260 else 261 return false; 262 262 } 263 263 … … 265 265 @brief A value between 0 and 10, in order how other object is in front or in back 266 266 @param myposition My position 267 268 269 270 267 @param mydirection My viewing direction 268 @param myorthonormal My orthonormalvector (pointing upwards through my head) 269 @param otherposition The position of the other object 270 @param detectionlimit The limit in which objects are shown on the map 271 271 @return value between 0 and 100 272 272 */ 273 273 int determineMap3DZOrder(const orxonox::Vector3& myposition, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& otherposition, const float detectionlimit) 274 274 { 275 orxonox::Vector3 distance = otherposition - myposition;// get vector from Ship to object276 orxonox::Vector3 myside = mydirection.crossProduct(myorthonormal);// get vector to the side277 278 279 280 281 282 283 284 285 286 287 275 orxonox::Vector3 distance = otherposition - myposition; // get vector from Ship to object 276 orxonox::Vector3 myside = mydirection.crossProduct(myorthonormal); // get vector to the side 277 278 distance = 4*distance / detectionlimit; // shrink vector on map 279 if(distance.length() > 1.0f) // if object would wander outside of the map 280 { 281 distance = distance / distance.length(); 282 } 283 284 // perform a coordinate transformation to get distance in relation of the position of the ship 285 orxonox::Vector3 distanceShip = getTransformedVector(distance, mydirection, myorthonormal, myside); 286 287 return (int) 50 - 100*distanceShip.x; 288 288 } 289 289 … … 300 300 y is vector in old coordinates 301 301 T is transform matrix with: 302 303 304 305 302 T = (t1 , t2 , t3) 303 t1 = mydirection 304 t2 = myorthonormal 305 t3 = myside 306 306 307 307 y = T^(-1)*x … … 309 309 orxonox::Vector3 getTransformedVector(const orxonox::Vector3& distance, const orxonox::Vector3& mydirection, const orxonox::Vector3& myorthonormal, const orxonox::Vector3& myside) 310 310 { 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 311 // inverse of the transform matrix 312 float determinant = +mydirection.x * (myorthonormal.y*myside.z - myside.y*myorthonormal.z) 313 -mydirection.y * (myorthonormal.x*myside.z - myorthonormal.z*myside.x) 314 +mydirection.z * (myorthonormal.x*myside.y - myorthonormal.y*myside.x); 315 float invdet = 1/determinant; 316 317 // transform matrix 318 orxonox::Vector3 xinvtransform; 319 orxonox::Vector3 yinvtransform; 320 orxonox::Vector3 zinvtransform; 321 322 xinvtransform.x = (myorthonormal.y * myside.z - myside.y * myorthonormal.z)*invdet; 323 xinvtransform.y = (mydirection.z * myside.y - mydirection.y * myside.z )*invdet; 324 xinvtransform.z = (mydirection.y * myorthonormal.z - mydirection.z * myorthonormal.y)*invdet; 325 yinvtransform.x = (myorthonormal.z * myside.x - myorthonormal.x * myside.z )*invdet; 326 yinvtransform.y = (mydirection.x * myside.z - mydirection.z * myside.x )*invdet; 327 yinvtransform.z = (myorthonormal.x * mydirection.z - mydirection.x * myorthonormal.z)*invdet; 328 zinvtransform.x = (myorthonormal.x * myside.y - myside.x * myorthonormal.y)*invdet; 329 zinvtransform.y = (myside.x * mydirection.y - mydirection.x * myside.y )*invdet; 330 zinvtransform.z = (mydirection.x * myorthonormal.y - myorthonormal.x * mydirection.y )*invdet; 331 332 // coordinate transformation 333 orxonox::Vector3 distanceShip; 334 distanceShip.x = xinvtransform.x * distance.x + yinvtransform.x * distance.y + zinvtransform.x * distance.z; 335 distanceShip.y = xinvtransform.y * distance.x + yinvtransform.y * distance.y + zinvtransform.y * distance.z; 336 distanceShip.z = xinvtransform.z * distance.x + yinvtransform.z * distance.y + zinvtransform.z * distance.z; 337 338 return distanceShip; 339 339 } 340 340 -
code/trunk/src/modules/docking/Dock.cc
r9939 r9945 86 86 { 87 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 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 126 } 127 127 -
code/trunk/src/modules/docking/MoveToDockingTarget.cc
r9939 r9945 66 66 { 67 67 //TODO: Investigate strange things... 68 68 //this->parent_->detach((WorldEntity*)player->getControllableEntity()); 69 69 70 71 72 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. 73 73 this->parent_->undockingAnimationFinished(player); 74 74 return true; -
code/trunk/src/modules/gametypes/SpaceRaceController.cc
r9667 r9945 464 464 currentShape->getBoundingSphere(positionObject,radiusObject); 465 465 Vector3 positionObjectNonBT(positionObject.x(), positionObject.y(), positionObject.z()); 466 467 468 469 466 Vector3 norm_r_CP = cP1ToCP2.crossProduct(centerCP1-positionObjectNonBT); 467 468 if(norm_r_CP.length() == 0){ 469 Vector3 zufall; 470 470 do{ 471 471 zufall=Vector3(rnd(),rnd(),rnd());//random 472 472 }while((zufall.crossProduct(cP1ToCP2)).length() == 0); 473 474 475 476 477 473 norm_r_CP=zufall.crossProduct(cP1ToCP2); 474 } 475 Vector3 VecToVCP = norm_r_CP.crossProduct(cP1ToCP2); 476 float distanzToCP1 = sqrt(powf(radiusObject,4)/(powf((centerCP1-positionObjectNonBT).length(), 2)-powf(radiusObject,2))+powf(radiusObject,2)); 477 float distanzToCP2 = sqrt(powf(radiusObject,4)/(powf((racepoint2->getPosition()-positionObjectNonBT).length(), 2)-powf(radiusObject,2))+powf(radiusObject,2)); 478 478 float distanz = std::max(distanzToCP1,distanzToCP2); 479 480 481 482 483 484 485 486 487 488 489 490 479 //float distanz = 0.0f; //TEMPORARY 480 Vector3 newCheckpointPositionPos = positionObjectNonBT+(distanz*VecToVCP)/VecToVCP.length(); 481 Vector3 newCheckpointPositionNeg = positionObjectNonBT-(distanz*VecToVCP)/VecToVCP.length(); 482 if((newCheckpointPositionPos - centerCP1).length() + (newCheckpointPositionPos - (centerCP1+cP1ToCP2)).length() < (newCheckpointPositionNeg - centerCP1).length() + (newCheckpointPositionNeg - (centerCP1+cP1ToCP2)).length() ) 483 { 484 RaceCheckPoint* newVirtualCheckpoint = addVirtualCheckPoint(racepoint1,racepoint2->getCheckpointIndex(), newCheckpointPositionPos); 485 } 486 else 487 { 488 RaceCheckPoint* newVirtualCheckpoint = addVirtualCheckPoint(racepoint1,racepoint2->getCheckpointIndex(), newCheckpointPositionNeg); 489 } 490 return; 491 491 } 492 492 } -
code/trunk/src/modules/invader/InvaderWeaponEnemy.cc
r9943 r9945 45 45 void InvaderWeaponEnemy::shot() 46 46 { 47 47 InvaderWeapon::shot(); 48 48 // SUPER(InvaderWeaponEnemy, shot); 49 49 // only shoot in foreward direction -
code/trunk/src/modules/objects/ForceField.cc
r9939 r9945 203 203 else if(this->mode_ == forceFieldMode::homogen) 204 204 { 205 206 207 208 209 210 211 212 213 214 215 216 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 217 } 218 218 } -
code/trunk/src/modules/objects/Turret.cc
r9667 r9945 57 57 void Turret::rotatePitch(const Vector2& value) 58 58 { 59 59 orxout()<< "Turret rotate Pitch"<< endl; 60 60 61 62 61 const Quaternion& orient = this->getOrientation(); 62 Radian pitch = orient.getPitch(); 63 63 64 65 64 if((value.x > 0 && pitch < Radian(180)) || (value.x < 0 && pitch > Radian(0))) 65 SpaceShip::rotatePitch(value); 66 66 } 67 67 … … 69 69 void Turret::setAlertnessRadius(float value) 70 70 { 71 71 this->controller_->setAlertnessRadius(value); 72 72 } 73 73 float Turret::getAlertnessRadius() 74 74 { 75 75 return this->controller_->getAlertnessRadius(); 76 76 } 77 77 -
code/trunk/src/modules/overlays/hud/HUDRadar.cc
r9939 r9945 71 71 72 72 this->map3DFront_ = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton() 73 73 .createOverlayElement("Panel", "HUDRadar_mapDreiDFront_" + getUniqueNumberString())); 74 74 this->map3DFront_->setMaterialName("Orxonox/Radar3DFront"); 75 75 this->overlay_->add2D(this->map3DFront_); … … 77 77 78 78 this->map3DBack_ = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton() 79 79 .createOverlayElement("Panel", "HUDRadar_mapDreiDBack_" + getUniqueNumberString())); 80 80 this->map3DBack_->setMaterialName("Orxonox/Radar3DBack"); 81 81 this->overlay_->add2D(this->map3DBack_); … … 189 189 if(RadarMode_) 190 190 { 191 192 193 194 195 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 196 } 197 197 else 198 198 { 199 200 201 199 this->setBackgroundMaterial(material2D_); 200 this->map3DFront_->hide(); 201 this->map3DBack_->hide(); 202 202 } 203 203 … … 218 218 float size; 219 219 if(RadarMode_) 220 220 size = maximumDotSize3D_ * halfDotSizeDistance_ / (halfDotSizeDistance_ + distance) * it->first->getRadarObjectScale(); 221 221 else 222 222 size = maximumDotSize_ * halfDotSizeDistance_ / (halfDotSizeDistance_ + distance) * it->first->getRadarObjectScale(); 223 223 it->second->setDimensions(size, size); 224 224 … … 228 228 if(RadarMode_) 229 229 { 230 231 232 233 234 235 236 237 238 239 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 240 } 241 241 else 242 242 coord = get2DViewcoordinates(this->owner_->getPosition(), this->owner_->getOrientation() * WorldEntity::FRONT, this->owner_->getOrientation() * WorldEntity::UP, wePointer->getWorldPosition()); 243 243 244 244 coord *= math::pi / 3.5f; // small adjustment to make it fit the texture … … 256 256 this->marker_->setPosition((1.0f + coord.x - size * 1.5f) * 0.5f, (1.0f - coord.y - size * 1.5f) * 0.5f); 257 257 if(RadarMode_) 258 258 this->marker_->_notifyZOrder(it->second->getZOrder() -1); 259 259 this->marker_->show(); 260 260 } -
code/trunk/src/modules/overlays/hud/HUDRadar.h
r9939 r9945 111 111 float mapAngle_; 112 112 113 std::string material2D_; 114 std::string material3D_; 113 std::string material2D_; //Material name for 2D map 114 std::string material3D_; //Material names For the 3D minimap 115 115 std::string material3DFront_; 116 116 std::string material3DBack_; -
code/trunk/src/modules/pong/PongBall.cc
r9939 r9945 147 147 { 148 148 defBoundarySound_->play(); //play boundary sound 149 149 // Its velocity in z-direction is inverted (i.e. it bounces off). 150 150 velocity.z = -velocity.z; 151 151 // And its position is set as to not overstep the boundary it has just crossed. … … 173 173 { 174 174 defBatSound_->play(); //play bat sound 175 175 // Set the ball to be exactly at the boundary. 176 176 position.x = this->fieldWidth_ / 2; 177 177 // Invert its velocity in x-direction (i.e. it bounces off). … … 186 186 else if (GameMode::isMaster() && position.x > this->fieldWidth_ / 2 * (1 + this->relMercyOffset_)) 187 187 { 188 188 defScoreSound_->play();//play score sound 189 189 if (this->getGametype() && this->bat_[0]) 190 190 { … … 202 202 { 203 203 defBatSound_->play(); //play bat sound 204 204 // Set the ball to be exactly at the boundary. 205 205 position.x = -this->fieldWidth_ / 2; 206 206 // Invert its velocity in x-direction (i.e. it bounces off). … … 215 215 else if (GameMode::isMaster() && position.x < -this->fieldWidth_ / 2 * (1 + this->relMercyOffset_)) 216 216 { 217 217 defScoreSound_->play();//play score sound 218 218 if (this->getGametype() && this->bat_[1]) 219 219 { -
code/trunk/src/modules/tetris/TetrisBrick.cc
r9803 r9945 87 87 stone->addTemplate(this->tetris_->getCenterpoint()->getStoneTemplate()); 88 88 else 89 89 orxout()<< "tetris_->getCenterpoint == NULL in TetrisBrick.cc"<< endl; 90 90 } 91 91 else … … 116 116 if(this->shapeIndex_ == 1 || this->shapeIndex_ == 6 || this->shapeIndex_ == 7) 117 117 { 118 118 stone->setPosition(0.0f, 2*size_, 0.0f); 119 119 } 120 120 else if(this->shapeIndex_ == 3 || this->shapeIndex_ == 4|| this->shapeIndex_ == 5) 121 121 { 122 122 stone->setPosition(size_, 0, 0.0f); 123 123 } 124 124 else if(this->shapeIndex_ == 2) 125 125 { 126 126 stone->setPosition(-size_, 0, 0.0f); 127 127 } 128 128 } … … 131 131 if(this->shapeIndex_ == 2 || this->shapeIndex_ == 5) 132 132 { 133 133 stone->setPosition(size_, size_, 0.0f); 134 134 } 135 135 else if(this->shapeIndex_ == 1) 136 136 { 137 137 stone->setPosition(0, 3*size_, 0.0f); 138 138 } 139 139 else if(this->shapeIndex_ == 3 || this->shapeIndex_ == 7) 140 140 { 141 141 stone->setPosition(-size_, 0, 0.0f); 142 142 } 143 143 else if(this->shapeIndex_ == 4) 144 144 { 145 145 stone->setPosition(-size_, size_, 0.0f); 146 146 } 147 147 else if(this->shapeIndex_ == 6) 148 148 { 149 149 stone->setPosition(size_, 0, 0.0f); 150 150 } 151 151 } … … 154 154 bool TetrisBrick::isValidMove(const Vector3& position, bool isRotation = false) 155 155 { 156 156 return this->tetris_->isValidMove(this,position, isRotation); 157 157 } 158 158 159 159 TetrisStone* TetrisBrick::getStone(unsigned int i) 160 160 { 161 161 if(i < this->brickStones_.size()) 162 162 return this->brickStones_[i]; 163 163 else return NULL; 164 164 } 165 165 … … 192 192 else if(!this->lockRotation_) //rotate when key up is pressed 193 193 { 194 195 194 if(!isValidMove(this->getPosition(), true)) //catch illegal rotations 195 return; 196 196 this->lockRotation_ = true; // multiple calls of this function have to be filtered out. 197 197 this->rotationTimer_.setTimer(0.1f, false, createExecutor(createFunctor(&TetrisBrick::unlockRotation, this))); -
code/trunk/src/modules/tetris/TetrisScore.cc
r9667 r9945 92 92 { 93 93 std::string score("0"); 94 94 if(!this->owner_->hasEnded()) 95 95 { 96 96 //get the player -
code/trunk/src/modules/weapons/weaponmodes/HsW01.cc
r9667 r9945 82 82 XMLPortParam(HsW01, "material", setMaterial, getMaterial, xmlelement, mode); 83 83 XMLPortParam(HsW01, "projectileMesh", setMesh, getMesh, xmlelement, mode); 84 84 XMLPortParam(HsW01, "sound", setSound, getSound, xmlelement, mode); 85 85 } 86 86 -
code/trunk/src/modules/weapons/weaponmodes/HsW01.h
r9939 r9945 74 74 { return this->mesh_; } 75 75 76 76 /** 77 77 @brief Set the sound. 78 78 @param mesh The Sound name. … … 81 81 { this->sound_ = sound; } 82 82 83 83 /** 84 84 @brief Get the sound. 85 85 @return Returns the sound name. -
code/trunk/src/orxonox/gametypes/Dynamicmatch.cc
r9667 r9945 276 276 else if (friendlyfire && (source == target)) 277 277 { 278 278 this->playerScored(originator->getPlayer(), -1); 279 279 } 280 280 } … … 292 292 if (playerParty_[originator->getPlayer()] == killer) //reward the killer 293 293 { 294 294 this->playerScored(originator->getPlayer(), 25); 295 295 } 296 296 return true; … … 412 412 if (it->second==piggy)//Spieler mit der Pig-party frags++ 413 413 { 414 414 this->playerScored(it->first); 415 415 } 416 416 } -
code/trunk/src/orxonox/infos/PlayerInfo.cc
r9939 r9945 232 232 if (tmp == NULL) 233 233 { 234 235 234 orxout(verbose) << "PlayerInfo: pauseControl, Controller is NULL " << endl; 235 return; 236 236 } 237 237 tmp->setActive(false); -
code/trunk/src/orxonox/sound/WorldAmbientSound.cc
r9939 r9945 39 39 namespace orxonox 40 40 { 41 41 SetConsoleCommand("WorldAmbientSound", "nextsong", &WorldAmbientSound::nextSong); 42 42 43 43 RegisterClass(WorldAmbientSound); … … 113 113 { 114 114 115 116 117 118 119 120 121 122 123 115 //HACK: Assuption - there is only one WorldAmbientSound in a level and only one level is used. 116 for (ObjectList<WorldAmbientSound>::iterator it = ObjectList<WorldAmbientSound>::begin(); 117 it != ObjectList<WorldAmbientSound>::end(); ++it) 118 { 119 while(it->ambientSound_->setAmbientSource(WorldAmbientSound::soundList_[WorldAmbientSound::soundNumber_]) == false){ 120 WorldAmbientSound::soundNumber_ = (WorldAmbientSound::soundNumber_ + 1) % WorldAmbientSound::soundList_.size(); 121 } 122 WorldAmbientSound::soundNumber_ = (WorldAmbientSound::soundNumber_ + 1) % WorldAmbientSound::soundList_.size(); 123 } 124 124 } 125 125 } -
code/trunk/src/orxonox/worldentities/pawns/Pawn.cc
r9939 r9945 305 305 void Pawn::kill() 306 306 { 307 307 this->damage(this->health_); 308 308 this->death(); 309 309 } … … 330 330 { 331 331 explosionSound_->play(); 332 332 // Set bAlive_ to false and wait for PawnManager to do the destruction 333 333 this->bAlive_ = false; 334 334
Note: See TracChangeset
for help on using the changeset viewer.