Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6811 for code


Ignore:
Timestamp:
Apr 30, 2010, 2:39:30 PM (15 years ago)
Author:
gnadler
Message:
 
Location:
code/branches/rocket/src/modules/weapons
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/rocket/src/modules/weapons/RocketController.cc

    r6810 r6811  
    2121 *
    2222 *   Author:
    23  *      Oli Scheuss
     23 *     Gabriel Nadler, Originalfile: Oli Scheuss
    2424 *   Co-authors:
    2525 *      ...
     
    4141    RocketController::RocketController(BaseObject* creator) : Controller(creator)
    4242    {
    43         // Place your code here:
    44         // - make sure to register the object in the factory
    45         // - do any kind of initialisation
     43
    4644        RegisterObject(RocketController);
    47         // this checks that our creator really is a drone
    48         // and saves the pointer to the drone for the controlling commands
     45
    4946    }
    5047
     
    5855    void RocketController::tick(float dt)
    5956    {
    60         // Place your code here:
    61         // - steering commands
     57
    6258        SimpleRocket *rocket = static_cast<SimpleRocket*>(this->getControllableEntity());
    63         // you can use the following commands for steering
    64         // - moveFrontBack, moveRightLeft, moveUpDown
    65         // - rotatePitch, rotateYaw, rotateRoll
    66         // - apply the to myDrone (e.g. myDrone->rotateYaw(..) )
     59
    6760
    6861                rocket->rotateYaw(0.2);
     
    7164    }
    7265
    73 
     66        /*
     67        I wanted to define the controllable entity with this function but the compiler gives the error: line 80: rocket - unidentified identifier
     68        or some similar error.
     69        */
    7470
    7571        //void setRocket(SimpleRocket* rocket, RocketController* contr) {
  • code/branches/rocket/src/modules/weapons/RocketController.h

    r6810 r6811  
    2121 *
    2222 *   Author:
    23  *      Oli Scheuss
     23 *      Gabriel Nadler, Originalfile: Oli Scheuss
    2424 *   Co-authors:
    2525 *      ...
     
    4242        Controller for the Drone of the PPS tutorial.
    4343    @author
    44         Oli Scheuss
     44        Gabriel Nadler, Originalfile: Oli Scheuss
    4545    */
    4646    class _WeaponsExport RocketController : public Controller, public Tickable
     
    5151                        void setRocket(SimpleRocket* rocket, RocketController* contr);
    5252           
    53             virtual void tick(float dt); //!< The controlling happens here. This method defines what the controller has to do each tick.
    54 
     53            virtual void tick(float dt);
    5554        protected:
    5655
Note: See TracChangeset for help on using the changeset viewer.