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/Rocket.h

    r8738 r8855  
    2727 */
    2828
     29/**
     30    @file Rocket.h
     31    @brief Definition of the Rocket class.
     32*/
     33
    2934#ifndef _Rocket_H__
    3035#define _Rocket_H__
     
    3338
    3439#include "tools/Timer.h"
     40
     41#include "interfaces/RadarViewable.h"
    3542#include "worldentities/ControllableEntity.h"
    36 #include "interfaces/RadarViewable.h"
    3743
    3844#include "BasicProjectile.h"
     
    4450    /**
    4551    @brief
    46         Rocket, that is made to move upon a specified pattern.
    47         This class was constructed for the PPS tutorial.
     52        Rocket that can be steered by the player.
     53
    4854    @author
    4955        Oli Scheuss
     56    @ingroup WeaponsProjectiles
    5057    */
    5158    class _WeaponsExport Rocket : public ControllableEntity, public BasicProjectile, public RadarViewable
     
    5562            virtual ~Rocket();
    5663
    57             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a Rocket through XML.
    5864            virtual void tick(float dt); //!< Defines which actions the Rocket has to take in each tick.
    5965
    6066            virtual bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);
    61             void destroyObject();
     67            virtual void destroyObject(void);
    6268            void destructionEffect();
    6369
    64             virtual void moveFrontBack(const Vector2& value){}
    65             virtual void moveRightLeft(const Vector2& value){}
    66             virtual void moveUpDown(const Vector2& value){}
     70            virtual void moveFrontBack(const Vector2& value) {}
     71            virtual void moveRightLeft(const Vector2& value) {}
     72            virtual void moveUpDown(const Vector2& value) {}
    6773
    6874            virtual void rotateYaw(const Vector2& value);
     
    7581            */
    7682            inline void moveFrontBack(float value)
    77             { this->moveFrontBack(Vector2(value, 0)); }
     83                { this->moveFrontBack(Vector2(value, 0)); }
    7884            /**
    7985            @brief Moves the Rocket in the Right/Left-direction by the specifed amount.
     
    8187            */
    8288            inline void moveRightLeft(float value)
    83             { this->moveRightLeft(Vector2(value, 0)); }
     89                { this->moveRightLeft(Vector2(value, 0)); }
    8490            /**
    8591            @brief Moves the Rocket in the Up/Down-direction by the specifed amount.
     
    8793            */
    8894            inline void moveUpDown(float value)
    89             { this->moveUpDown(Vector2(value, 0)); }
     95                { this->moveUpDown(Vector2(value, 0)); }
    9096
    9197            /**
     
    94100            */
    95101            inline void rotateYaw(float value)
    96             { this->rotateYaw(Vector2(value, 0)); }
     102                { this->rotateYaw(Vector2(value, 0)); }
    97103            /**
    98104            @brief Rotates the Rocket around the x-axis by the specifed amount.
     
    100106            */
    101107            inline void rotatePitch(float value)
    102             { this->rotatePitch(Vector2(value, 0)); }
     108                { this->rotatePitch(Vector2(value, 0)); }
    103109            /**
    104110            @brief Rotates the Rocket around the z-axis by the specifed amount.
     
    106112            */
    107113            inline void rotateRoll(float value)
    108             { this->rotateRoll(Vector2(value, 0)); }
     114                { this->rotateRoll(Vector2(value, 0)); }
    109115
    110             void setOwner(Pawn* owner);
    111             inline Pawn* getOwner() const
    112                 { return this->owner_; }
     116            virtual void setShooter(Pawn* shooter);
    113117
    114118            virtual void fired(unsigned int firemode);
    115119
    116120        private:
    117             WeakPtr<Pawn> owner_;
    118             Vector3 localAngularVelocity_;
     121            Vector3 localAngularVelocity_; //!< Variable to temporarily store accumulated steering command input.
    119122
    120             WeakPtr<PlayerInfo> player_;
    121             Timer destroyTimer_;
    122             float lifetime_;
     123            WeakPtr<PlayerInfo> player_; //!< The player that controls the Rocket.
     124            Timer destroyTimer_; //!< Timer to destroy the projectile after its lifetime has run out.
     125            float lifetime_; //!< The time the projectile exists.
    123126
    124             WorldSound* defSndWpnEngine_;
    125             WorldSound* defSndWpnLaunch_;
     127            WorldSound* defSndWpnEngine_; //!< Engine sound.
     128            WorldSound* defSndWpnLaunch_; //!< Launch sound.
    126129    };
    127130
Note: See TracChangeset for help on using the changeset viewer.