Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

Integrator.h

Go to the documentation of this file.
00001 #ifndef INTEGRATOR_H
00002 #define INTEGRATOR_H
00003 
00004 #include "Vector2.h"
00005 
00006 class Integrator {
00007 public:
00008    Integrator(real iniDt) : dt(iniDt) {}
00009 
00011    void integrate(real& x, const real& v) const { 
00012         x+=v*dt; 
00013     }
00014    
00015    void integrate(Vector2& x, const Vector2& v) const { 
00016         x.x+=v.x*dt; 
00017         x.y+=v.y*dt; 
00018     }
00019 
00020   real getDt() const {
00021       return dt;
00022   }
00023 
00024    void setDt(real t) {
00025       dt=t;
00026    }
00027 
00028 private:
00029    real dt;
00030 };
00031 
00032 #endif //INTEGRATOR_H

Thyrix homepageUsers' guide

(C) Arxia 2004-2005