Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8613


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

Cleanup.

Location:
code/branches/spaceboundaries2/src/orxonox/worldentities
Files:
2 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   
  • code/branches/spaceboundaries2/src/orxonox/worldentities/SpaceBoundaries.h

    r8609 r8613  
    107107            std::vector<billboardAdministration> billboards_;
    108108       
    109             int reaction_; //!< Werte: 0, 1, 2.
    110                            //!< 0: Reflektion an Boundaries (Standard).
    111                            //!< 1: Health-Abzug-Modus.
    112                            //!< 2: Invertierte Version von 0. Verbiete es, in ein Gebiet hinein zu fliegen.
    113             float maxDistance_; //!< maximal zulaessige Entfernung von 'this->getPosition()'.
    114             float warnDistance_; //!< Entfernung von 'this->getPosition()', ab der eine Warnung angezeigt wird, dass man bald das zulaessige Areal verlaesst.
    115             float showDistance_; //!< Definiert, wann die Grenzen visualisiert werden sollen. ("Entfernung von 'this->maxDistance_'")
     109            int reaction_; //!< Values: 0, 1, 2.
     110                           //!< 0: Reflection on boundary (Standard).
     111                           //!< 1: Decrease-Health-Mode.
     112                           //!< 2: Inverted Version of 0. Prohibit to fly INTO a defined area.
     113            float maxDistance_; //!<  Maximum allowed distance.
     114            float warnDistance_; //!< Distance in which a warning is displayed.
     115            float showDistance_; //!< Distance at which the boundaries are displayed.
    116116           
    117             float healthDecrease_; //!< Mass fuer die Anzahl Health-Points, die nach ueberschreiten der Entfernung 'maxDistance_' von 'this->getPosition()' abgezogen werden.
    118                                    //!< Empfohlene Werte: 0.1 (langsame Health-Verminderung) bis 5 (sehr schnelle Health-Verminderung).
    119                                    //!< Hat nur eine Bedeutung, falls 'this->reaction_' 1 (eins) ist.
     117            float healthDecrease_; //!< Rate of health loss.
    120118           
    121            
    122             RadarViewable* centerRadar_; //!< Repraesentation von SpaceBoundaries auf dem Radar.
    123        
     119            //RadarViewable* centerRadar_; //!< Representation of the space boundary in the radar.
    124120       
    125121            // Funktionen::
    126             float computeDistance(WorldEntity *item); //!< Auf den Mittelpunkt 'this->getPosition()' bezogen.
    127             void displayWarning(const std::string warnText); //!< Einen Warntext auf dem Bildschirm ausgeben. (noch nicht implementiert, TODO)
     122            float computeDistance(WorldEntity *item); //!< Compute distance to center point.
     123            void displayWarning(const std::string warnText); //!< TODO: Implement.
    128124            void displayBoundaries(Pawn *item);
    129125            void conditionalBounceBack(Pawn *item, float currentDistance, float dt);
Note: See TracChangeset for help on using the changeset viewer.