[Orxonox-commit 1120] r5841 - in code/branches/tutorial: data/levels src/orxonox/controllers src/orxonox/worldentities
dafrick at orxonox.net
dafrick at orxonox.net
Wed Sep 30 13:21:07 CEST 2009
Author: dafrick
Date: 2009-09-30 13:21:07 +0200 (Wed, 30 Sep 2009)
New Revision: 5841
Modified:
code/branches/tutorial/data/levels/tutorial.oxw
code/branches/tutorial/src/orxonox/controllers/DroneController.cc
code/branches/tutorial/src/orxonox/worldentities/Drone.cc
code/branches/tutorial/src/orxonox/worldentities/Drone.h
Log:
Removed the code, the PPS students have to insert.
Modified: code/branches/tutorial/data/levels/tutorial.oxw
===================================================================
--- code/branches/tutorial/data/levels/tutorial.oxw 2009-09-30 10:56:59 UTC (rev 5840)
+++ code/branches/tutorial/data/levels/tutorial.oxw 2009-09-30 11:21:07 UTC (rev 5841)
@@ -13,16 +13,6 @@
skybox = "Orxonox/skypanoramagen1"
>
-<Drone name="meineDrohne" position="0,0,-10" primarythrust="80" auxilarythrust="10" rotationthrust="10" mass= "50" linearDamping = "0.9" angularDamping = "0.7">
- <attached>
- <Model scale="10" mesh="drone.mesh"/>
- </attached>
- <collisionShapes>
- <BoxCollisionShape position="0,0,0" halfExtents="10, 10, 10" />
- </collisionShapes>
-</Drone>
-
-
<Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
<Model mesh="hs-w01.mesh" scale=10 position="0,0,-100" />
Modified: code/branches/tutorial/src/orxonox/controllers/DroneController.cc
===================================================================
--- code/branches/tutorial/src/orxonox/controllers/DroneController.cc 2009-09-30 10:56:59 UTC (rev 5840)
+++ code/branches/tutorial/src/orxonox/controllers/DroneController.cc 2009-09-30 11:21:07 UTC (rev 5841)
@@ -42,7 +42,6 @@
// Place your code here:
// - make sure to register the object in the factory
// - do any kind of initialisation
- RegisterObject(DroneController);
// this checks that our creator really is a drone
// and saves the pointer to the drone for the controlling commands
@@ -64,13 +63,11 @@
{
// Place your code here:
// - steering commands
- static float totaltime = 0;
- totaltime += dt;
Drone *myDrone = static_cast<Drone*>(this->getControllableEntity());
- if(totaltime<100)
- {
- myDrone->moveFrontBack( -sqrt(dt) );
- myDrone->rotatePitch(-dt);
- }
+ // you can use the following commands for steering
+ // - moveFrontBack, moveRightLeft, moveUpDown
+ // - rotatePitch, rotateYaw, rotateRoll
+ // - apply the to myDrone (e.g. myDrone->rotateYaw(..) )
+
}
}
Modified: code/branches/tutorial/src/orxonox/worldentities/Drone.cc
===================================================================
--- code/branches/tutorial/src/orxonox/worldentities/Drone.cc 2009-09-30 10:56:59 UTC (rev 5840)
+++ code/branches/tutorial/src/orxonox/worldentities/Drone.cc 2009-09-30 11:21:07 UTC (rev 5841)
@@ -35,7 +35,6 @@
{
// put your code in here:
// create the factory for the drone
- CreateFactory(Drone);
/**
@brief
@@ -45,9 +44,7 @@
{
// put your code in here:
// - register the drone class to the core
- // - create a new controller and pass our this pointer to it as creator
this->myController_ = 0;
- RegisterObject(Drone);
this->localLinearAcceleration_.setValue(0, 0, 0);
this->localAngularAcceleration_.setValue(0, 0, 0);
@@ -57,7 +54,7 @@
this->setCollisionType(WorldEntity::Dynamic);
- myController_ = new DroneController(static_cast<BaseObject*>(this));
+ myController_ = new DroneController(static_cast<BaseObject*>(this)); //!< Creates a new controller and passes our this pointer to it as creator.
}
/**
@@ -79,9 +76,12 @@
// this calls the XMLPort function of the parent class
SUPER(Drone, XMLPort, xmlelement, mode);
- XMLPortParam(Drone, "primaryThrust", setPrimaryThrust, getPrimaryThrust, xmlelement, mode);
- XMLPortParam(Drone, "auxilaryThrust", setAuxilaryThrust, getAuxilaryThrust, xmlelement, mode);
- XMLPortParam(Drone, "rotationThrust", setRotationThrust, getRotationThrust, xmlelement, mode);
+ // put your code in here:
+ // make sure you add the variables primaryThrust_, auxilaryThrust_ and rotationThrust_ to xmlport
+ // make sure that the set- and get-functions exist.
+ // variables can be added by the following command
+ // XMLPortParam(Classname, "xml-attribute-name (i.e. variablename)", setFunction, getFunction, xmlelement, mode)
+
}
/**
Modified: code/branches/tutorial/src/orxonox/worldentities/Drone.h
===================================================================
--- code/branches/tutorial/src/orxonox/worldentities/Drone.h 2009-09-30 10:56:59 UTC (rev 5840)
+++ code/branches/tutorial/src/orxonox/worldentities/Drone.h 2009-09-30 11:21:07 UTC (rev 5841)
@@ -104,11 +104,9 @@
@param thrust The amount of thrust.
*/
inline void setPrimaryThrust( float thrust )
- { this->primaryThrust_=thrust; }
- inline void setAuxilaryThrust( float thrust )
- { this->auxilaryThrust_=thrust; }
- inline void setRotationThrust( float thrust )
- { this->rotationThrust_=thrust; }
+ { this->primaryThrust_=thrust; }
+ // place your set-functions here.
+ // - hint: auxiliary thrust, rotation thrust.
/**
@brief Gets the primary thrust to the input amount.
@@ -116,10 +114,7 @@
*/
inline float getPrimaryThrust()
{ return this->primaryThrust_; }
- inline float getAuxilaryThrust()
- { return this->auxilaryThrust_; }
- inline float getRotationThrust()
- { return this->rotationThrust_; }
+ // place your get-functions here.
private:
DroneController *myController_; //!< The controller of the Drone.
More information about the Orxonox-commit
mailing list