src/PhysicsStep.h

Go to the documentation of this file.
00001 #ifndef PHYSICSSTEP_H
00002 #define PHYSICSSTEP_H
00003 
00004 
00005 #include "Animator.h"
00006 #include "Vec3f.h"
00007 #include "defines.h"
00008 
00009 
00014 class PhysicsStep : public Animator
00015 {
00016 public:
00024     PhysicsStep(Object *        obj,
00025                 unsigned int    frame,
00026                 const Vec3f &   v,
00027                 const Vec3f &   w)
00028         : Animator(obj, frame),
00029             mV(v),
00030             mW(w)
00031     {
00032     }
00033 
00039     virtual bool animate(unsigned int frame)
00040     {
00041         if (frame != mFrame)
00042             return false;
00043         LOG("SHOT " << mObject->name() << " v = " << mV << " w = " << mW);
00044         mObject->setVelocity(mV);
00045         mObject->setAngularVelocity(mW);
00046         return true;
00047     }
00048 
00049 protected:
00051     Vec3f   mV;
00052 
00054     Vec3f   mW;
00055 };
00056 
00057 #endif
00058 

Generated on Fri Feb 1 00:01:42 2008 for Grayfall by  doxygen 1.5.1