Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 9, 2011, 2:59:07 PM (13 years ago)
Author:
decryphe
Message:
  • Moved handling of blur effect from Engine.cc to SpaceShip.cc.
  • Implemented handling of multiple engines per SpaceShip, so that in future it would be possible to turn single engines on/off individually (for example if one gets destroyed on a big ship).
  • Updated some pointers accessing the single Engine of a SpaceShip to ask the SpaceShip itself instead for data.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/bigships/src/orxonox/worldentities/pawns/SpaceShip.h

    r7801 r8426  
    5959
    6060            virtual void fire();
    61             virtual void boost();
     61            virtual void boost(bool bBoost); // Starts or stops boosting.
    6262
    63             void setEngine(Engine* engine);
    64             inline Engine* getEngine() const
    65                 { return this->engine_; }
     63                        void addEngine(Engine* engine);
     64                        bool hasEngine(Engine* engine);
     65                        Engine* getEngine(unsigned int i); // This one's for XMLPort
     66                        inline const std::vector<Engine*>& getEngineList()
     67                                { return this->engineList_; }
     68                        void removeAllEngines();
     69
     70                        void setSpeedFactor(float factor);
     71                        float getSpeedFactor(); // Gets mean speed factor
     72                        float getMaxSpeedFront(); // gets largest speed forward
     73                        float getBoostFactor(); // gets mean boost factor
    6674
    6775            inline void setSteeringDirection(const Vector3& direction)
     
    6977            inline const Vector3& getSteeringDirection() const
    7078                { return this->steering_; }
     79                        inline void resetEngineTicks()
     80                                { this->engineTicksNotDone = this->engineList_.size(); }
     81                        inline void oneEngineTickDone()
     82                                { this->engineTicksNotDone--; }
     83                        inline const bool hasEngineTicksRemaining()
     84                                { return (this->engineTicksNotDone>0); }
    7185
    72             void setBoost(bool bBoost);
    7386            inline bool getBoost() const
    7487                { return this->bBoost_; }
    75 
    76             inline void setEngineTemplate(const std::string& temp)
    77                 { this->enginetemplate_ = temp; this->loadEngineTemplate(); }
    78             inline const std::string& getEngineTemplate() const
    79                 { return this->enginetemplate_; }
    80 
    81             inline void setPermanentBoost(bool bPermanent)
    82                 { this->bPermanentBoost_ = bPermanent; }
    83             inline bool getPermanentBoost() const
    84                 { return this->bPermanentBoost_; }
    8588
    8689        protected:
     
    9093            bool bBoost_;
    9194            bool bBoostCooldown_;
    92             bool bPermanentBoost_;
    9395            float boostPower_;
    9496            float initialBoostPower_;
     
    106108            void registerVariables();
    107109            virtual bool isCollisionTypeLegal(WorldEntity::CollisionType type) const;
    108 
    109             void loadEngineTemplate();
    110110           
     111                        //All things booster
     112                        void changedEnableMotionBlur();
    111113            void boostCooledDown(void);
    112114
    113             std::string enginetemplate_;
    114             Engine* engine_;
     115                        Shader* boostBlur_;
     116            float blurStrength_;
     117            bool bEnableMotionBlur_;
     118
     119                        std::vector<Engine*> engineList_;
     120                        int engineTicksNotDone; // Used for knowing when to reset temporary variables.
    115121            Timer timer_;
    116122    };
Note: See TracChangeset for help on using the changeset viewer.