Changeset 6811
- Timestamp:
- Apr 30, 2010, 2:39:30 PM (15 years ago)
- Location:
- code/branches/rocket/src/modules/weapons
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/rocket/src/modules/weapons/RocketController.cc
r6810 r6811 21 21 * 22 22 * Author: 23 * Oli Scheuss23 * Gabriel Nadler, Originalfile: Oli Scheuss 24 24 * Co-authors: 25 25 * ... … … 41 41 RocketController::RocketController(BaseObject* creator) : Controller(creator) 42 42 { 43 // Place your code here: 44 // - make sure to register the object in the factory 45 // - do any kind of initialisation 43 46 44 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 49 46 } 50 47 … … 58 55 void RocketController::tick(float dt) 59 56 { 60 // Place your code here: 61 // - steering commands 57 62 58 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 67 60 68 61 rocket->rotateYaw(0.2); … … 71 64 } 72 65 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 */ 74 70 75 71 //void setRocket(SimpleRocket* rocket, RocketController* contr) { -
code/branches/rocket/src/modules/weapons/RocketController.h
r6810 r6811 21 21 * 22 22 * Author: 23 * Oli Scheuss23 * Gabriel Nadler, Originalfile: Oli Scheuss 24 24 * Co-authors: 25 25 * ... … … 42 42 Controller for the Drone of the PPS tutorial. 43 43 @author 44 Oli Scheuss44 Gabriel Nadler, Originalfile: Oli Scheuss 45 45 */ 46 46 class _WeaponsExport RocketController : public Controller, public Tickable … … 51 51 void setRocket(SimpleRocket* rocket, RocketController* contr); 52 52 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); 55 54 protected: 56 55
Note: See TracChangeset
for help on using the changeset viewer.