- Timestamp:
- May 26, 2011, 5:23:31 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/spaceboundaries2/src/orxonox/worldentities/SpaceBoundaries.cc
r8609 r8613 211 211 this->checkWhoIsIn(); 212 212 this->removeAllBillboards(); 213 COUT(4) << "Groesse der Pawn-Liste 'SpaceBoundaries::pawnsIn_': " << (int) pawnsIn_.size() << std::endl;214 213 215 214 float distance; … … 222 221 distance = this->computeDistance(currentPawn); 223 222 humanItem = this->isHumanPlayer(currentPawn); 224 COUT(5) << "Distan z:" << distance << std::endl; // message for debugging225 if(distance > this->warnDistance_ && distance < this->maxDistance_) // Zeige Warnung an!223 COUT(5) << "Distance:" << distance << std::endl; // message for debugging 224 if(distance > this->warnDistance_ && distance < this->maxDistance_) // Display warning 226 225 { 227 226 if(humanItem) 228 227 { 229 COUT(5) << "humanItem ist true" << std::endl;230 228 this->displayWarning("Attention! You are close to the boundary!"); 231 229 } … … 233 231 if(/* humanItem &&*/ abs(this->maxDistance_ - distance) < this->showDistance_ ) 234 232 { 235 this->displayBoundaries(currentPawn); // Zeige Grenze an!233 this->displayBoundaries(currentPawn); // Show the boundary 236 234 } 237 235 if(distance > this->maxDistance_ && (this->reaction_ == 1) ) … … 244 242 currentPawn->removeHealth( (distance - this->maxDistance_) * this->healthDecrease_); 245 243 } 246 if( (this->reaction_ == 0) && (distance + 100 > this->maxDistance_)) // Annahme: Ein Pawn kann von einem Tick bis zum nächsten nicht mehr als 100 Distanzeinheiten zurücklegen.244 if( (this->reaction_ == 0) && (distance + 100 > this->maxDistance_)) // Exception: A Pawn can't move more than 100 units per tick. 247 245 { 248 246 this->conditionalBounceBack(currentPawn, distance, dt); … … 290 288 float normalSpeed = item->getVelocity().dotProduct(normal); 291 289 292 /* Checke, ob das Pawn innerhalb des nächsten Ticks, das erlaubte Gebiet verlassen würde. 293 Falls ja: Spicke es zurück. */ 290 /* Check, whether the Pawn would leave the boundary in the next tick, if so send it back. */ 294 291 if( this->reaction_ == 0 && currentDistance + normalSpeed * dt > this->maxDistance_ - 10 ) // -10: "security measure" 295 292 { … … 314 311 item->setVelocity(*velocity * dampingFactor); 315 312 316 item->setPosition( item->getPosition() - *normal * 10 ); // Set ze das SpaceShip noch etwas von der Grenze weg.313 item->setPosition( item->getPosition() - *normal * 10 ); // Set the position of the Pawn to be well inside the boundary. 317 314 } 318 315
Note: See TracChangeset
for help on using the changeset viewer.