Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 15, 2009, 1:15:42 PM (14 years ago)
Author:
scheusso
Message:

cleaned up Rocket mess a bit
there is yet a bug if RocketFire is in weaponslot3

File:
1 moved

Legend:

Unmodified
Added
Removed
  • code/branches/particles2/src/modules/weapons/projectiles/Rocket.h

    r6059 r6065  
    3232#include "OrxonoxPrereqs.h"
    3333#include "worldentities/ControllableEntity.h"
    34 #include "controllers/RocketController.h"
    3534
    3635namespace orxonox
    3736{
     37    class ConeCollisionShape;
    3838
    3939    /**
     
    5252            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a Rocket through XML.
    5353            virtual void tick(float dt); //!< Defines which actions the Rocket has to take in each tick.
    54 
    5554           
    56             virtual void moveFrontBack(const Vector2& value);
    57             virtual void moveRightLeft(const Vector2& value);
    58             virtual void moveUpDown(const Vector2& value);
     55            virtual bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);
     56            void destroyObject();
     57           
     58            virtual void moveFrontBack(const Vector2& value){}
     59            virtual void moveRightLeft(const Vector2& value){}
     60            virtual void moveUpDown(const Vector2& value){}
    5961
    6062            virtual void rotateYaw(const Vector2& value);
     
    100102            { this->rotateRoll(Vector2(value, 0)); }
    101103           
    102             /**
    103             @brief Sets the primary thrust to the input amount.
    104             @param thrust The amount of thrust.
    105             */
    106             inline void setPrimaryThrust( float thrust )
    107                 { this->primaryThrust_=thrust; }     
    108             // place your set-functions here.
    109             // - hint: auxiliary thrust, rotation thrust.
    110            
    111             /**
    112             @brief Gets the primary thrust to the input amount.
    113             @preturn The amount of thrust.
    114             */
    115             inline float getPrimaryThrust()
    116                 { return this->primaryThrust_; }
    117             // place your get-functions here.
     104            void setOwner(Pawn* owner);
     105            inline Pawn* getOwner() const
     106                { return this->owner_; }
     107               
     108            inline void setDamage(float damage)
     109                { this->damage_ = damage; }
     110            inline float getDamage() const
     111                { return this->damage_; }
    118112           
    119113        private:
    120             RocketController *myController_; //!< The controller of the Rocket.
     114            WeakPtr<Pawn> owner_;
     115            Vector3 localAngularVelocity_;
     116            float damage_;
     117            bool bDestroy_;
    121118           
    122             btVector3 localLinearAcceleration_; //!< The linear acceleration that is used to move the Rocket the next tick.
    123             btVector3 localAngularAcceleration_; //!< The linear angular acceleration that is used to move the Rocket the next tick.
    124             float primaryThrust_; //!< The amount of primary thrust. This is just used, when moving forward.
    125             float auxilaryThrust_; //!< The amount of auxilary thrust. Used for all other movements (except for rotations).
    126             float rotationThrust_; //!< The amount of rotation thrust. Used for rotations only.
     119            Model* model_;
     120            ConeCollisionShape* collisionShape_;
     121            Timer destroyTimer_;
     122            float lifetime_;
    127123    };
    128124
Note: See TracChangeset for help on using the changeset viewer.