[Orxonox-commit 1769] r6487 - in code/branches/tutorial: . data/levels src/orxonox/controllers src/orxonox/worldentities

rgrieder at orxonox.net rgrieder at orxonox.net
Sun Mar 7 23:27:20 CET 2010


Author: rgrieder
Date: 2010-03-07 23:27:20 +0100 (Sun, 07 Mar 2010)
New Revision: 6487

Modified:
   code/branches/tutorial/
   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:
Merged r5841 that removes the student's code from the tutorial.


Property changes on: code/branches/tutorial
___________________________________________________________________
Modified: svn:mergeinfo
   - /code/branches/buildsystem:1874-2276,2278-2400
/code/branches/buildsystem2:2506-2658
/code/branches/buildsystem3:2662-2708
/code/branches/ceguilua:1802-1808
/code/branches/console:5941-6104
/code/branches/core3:1572-1739
/code/branches/core4:3221-3224,3227,3234-3238,3242,3244-3250,3252-3254,3256,3259-3261,3264-3265,3268-3275,3277-3278,3280,3284-3285,3287,3289-3294,3305,3309-3310
/code/branches/core5:5768-5928,6009
/code/branches/gametypes:2826-3031
/code/branches/gcc43:1580
/code/branches/gui:1635-1723,2795-2894
/code/branches/ingamemenu:6000-6023
/code/branches/input:1629-1636
/code/branches/libraries:5612-5692
/code/branches/libraries2:5703-5737
/code/branches/lodfinal:2372-2411
/code/branches/map:2801-3086,3089
/code/branches/menu:5941-6146,6148
/code/branches/miniprojects:2754-2824
/code/branches/netp2:2835-2988
/code/branches/netp3:2988-3082
/code/branches/netp6:3214-3302
/code/branches/network:2356
/code/branches/network64:2210-2355
/code/branches/objecthierarchy:1911-2085,2100,2110-2169
/code/branches/objecthierarchy2:2171-2479
/code/branches/overlay:2117-2385
/code/branches/particles:2829-3085
/code/branches/particles2:6050-6106,6109
/code/branches/pch:3113-3194
/code/branches/physics:1912-2055,2107-2439
/code/branches/physics_merge:2436-2457
/code/branches/pickups:1926-2086,2127,2827-2915
/code/branches/pickups2:2107-2497,2915-3071
/code/branches/presentation:2369-2652,2654-2660
/code/branches/presentation2:6106-6416
/code/branches/questsystem:1894-2088
/code/branches/questsystem2:2107-2259
/code/branches/questsystem5:2776-2905
/code/branches/resource:3327-3366
/code/branches/resource2:3372-5694
/code/branches/script_trigger:1295-1953,1955
/code/branches/sound:2829-3010
/code/branches/sound3:5941-6102
/code/branches/steering:5949-6091
/code/branches/tutorial:5765-5840
/code/branches/weapon:1925-2094
/code/branches/weapon2:2107-2488
/code/branches/weapons:2897-3051
/code/branches/weaponsystem:2742-2890
   + /code/branches/buildsystem:1874-2276,2278-2400
/code/branches/buildsystem2:2506-2658
/code/branches/buildsystem3:2662-2708
/code/branches/ceguilua:1802-1808
/code/branches/console:5941-6104
/code/branches/core3:1572-1739
/code/branches/core4:3221-3224,3227,3234-3238,3242,3244-3250,3252-3254,3256,3259-3261,3264-3265,3268-3275,3277-3278,3280,3284-3285,3287,3289-3294,3305,3309-3310
/code/branches/core5:5768-5928,6009
/code/branches/gametypes:2826-3031
/code/branches/gcc43:1580
/code/branches/gui:1635-1723,2795-2894
/code/branches/ingamemenu:6000-6023
/code/branches/input:1629-1636
/code/branches/libraries:5612-5692
/code/branches/libraries2:5703-5737
/code/branches/lodfinal:2372-2411
/code/branches/map:2801-3086,3089
/code/branches/menu:5941-6146,6148
/code/branches/miniprojects:2754-2824
/code/branches/netp2:2835-2988
/code/branches/netp3:2988-3082
/code/branches/netp6:3214-3302
/code/branches/network:2356
/code/branches/network64:2210-2355
/code/branches/objecthierarchy:1911-2085,2100,2110-2169
/code/branches/objecthierarchy2:2171-2479
/code/branches/overlay:2117-2385
/code/branches/particles:2829-3085
/code/branches/particles2:6050-6106,6109
/code/branches/pch:3113-3194
/code/branches/physics:1912-2055,2107-2439
/code/branches/physics_merge:2436-2457
/code/branches/pickups:1926-2086,2127,2827-2915
/code/branches/pickups2:2107-2497,2915-3071
/code/branches/presentation:2369-2652,2654-2660
/code/branches/presentation2:6106-6416
/code/branches/questsystem:1894-2088
/code/branches/questsystem2:2107-2259
/code/branches/questsystem5:2776-2905
/code/branches/resource:3327-3366
/code/branches/resource2:3372-5694
/code/branches/script_trigger:1295-1953,1955
/code/branches/sound:2829-3010
/code/branches/sound3:5941-6102
/code/branches/steering:5949-6091
/code/branches/tutorial:5765-5841
/code/branches/weapon:1925-2094
/code/branches/weapon2:2107-2488
/code/branches/weapons:2897-3051
/code/branches/weaponsystem:2742-2890

Modified: code/branches/tutorial/data/levels/tutorial.oxw
===================================================================
--- code/branches/tutorial/data/levels/tutorial.oxw	2010-03-07 22:16:54 UTC (rev 6486)
+++ code/branches/tutorial/data/levels/tutorial.oxw	2010-03-07 22:27:20 UTC (rev 6487)
@@ -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	2010-03-07 22:16:54 UTC (rev 6486)
+++ code/branches/tutorial/src/orxonox/controllers/DroneController.cc	2010-03-07 22:27:20 UTC (rev 6487)
@@ -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	2010-03-07 22:16:54 UTC (rev 6486)
+++ code/branches/tutorial/src/orxonox/worldentities/Drone.cc	2010-03-07 22:27:20 UTC (rev 6487)
@@ -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	2010-03-07 22:16:54 UTC (rev 6486)
+++ code/branches/tutorial/src/orxonox/worldentities/Drone.h	2010-03-07 22:27:20 UTC (rev 6487)
@@ -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