partial_movement.cpp
Go to the documentation of this file.
00001 
00027 #include "sr_movements/partial_movement.hpp"
00028 
00029 namespace shadowrobot
00030 {
00031   PartialMovement::PartialMovement()
00032   {}
00033 
00034   PartialMovement::~PartialMovement()
00035   {}
00036 
00037   double PartialMovement::get_target(double percentage)
00038   {
00039     if( percentage < 0.0)
00040       percentage = 0.0;
00041     if( percentage > 1.0)
00042       percentage = 1.0;
00043 
00044     int index = static_cast<int>( steps.size() * static_cast<double>(percentage) );
00045     return steps[index];
00046   }
00047 }
00048 
00049 /* For the emacs weenies in the crowd.
00050 Local Variables:
00051    c-basic-offset: 2
00052 End:
00053 */
00054 


sr_movements
Author(s): Ugo Cupcic / ugo@shadowrobot.com
autogenerated on Mon Oct 6 2014 07:51:08