Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 23, 2015, 7:33:37 PM (9 years ago)
Author:
meggiman
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/weaponFS15/src/modules/weapons/projectiles/GravityBombField.h

    r10435 r10455  
    2020#include <stdlib.h>
    2121#include <time.h>
     22#include <math.h>
    2223#include "graphics/Backlight.h"
     24#include "sound\WorldSound.h"
    2325
    2426namespace orxonox {
     27
     28/**
     29 * @class       GravityBombField
     30 *
     31 * @brief       This class is used by GravityBomb to place the ForceField and Visual effect to the environment.
     32 *                      The field has a maximum lifetime and gets smaller and stronger the more time passes. In the end, the field explodes and damages all pawns nearby.
     33 *
     34 * @author      Manuel Eggimann
     35 * @date        23.05.2015
     36 */
    2537class GravityBombField: public ForceField, public RadarViewable {
    2638public:
     
    3042        virtual void destroy();
    3143
     44        /**
     45         * @fn  void GravityBombField::setShooter(Pawn* shooter)
     46         *
     47         * @brief       This function is used to determine save the pawn who created the field and is used inside the GravityBomb class.
     48         *
     49         * @author      Manuel Eggimann
     50         * @date        23.05.2015
     51         *
     52         * @param [in,out]      the Pawn that created the field.
     53         */
    3254        void setShooter(Pawn* shooter)
    3355        { this->shooter_ = shooter; }
     
    3759
    3860private:
    39         static const float FORCE_FIELD_LIFETIME;
    40         static const float FORCE_SPHERE_START_RADIUS;
    41         static const float FORCE_SPHERE_START_STRENGTH;
    42         static const float FORCE_FIELD_EXPLOSION_DAMMAGE;
    43         static const float EXPLOSION_DURATION;
    44         static const float EXPLOSION_RADIUS;
    45         static const float PEAK_ANGULAR_VELOCITY;
    46         static const float PEAK_EXPLOSION_FORCE;
     61        //Set these constants inside GravityBombField.cc to alter the behaviour of the field.
     62       
     63        static const float FORCE_FIELD_LIFETIME;        ///< The lifetime of the ForceField in seconds. After lifetime seconds, has already exploded and the particle effects will start to vanish.
     64        static const float FORCE_SPHERE_START_RADIUS;   ///< The initial sphere radius of the Force Field. The forcefield gets smaller by time.
     65        static const float FORCE_SPHERE_START_STRENGTH; ///< The initial Force the Field exerts on every object with non-zero mass.
     66        static const float FORCE_FIELD_EXPLOSION_DAMMAGE;   ///< The maximum dammage a pawn gets nearby an exploding field. The farer away from explosion center the smaller the dammage.
     67        static const float EXPLOSION_DURATION;  ///< Determines how fast the shockwave of the Explosion expands. It takes GravityBombField::EXPLOSION_DURATION seconds for the field to expand from 0 radius to GravityBombField::EXPLOSION_RADIUS.
     68        static const float EXPLOSION_RADIUS;    ///< How far does the shockwave reach. All pawns which outside of a sphere witch this radius rest unharmed by the explosion.
     69        static const float PEAK_ANGULAR_VELOCITY;   ///< The model of the bomb in the center of the Field does rotate faster and faster as time passes until it reaches PEAK_ANGULAR_VELOCITY at the fields end of life.
     70        static const float PEAK_EXPLOSION_FORCE;        ///< The peak force the explosion exerts on the pawns nearby.
     71        static const float CENTRE_MODEL_END_SIZE;   ///< Size of the 3d-model of the bomb in the fields centre.
    4772
    4873        float forceSphereRadius_;
    4974        float forceStrength_;
    5075        float lifetime_;
     76        float modelScaling_;
    5177        Vector3 rotationVector_;
    5278        bool fieldExploded_;
     
    5682        MovableEntity * bombModel_;
    5783        Pawn* shooter_;
     84        Backlight* centreLight_;
     85        WorldSound* explosionSound_;
    5886};
    5987
Note: See TracChangeset for help on using the changeset viewer.