Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 22, 2011, 3:05:26 PM (13 years ago)
Author:
dafrick
Message:

Cleaning up game immersion. Roughly documenting weapons module.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/modules/weapons/projectiles/SimpleRocket.h

    r8738 r8855  
    2121 *
    2222 *   Author:
    23  *      Oliver Scheuss
     23 *      Gabriel Nadler
    2424 *   Co-authors:
    2525 *      simonmie
    2626 *
    2727 */
     28
     29/**
     30    @file SimpleRocket.h
     31    @brief Definition of the SimpleRocket class.
     32*/
    2833
    2934#ifndef _SimpleRocket_H__
     
    3338
    3439#include "tools/Timer.h"
    35 #include "worldentities/ControllableEntity.h"
     40
    3641#include "graphics/ParticleSpawner.h"
    3742#include "interfaces/RadarViewable.h"
     43#include "worldentities/ControllableEntity.h"
    3844
    3945#include "BasicProjectile.h"
     
    4551    /**
    4652    @brief
    47         SimpleRocket, follows direction from a Rocketcontroller, has fuel for 80% of its lifetime, afterwards it's fire disappears.
     53        SimpleRocket is a target seeking, intelligent rocket. It follows its target until it either hits something or runs out of fuel.
     54        The steering is done by the RocketController.
    4855    @author
    49        Gabriel Nadler (Original file: Oli Scheuss)
     56       Gabriel Nadler
     57    @ingroup WeaponsProjectiles
    5058    */
    5159    class _WeaponsExport SimpleRocket : public ControllableEntity, public BasicProjectile, public RadarViewable
     
    5563            virtual ~SimpleRocket();
    5664            virtual void tick(float dt);
    57             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a SimpleRocket through XML.
    5865
    5966            virtual bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);
    60             void destroyObject();
    6167
    6268            void disableFire(); //!< Method to disable the fire and stop all acceleration
     
    7682            */
    7783            inline void moveFrontBack(float value)
    78             { this->moveFrontBack(Vector2(value, 0)); }
     84                { this->moveFrontBack(Vector2(value, 0)); }
    7985            /**
    8086            @brief Moves the SimpleRocket in the Right/Left-direction by the specifed amount.
     
    8288            */
    8389            inline void moveRightLeft(float value)
    84             { this->moveRightLeft(Vector2(value, 0)); }
     90                { this->moveRightLeft(Vector2(value, 0)); }
    8591            /**
    8692            @brief Moves the SimpleRocket in the Up/Down-direction by the specifed amount.
     
    8894            */
    8995            inline void moveUpDown(float value)
    90             { this->moveUpDown(Vector2(value, 0)); }
     96                { this->moveUpDown(Vector2(value, 0)); }
    9197
    9298            /**
     
    95101            */
    96102            inline void rotateYaw(float value)
    97             { this->rotateYaw(Vector2(value, 0)); }
     103                { this->rotateYaw(Vector2(value, 0)); }
    98104            /**
    99105            @brief Rotates the SimpleRocket around the x-axis by the specifed amount.
     
    101107            */
    102108            inline void rotatePitch(float value)
    103             {
    104                 this->rotatePitch(Vector2(value, 0)); }
     109                { this->rotatePitch(Vector2(value, 0)); }
    105110            /**
    106111            @brief Rotates the SimpleRocket around the z-axis by the specifed amount.
     
    108113            */
    109114            inline void rotateRoll(float value)
    110             {
    111                 this->rotateRoll(Vector2(value, 0)); }
     115                { this->rotateRoll(Vector2(value, 0)); }
    112116
    113             void setOwner(Pawn* owner);
    114             inline Pawn* getOwner() const
    115                 { return this->owner_; }
     117            virtual void setShooter(Pawn* shooter);
    116118
    117119            inline bool hasFuel() const
    118             { return this->fuel_; }
     120                { return this->fuel_; }
    119121
    120122
    121123        private:
    122             WeakPtr<Pawn> owner_;
    123             Vector3 localAngularVelocity_;
     124            static const float FUEL_PERCENTAGE = 0.8f; //!< Percentage of lifetime the rocket has fuel
     125           
     126            Vector3 localAngularVelocity_; //!< Variable to temporarily store accumulated steering command input.
    124127            bool fuel_; //!< Bool is true while the rocket "has fuel"
    125128
    126 
    127             WeakPtr<PlayerInfo> player_;
    128             Timer destroyTimer_;
    129             float lifetime_;
    130             static const int FUEL_PERCENTAGE=80; //!<Percentage of Lifetime the rocket has fuel
     129            WeakPtr<PlayerInfo> player_; //!< The player the SimpleRocket belongs to.
     130            Timer destroyTimer_; //!< Timer to destroy the projectile after its lifetime has run out.
     131            float lifetime_; //!< The time the projectile exists.
    131132
    132133            ParticleEmitter* fire_; //!< Fire-Emittor
    133 
    134 
    135 
    136134    };
    137135
Note: See TracChangeset for help on using the changeset viewer.