Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 12, 2017, 8:29:52 PM (8 years ago)
Author:
remartin
Message:

Added tilting for the spicedAsteroidBelt. Finished commenting, polish up. Done.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/AsteroidMining_HS17/src/modules/asteroidmining/AsteroidMinable.h

    r11664 r11667  
    2929
    3030/**
    31     @file AsteroidMinable.h
    3231
     32    @file
     33    @author remartin
     34    @brief An asteroid which can be destroyed. Some smaller asteroids are created and a pickup spawns.
     35
     36HANDBUCH:
     37o 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.
     39o im Level-File includes/pickups.oxi importieren.
     40
     41OFFEN/Weiterentwicklung:
     42o @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
     46o Density doesn't add up to 1...
     47o Does collision damage work properly
     48o Add sound effect (crunching etc. ) (No sound in space...)
     49o Explosion parts
     50
     51ANDERORTS VERÄNDERTE SACHEN:
     52Pickup-Zeug:
     53o Pickup.h: createSpawner() neu public statt private
     54o PickupSpawner.h: Zugriffsrechte setPickupTemplateName() und setMaxSpawnedItems()
     55o PickupSpawner.h: In Tick() zwei Testbedingungen eingefügt.
     56o Pawn.h: Attribut acceptsPickups_ inklusive get/set.
     57
     58ERLEGTE FEHLER:
     59o Grössenabhängige Collision Shape -> putStuff-Methode, Werte noch nicht durchgesickert.
     60o setHealth: maxHealth() des pawns setzen!
     61o Asteroiden fressen Pickups: Argument in Pawn, Test darauf in Tick() von PickupSpawner.
     62o i++ einfach ganz verhindern, ++i stattdessen.
     63o Velocity didn-t get passed properly through the 2nd constructor. Used get/set instead.
     64o Rand() geht bis zu riesigen Nummern! rnd() ist zwischen 0 und 1
     65
     66NOTIZEN:
     67o SUPER
     68o Warnungsverhinderung anderswo: (void)pickedUp; // To avoid compiler warning.
     69o friend class Pickupable;
    3370
    3471*/
     
    4885#include "../../orxonox/worldentities/pawns/Pawn.h"
    4986
    50 namespace orxonox
    51 {
     87namespace orxonox{
    5288
    5389
     
    5591
    5692        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);
    5997
    6098            virtual ~AsteroidMinable();
     
    63101            virtual void tick(float dt) override;
    64102
    65             // @brief Overwrite to prevet 'self-collision' of generated stuff
     103            // @brief overloading that to prevent asteroids from taking damage from each other (domino effect etc. )
    66104            virtual void hit(Pawn* originator, const Vector3& force, const btCollisionShape* cs, float damage, float healthdamage = 0.0f, float shielddamage = 0.0f);
    67105            virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, const btCollisionShape* cs, float damage, float healthdamage = 0.0f, float shielddamage = 0.0f);
     
    80118            Context* context;
    81119
    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
    85123
    86             bool initialised;
    87 
     124            // @brief Überschreibt die Methode in Pawn
    88125            virtual void death();
    89126
     127        private:
    90128
     129            bool initialised; //!< Used in relation to the constructor detour described above
    91130
    92         private:
    93131            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.
    94137            virtual void spawnChildren();
    95             virtual void putStuff();
    96138
    97139            // @brief Just for testing. Don-t work anyways.
    98140            void printArrayString(float thingy[]);
    99141            // @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[]);
    105143
    106144    }; // tolua_export
Note: See TracChangeset for help on using the changeset viewer.