- Timestamp:
- May 5, 2011, 4:14:07 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/spaceboundaries/src/orxonox/worldentities/SpaceBoundaries.h
r8301 r8404 27 27 */ 28 28 29 /* TODO: - Sobald Bots im Spiel sind, stürzt das Programm relativ bald ab!!! 30 */ 31 32 33 /* REALISIERUNGSIDEEN: 34 35 Mehrere Instanzen: 36 Im Konstruktor schauen, wer innerhalb der eigenen Grenzen ist und diese in eine Liste geben, die in jeder tick-Funktion 37 durchgearbeitet wird. 38 Moeglichkeit bereitstellen, ein Pawn durch ein Portal einer anderen Instanz von SpaceBoundaries zuzuweisen. 39 Schauen, wie es zu handhaben ist, wenn ein neuer Spieler oder Bot nachtraeglich ins Spiel kommt. 40 29 /* TODO: - Textmessages und Billboards sollen teils nur bei einem humanPlayer angezeigt werden, nicht bei allen (vgl. Netzwerk-Spiel mit mehreren humanPlayers) 30 beachte hierzu folgende statische Funktion: 'static unsigned int Host::getPlayerID()' 31 (file:///home/kmaurus/orxonox/spaceBoundaries/build/doc/api/html/classorxonox_1_1_host.html#9c1e3b39e3b42e467dfbf42902911ce2) 32 33 - Kommentieren (Betrachte als Beispiel/Vorbild 'libraries/core/WeakPtr.h') 34 35 - Wiki-SpaceBoundaries-Eintrag aktualisieren 41 36 */ 42 37 … … 44 39 #define _SpaceBoundaries_H__ 45 40 46 /* Einige, spezifische include-Statements */ 41 47 42 #include "core/CoreIncludes.h" 43 #include "core/WeakPtr.h" 48 44 #include "tools/interfaces/Tickable.h" 49 45 #include "interfaces/RadarViewable.h" … … 56 52 #include <vector> 57 53 54 namespace orxonox 55 { 56 58 57 /** 59 @brief SpaceBoundaries gives level creators the possibility to bar Pawns from leaving a defined area .58 @brief SpaceBoundaries gives level creators the possibility to bar Pawns from leaving a defined area (until now this area is a ball). 60 59 61 60 Five attributes can/should be defined in the XML-File: 62 - 'position' : absolute position of the SpaceBoundaries class. 'warnDistance' and 'maxDistance' refer to this 'position'.63 61 - 'warnDistance' : If the distance between the pawn of the human player and 'position' is bigger than 'warnDistance', a message is displayed to 64 62 inform the player that he'll soon be leaving the allowed area. 65 63 - 'maxDistance' : defines the area, where a pawn is allowed to be (radius of a ball). 66 64 - 'showDistance' : If the distance between the pawn and the boundary of the allowed area is smaller than 'showDistance', the boundary is shown. 67 - 'healthDecrease' : a measure to define how fast the health of a pawn should decrease after leaving the allowed area. 68 Empfohlene Werte: 0.1 (langsame Health-Verminderung) bis 5 (sehr schnelle Health-Verminderung) 65 - 'healthDecrease' : a measure to define how fast the health of a pawn should decrease after leaving the allowed area (unnecessary if 'reactionMode' == 0). 66 Recommended values: 0.1 (slow health decrease) to 5 (very fast health decrease) 67 - 'reactionMode' : Integer-Value. Defines what effect appears if a space ship has crossed the boundaries. 68 0: Reflect the space ship (default). 69 1: Decrease Health of the space ship after having left the allowed area. 69 70 */ 70 71 71 namespace orxonox72 {73 72 class _OrxonoxExport SpaceBoundaries : public StaticEntity, public Tickable 74 73 { … … 79 78 void checkWhoIsIn(); //!< Update the list 'pawnsIn_'. 80 79 81 void positionBillboard(const Vector3 position); 80 void positionBillboard(const Vector3 position); //!< Display a Billboard at the position 'position'. 82 81 void setBillboardOptions(Billboard *billy); 83 void removeAllBillboards(); 82 void removeAllBillboards(); //!< Hide all all elements of '*billboard_' and set their attribute 'usedYet' to 0. 84 83 85 84 void setMaxDistance(float r); … … 94 93 void setHealthDecrease(float amount); 95 94 float getHealthDecrease(); 95 96 void setReaction(int mode); 97 int getReaction(); 96 98 97 99 void XMLPort(Element& xmlelement, XMLPort::Mode mode); … … 102 104 struct billboardAdministration{ bool usedYet; Billboard* billy; }; 103 105 104 std::list< Pawn*> pawnsIn_; //!< List of the pawns that this instance of SpaceBoundaries has to handle.106 std::list<WeakPtr<Pawn> > pawnsIn_; //!< List of the pawns that this instance of SpaceBoundaries has to handle. 105 107 106 108 std::vector<billboardAdministration> billboards_; 107 109 110 int reaction_; //!< Werte: 0, 1. 0: Reflektion an Boundaries (Standard). 1: Health-Abzug-Modus. 108 111 float maxDistance_; //!< maximal zulaessige Entfernung von 'this->getPosition()'. 109 112 float warnDistance_; //!< Entfernung von 'this->getPosition()', ab der eine Warnung angezeigt wird, dass man bald das zulaessige Areal verlaesst. … … 113 116 //!< Empfohlene Werte: 0.1 (langsame Health-Verminderung) bis 5 (sehr schnelle Health-Verminderung) 114 117 115 Billboard *boundary_;116 117 118 RadarViewable* centerRadar_; //!< Repraesentation von SpaceBoundaries auf dem Radar. 118 119 … … 120 121 void displayWarning(const std::string warnText); 121 122 void displayBoundaries(Pawn *item); 122 void bounceBack(Pawn *item);123 void conditionalBounceBack(Pawn *item, float currentDistance, float dt); 123 124 bool isHumanPlayer(Pawn *item); 124 125
Note: See TracChangeset
for help on using the changeset viewer.