Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 30, 2009, 1:21:07 PM (15 years ago)
Author:
dafrick
Message:

Removed the code, the PPS students have to insert.

Location:
code/branches/tutorial
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/tutorial/data/levels/tutorial.oxw

    r5786 r5841  
    1313   skybox       = "Orxonox/skypanoramagen1"
    1414  >
    15 
    16 <Drone name="meineDrohne" position="0,0,-10" primarythrust="80" auxilarythrust="10" rotationthrust="10" mass= "50" linearDamping = "0.9" angularDamping = "0.7">
    17   <attached>
    18     <Model scale="10" mesh="drone.mesh"/>
    19   </attached>
    20   <collisionShapes>
    21     <BoxCollisionShape position="0,0,0"      halfExtents="10, 10, 10" />
    22   </collisionShapes>
    23 </Drone>
    24 
    2515
    2616    <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" />
  • code/branches/tutorial/src/orxonox/controllers/DroneController.cc

    r5833 r5841  
    4343        // - make sure to register the object in the factory
    4444        // - do any kind of initialisation
    45         RegisterObject(DroneController);
    4645       
    4746        // this checks that our creator really is a drone
     
    6564        // Place your code here:
    6665        // - steering commands
    67         static float totaltime = 0;
    68         totaltime += dt;
    6966        Drone *myDrone = static_cast<Drone*>(this->getControllableEntity());
    70         if(totaltime<100)
    71         {
    72             myDrone->moveFrontBack( -sqrt(dt) );
    73             myDrone->rotatePitch(-dt);
    74         }
     67        // you can use the following commands for steering
     68        // - moveFrontBack, moveRightLeft, moveUpDown
     69        // - rotatePitch, rotateYaw, rotateRoll
     70        // - apply the to myDrone (e.g. myDrone->rotateYaw(..) )
     71
    7572    }
    7673}
  • code/branches/tutorial/src/orxonox/worldentities/Drone.cc

    r5835 r5841  
    3636    // put your code in here:
    3737    // create the factory for the drone
    38     CreateFactory(Drone);
    3938
    4039    /**
     
    4645        // put your code in here:
    4746        // - register the drone class to the core
    48         // - create a new controller and pass our this pointer to it as creator
    4947        this->myController_ = 0;
    50         RegisterObject(Drone);
    5148       
    5249        this->localLinearAcceleration_.setValue(0, 0, 0);
     
    5855        this->setCollisionType(WorldEntity::Dynamic);
    5956       
    60         myController_ = new DroneController(static_cast<BaseObject*>(this));
     57        myController_ = new DroneController(static_cast<BaseObject*>(this)); //!< Creates a new controller and passes our this pointer to it as creator.
    6158    }
    6259
     
    8077        SUPER(Drone, XMLPort, xmlelement, mode);
    8178
    82         XMLPortParam(Drone, "primaryThrust",  setPrimaryThrust, getPrimaryThrust,  xmlelement, mode);
    83         XMLPortParam(Drone, "auxilaryThrust", setAuxilaryThrust, getAuxilaryThrust, xmlelement, mode);
    84         XMLPortParam(Drone, "rotationThrust", setRotationThrust, getRotationThrust, xmlelement, mode);
     79        // put your code in here:
     80        // make sure you add the variables primaryThrust_, auxilaryThrust_ and rotationThrust_ to xmlport
     81        // make sure that the set- and get-functions exist.
     82        // variables can be added by the following command
     83        // XMLPortParam(Classname, "xml-attribute-name (i.e. variablename)", setFunction, getFunction, xmlelement, mode)
     84 
    8585    }
    8686
  • code/branches/tutorial/src/orxonox/worldentities/Drone.h

    r5840 r5841  
    105105            */
    106106            inline void setPrimaryThrust( float thrust )
    107                 { this->primaryThrust_=thrust; }           
    108             inline void setAuxilaryThrust( float thrust )
    109                 { this->auxilaryThrust_=thrust; }
    110             inline void setRotationThrust( float thrust )
    111                 { this->rotationThrust_=thrust; }
     107                { this->primaryThrust_=thrust; }     
     108            // place your set-functions here.
     109            // - hint: auxiliary thrust, rotation thrust.
    112110           
    113111            /**
     
    117115            inline float getPrimaryThrust()
    118116                { return this->primaryThrust_; }
    119             inline float getAuxilaryThrust()
    120                 { return this->auxilaryThrust_; }
    121             inline float getRotationThrust()
    122                 { return this->rotationThrust_; }
     117            // place your get-functions here.
    123118           
    124119        private:
Note: See TracChangeset for help on using the changeset viewer.