Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 26, 2011, 5:23:31 PM (13 years ago)
Author:
dafrick
Message:

Cleanup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/spaceboundaries2/src/orxonox/worldentities/SpaceBoundaries.cc

    r8609 r8613  
    211211        this->checkWhoIsIn();
    212212        this->removeAllBillboards();
    213         COUT(4) << "Groesse der Pawn-Liste 'SpaceBoundaries::pawnsIn_': " << (int) pawnsIn_.size() << std::endl;
    214213       
    215214        float distance;
     
    222221                distance = this->computeDistance(currentPawn);
    223222                humanItem = this->isHumanPlayer(currentPawn);
    224                 COUT(5) << "Distanz:" << distance << std::endl; // message for debugging
    225                 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
    226225                {
    227226                    if(humanItem)
    228227                    {
    229                         COUT(5) << "humanItem ist true" << std::endl;
    230228                        this->displayWarning("Attention! You are close to the boundary!");
    231229                    }
     
    233231                if(/* humanItem &&*/ abs(this->maxDistance_ - distance) < this->showDistance_ )
    234232                {
    235                     this->displayBoundaries(currentPawn); // Zeige Grenze an!
     233                    this->displayBoundaries(currentPawn); // Show the boundary
    236234                }
    237235                if(distance > this->maxDistance_ && (this->reaction_ == 1) )
     
    244242                    currentPawn->removeHealth( (distance - this->maxDistance_) * this->healthDecrease_);
    245243                }
    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.
    247245                {
    248246                    this->conditionalBounceBack(currentPawn, distance, dt);
     
    290288        float normalSpeed = item->getVelocity().dotProduct(normal);
    291289       
    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. */
    294291        if( this->reaction_ == 0 && currentDistance + normalSpeed * dt > this->maxDistance_ - 10 ) // -10: "security measure"
    295292        {
     
    314311        item->setVelocity(*velocity * dampingFactor);
    315312       
    316         item->setPosition( item->getPosition() - *normal * 10 ); // Setze 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.
    317314    }
    318315   
Note: See TracChangeset for help on using the changeset viewer.