Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 12, 2011, 7:50:43 PM (13 years ago)
Author:
jo
Message:

Ai and tutorial improvements merged back to the trunk. AI features: all weapons are used, the ai-firestrength is configurable, bots are able to collect pickups . I've set the tutorial level as default level.

Location:
code/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/worldentities/pawns/Pawn.cc

    r8855 r8891  
    9393
    9494        this->isHumanShip_ = this->hasLocalController();
    95        
     95
    9696        this->setSyncMode(ObjectDirection::Bidirectional); // needed to synchronise e.g. aimposition
    9797    }
     
    450450        this->isHumanShip_ = true;
    451451    }
     452
     453    void Pawn::changedActivity(void)
     454    {
     455        SUPER(Pawn, changedActivity);
     456
     457        this->setRadarVisibility(this->isActive());
     458    }
     459
     460    void Pawn::changedVisibility(void)
     461    {
     462        SUPER(Pawn, changedVisibility);
     463        //this->setVisible(this->isVisible());
     464        this->setRadarVisibility(this->isVisible());
     465    }
     466
    452467}
  • code/trunk/src/orxonox/worldentities/pawns/Pawn.h

    r8855 r8891  
    170170            virtual const Vector3& getCarrierPosition(void) const
    171171                { return this->getWorldPosition(); };
     172            virtual void changedActivity(void); //!< To enable radarviewability when the activity is changed
     173            virtual void changedVisibility(void); //!< To enable proper radarviewability when the visibility is changed
    172174
    173175        protected:
     
    195197            float maxHealth_;
    196198            float initialHealth_;
    197            
     199
    198200            float shieldHealth_;
    199201            float maxShieldHealth_;
  • code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc

    r8858 r8891  
    298298    }
    299299
    300         /**
    301     @brief
    302         Add an Engine to the SpaceShip.
    303     @param engine
    304         A pointer to the Engine to be added.
    305     */
    306300    void SpaceShip::addEngine(orxonox::Engine* engine)
    307301    {
     
    504498    void SpaceShip::resetCamera()
    505499    {
    506         Camera *camera = this->getCamera();
    507         if (camera == 0)
    508         {
    509             orxout(internal_warning) << "Failed to reset camera!" << endl;
    510             return;
    511         }
    512 
    513         this->shakeDt_ = 0.0f;
    514         camera->setPosition(this->cameraOriginalPosition_);
    515         camera->setOrientation(this->cameraOriginalOrientation_);
     500        if(this->hasLocalController() && this->hasHumanController())
     501        {
     502            Camera *camera = this->getCamera();
     503            if (camera == 0)
     504            {
     505                orxout(internal_warning) << "Failed to reset camera!" << endl;
     506                return;
     507            }
     508            this->shakeDt_ = 0.0f;
     509            camera->setPosition(this->cameraOriginalPosition_);
     510            camera->setOrientation(this->cameraOriginalOrientation_);
     511        }
    516512    }
    517513
Note: See TracChangeset for help on using the changeset viewer.