Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

acceleration.cc

Go to the documentation of this file.
00001 #include "acceleration.hh"
00002 #include "register.hh"
00003 #include "abstractworld.hh"
00004 
00005 namespace anoid {
00006     namespace plugin {
00007 
00008         using namespace simple;
00009         using namespace config;
00010 
00011         void Acceleration::init(Configuration &c) {
00012             acceleration = c.getVector("acceleration");
00013             Velocity::init(c);
00014             registerName("Acceleration");
00015         }
00016 
00017         Vector Acceleration::getAcceleration() {
00018             return acceleration;
00019         }
00020 
00021         void Acceleration::setAcceleration(Vector &a) {
00022             acceleration = a;
00023         }
00024 
00025         void Acceleration::update() {
00026             velocity += getWorld()->getTime() * acceleration;
00027             Velocity::update();
00028         }
00029 
00030         Register(Acceleration)
00031 
00032     };
00033 };

Anoid NG © Michael Westergaard, Martin Stig Stissing, Ronni Michael Laursen, and Kristian Bisgaard Lassen