Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 17, 2005, 4:02:36 PM (20 years ago)
Author:
bensch
Message:

orxonox/branches/weaponSystem: connecting sounds to the weapon works fine now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/weaponSystem/src/world_entities/weapons/weapon.h

    r4882 r4883  
    8585
    8686    // FUNCTIONS TO SET THE WEAPONS PROPERTIES.
    87     void setProjectile(Projectile* projectile);
    88     Projectile* getProjectile();
     87    /** @param projectile a projectile for this weapon */
     88    void setProjectile(Projectile* projectile) { this->projectile = projectile; };
     89    /** @returns The projectile if availiable */
     90    Projectile* getProjectile() { return this->projectile; };
    8991
    9092    /** @param state the State to time @param duration the duration of the State */
     
    98100    /** @returns the current State of the Weapon */
    99101    inline WeaponState getCurrentState() const { return this->currentState; };
     102    /** @param energyMax the maximum energy the Weapon can have @param energyLoadedMax the maximum energy in the weapon buffers */
     103    inline void setMaximumEnergy(float energyMax, float energyLoadedMax = 0.0) { this->energyMax = energyMax; this->energyLoadedMax = energyLoadedMax; };
    100104
    101     inline void setMaximumEnergy(float energyMax, float energyLoadedMax = 0.0) { this->energyMax = energyMax; this->energyLoadedMax = energyLoadedMax; };
     105    void setActionSound(WeaponAction action, const char* soundFile);
     106    /** @see void setActionSound(WeaponAction action, const char* soundFile); */
     107    void setActionSound(const char* action, const char* soundFile) { this->setActionSound(charToAction(action), soundFile); };
    102108
    103109    virtual void destroy();
     
    129135
    130136  protected:
    131     SoundSource*         weaponSource;
     137    SoundSource*         soundSource;
    132138    // it is all about energy
    133139    float                energy;
     
    145151    float                stateDuration;                    //!< how long the state has taken until now.
    146152    float                times[WS_STATE_COUNT];            //!< Times to stay in the different States @see WeaponState.
     153    Animation3D*         animation[WS_STATE_COUNT];        //!< Animations for all the States (you can say yourself on what part of the gun this animation acts).
    147154    SoundBuffer*         soundBuffers[WA_ACTION_COUNT];    //!< SoundBuffers for all actions @see WeaponAction.
    148     Animation3D*         animation[WS_STATE_COUNT];        //!< Animations for all the States (you can say yourself on what part of the gun this animation acts).
    149155
    150156
Note: See TracChangeset for help on using the changeset viewer.