Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8741 for code/branches/ai2/src


Ignore:
Timestamp:
Jul 10, 2011, 9:53:17 PM (13 years ago)
Author:
jo
Message:

Correction of camera bug.

Location:
code/branches/ai2/src/orxonox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ai2/src/orxonox/controllers/ArtificialController.h

    r8736 r8741  
    142142
    143143            static bool sameTeam(ControllableEntity* entity1, ControllableEntity* entity2, Gametype* gametype); // hack
    144             void boostControl();
     144            void boostControl(); //<! Sets and resets the boost parameter of the spaceship. Bots alternate between boosting and saving boost.
    145145
    146146            bool bHasTargetPosition_;
     
    149149            bool bShooting_;
    150150
    151             int numberOfWeapons; //< Used for weapon init function. Displayes number of weapons available for a bot.
     151            int numberOfWeapons; //<! Used for weapon init function. Displayes number of weapons available for a bot.
    152152            bool weapons[WeaponSystem::MAX_WEAPON_MODES]; //<! Displays if a weapon is available - managed by setupWeapons()
    153             int projectiles[WeaponSystem::MAX_WEAPON_MODES]; //<! Displays amount of projectiles. - managed by setupWeapons()
    154             float botlevel_; //< Makes the level of a bot configurable.
    155             float timeout_; //< Timeout for rocket usage. (If a rocket misses, a bot should stop using it.)
     153            int projectiles[WeaponSystem::MAX_WEAPON_MODES]; //<! Displays amount of projectiles of each weapon. - managed by setupWeapons()
     154            float botlevel_; //<! Makes the level of a bot configurable.
     155            float timeout_; //<! Timeout for rocket usage. (If a rocket misses, a bot should stop using it.)
    156156
    157157            enum Mode {DEFAULT, ROCKET, DEFENCE, MOVING};//TODO; implement DEFENCE, MOVING modes
  • code/branches/ai2/src/orxonox/worldentities/pawns/SpaceShip.cc

    r8706 r8741  
    326326    void SpaceShip::resetCamera()
    327327    {
    328         Camera *camera = this->getCamera();
    329 
    330         if (camera == 0)
    331         {
    332             COUT(2) << "Failed to reset camera!";
    333             return;
    334         }
    335    
    336         this->shakeDt_ = 0;
    337         camera->setPosition(this->cameraOriginalPosition_);
    338         camera->setOrientation(this->cameraOriginalOrientation_);
     328        if(this->hasLocalController() && this->hasHumanController())
     329        {
     330            Camera *camera = this->getCamera();
     331
     332            if (camera == 0)
     333            {
     334                COUT(2) << "Failed to reset camera!";
     335                return;
     336            }
     337   
     338            this->shakeDt_ = 0;
     339            camera->setPosition(this->cameraOriginalPosition_);
     340            camera->setOrientation(this->cameraOriginalOrientation_);
     341        }
    339342    }
    340343
Note: See TracChangeset for help on using the changeset viewer.