Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 14, 2011, 4:53:27 PM (13 years ago)
Author:
kmaurus
Message:

Pawns that want to leave the area are reflected, one billboard is added that represents the boundary

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/spaceboundaries/src/orxonox/worldentities/SpaceBoundaries.h

    r8237 r8244  
    2727 */
    2828 
    29  /* TODO: - Markiere SpaceBoundaries-Position mit einem schoenen Objekt
    30           - Kugel-Model mal hinzufuegen, das nur sichtbar ist, wenn man genuegend nah an maxDistance dran ist
    31           - Reflexion an obiger Kugel beim Versuch durchzudringen
     29 /* TODO: - Markiere SpaceBoundaries-Position mit einem schoenen Objekt
     30          - Reflexion an Grenze mit Quaternionen machen (--> vgl. Funktion bounceBack() )
    3231 */
    3332
     
    4948@brief SpaceBoundaries gives level creators the possibility to bar Pawns from leaving a defined area.
    5049
    51        Four attributes can/should be defined in the XML-File:
    52        - 'position' : absolute position of the SpaceBoundaries class. '*Distance' refers to this 'position'.
     50       Five attributes can/should be defined in the XML-File:
     51       - 'position' : absolute position of the SpaceBoundaries class. 'warnDistance' and 'maxDistance' refer to this 'position'.
    5352       - 'warnDistance' : If the distance between the pawn of the human player and 'position' is bigger than 'warnDistance', a message is displayed to
    5453                          inform the player that he'll soon be leaving the allowed area.
    5554       - 'maxDistance' : defines the area, where a pawn is allowed to be (radius of a ball).
     55       - 'showDistance' : If the distance between the pawn and the boundary of the allowed area is smaller than 'showDistance', the boundary is shown.
    5656       - 'healthDecrease' : a measure to define how fast the health of a pawn should decrease after leaving the allowed area.
    5757                            Empfohlene Werte: 0.1 (langsame Health-Verminderung) bis 5 (sehr schnelle Health-Verminderung)
     
    6666            ~SpaceBoundaries();
    6767           
    68             void se     tMaxDistance(float r);
     68            void setMaxDistance(float r);
    6969            float getMaxDistance();
    7070           
    7171            void setWarnDistance(float r);
    7272            float getWarnDistance();
     73           
     74            void setShowDistance(float r);
     75            float getShowDistance();
    7376           
    7477            void setHealthDecrease(float amount);
     
    8285            float maxDistance_; //!< maximal zulaessige Entfernung von 'this->getPosition()'.
    8386            float warnDistance_; //!< Entfernung von 'this->getPosition()', ab der eine Warnung angezeigt wird, dass man bald das zulaessige Areal verlaesst.
     87            float showDistance_; //!< Definiert, wann die Grenzen visualisiert werden sollen.
    8488           
    8589            float healthDecrease_; //!< Mass fuer die Anzahl Health-Points, die nach ueberschreiten der Entfernung 'maxDistance_' von 'this->getPosition()' abgezogen werden.
    8690                                   //!< Empfohlene Werte: 0.1 (langsame Health-Verminderung) bis 5 (sehr schnelle Health-Verminderung)
     91           
     92            Billboard *boundary_;
    8793           
    8894            RadarViewable* centerRadar_; //!< Repraesentation von SpaceBoundaries auf dem Radar.
     
    9096            float computeDistance(WorldEntity *item); //!< Auf den Mittelpunkt 'this->getPosition()' bezogen.
    9197            void displayWarning(const std::string warnText);
     98            void displayBoundaries(Pawn *item);
     99            void bounceBack(Pawn *item);
    92100            bool isHumanPlayer(Pawn *item);
    93101           
Note: See TracChangeset for help on using the changeset viewer.