- Timestamp:
- Dec 12, 2017, 8:29:52 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/AsteroidMining_HS17/src/modules/asteroidmining/AsteroidMinable.h
r11664 r11667 29 29 30 30 /** 31 @file AsteroidMinable.h32 31 32 @file 33 @author remartin 34 @brief An asteroid which can be destroyed. Some smaller asteroids are created and a pickup spawns. 35 36 HANDBUCH: 37 o Die Collision Shape kann nur im Konstruktor hinzugefügt werden. Die XML-Argumente werden aber erst nach dem Konstruktor gesetzt. 38 Darum wird hier beim ersten Aufruf der tick()-Methode via putStuff() ein komplett neuer Asteroid generiert und der alte zerstört. 39 o im Level-File includes/pickups.oxi importieren. 40 41 OFFEN/Weiterentwicklung: 42 o @TODO Add resource pickups. 43 --> data_extern/images/effects: PNG's für die Pickups 44 --> https://www.orxonox.net/jenkins/view/Management/job/orxonox_doxygen_trunk/javadoc/group___pickup.html 45 46 o Density doesn't add up to 1... 47 o Does collision damage work properly 48 o Add sound effect (crunching etc. ) (No sound in space...) 49 o Explosion parts 50 51 ANDERORTS VERÄNDERTE SACHEN: 52 Pickup-Zeug: 53 o Pickup.h: createSpawner() neu public statt private 54 o PickupSpawner.h: Zugriffsrechte setPickupTemplateName() und setMaxSpawnedItems() 55 o PickupSpawner.h: In Tick() zwei Testbedingungen eingefügt. 56 o Pawn.h: Attribut acceptsPickups_ inklusive get/set. 57 58 ERLEGTE FEHLER: 59 o Grössenabhängige Collision Shape -> putStuff-Methode, Werte noch nicht durchgesickert. 60 o setHealth: maxHealth() des pawns setzen! 61 o Asteroiden fressen Pickups: Argument in Pawn, Test darauf in Tick() von PickupSpawner. 62 o i++ einfach ganz verhindern, ++i stattdessen. 63 o Velocity didn-t get passed properly through the 2nd constructor. Used get/set instead. 64 o Rand() geht bis zu riesigen Nummern! rnd() ist zwischen 0 und 1 65 66 NOTIZEN: 67 o SUPER 68 o Warnungsverhinderung anderswo: (void)pickedUp; // To avoid compiler warning. 69 o friend class Pickupable; 33 70 34 71 */ … … 48 85 #include "../../orxonox/worldentities/pawns/Pawn.h" 49 86 50 namespace orxonox 51 { 87 namespace orxonox{ 52 88 53 89 … … 55 91 56 92 public: 57 AsteroidMinable(Context* context);// @brief This constructor is for XML access only! 58 AsteroidMinable(Context* c, float size, Vector3 position, Vector3 velocity, bool dS);// @brief Call this Constructor from other C-files. 93 // @brief This constructor is for XML access only! 94 AsteroidMinable(Context* context); 95 // @brief Call this Constructor from other C-files. 96 AsteroidMinable(Context* c, float size, Vector3 position, bool dS); 59 97 60 98 virtual ~AsteroidMinable(); … … 63 101 virtual void tick(float dt) override; 64 102 65 // @brief Overwrite to prevet 'self-collision' of generated stuff103 // @brief overloading that to prevent asteroids from taking damage from each other (domino effect etc. ) 66 104 virtual void hit(Pawn* originator, const Vector3& force, const btCollisionShape* cs, float damage, float healthdamage = 0.0f, float shielddamage = 0.0f); 67 105 virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, const btCollisionShape* cs, float damage, float healthdamage = 0.0f, float shielddamage = 0.0f); … … 80 118 Context* context; 81 119 82 int size; 83 bool generateSmaller; 84 bool dropStuff; 120 int size; //!< Implies health and type of dropped pickups 121 bool generateSmaller; //!< Whether this asteroid leaves fragments 122 bool dropStuff; //!< Whether this asteroid yields valuable stuff 85 123 86 bool initialised; 87 124 // @brief Überschreibt die Methode in Pawn 88 125 virtual void death(); 89 126 127 private: 90 128 129 bool initialised; //!< Used in relation to the constructor detour described above 91 130 92 private:93 131 void registerVariables(); 132 133 // @brief Helper method. 134 virtual void putStuff(); 135 136 // @brief If the option generateSmaller is enabled, individual fragments are added with this method. 94 137 virtual void spawnChildren(); 95 virtual void putStuff();96 138 97 139 // @brief Just for testing. Don-t work anyways. 98 140 void printArrayString(float thingy[]); 99 141 // @brief Just for testing. Don-t work anyways. 100 void printArrayString(int thingy[]);// Just for testing 101 102 103 104 142 void printArrayString(int thingy[]); 105 143 106 144 }; // tolua_export
Note: See TracChangeset
for help on using the changeset viewer.