void Boar::update(float _deltaT)
{
- SceneObject::update(_deltaT);
+//Fallen
+ if (!yStatic)
+ {
+ if (yFloorDist>0)
+ {
+ if (ySpeed*_deltaT < yFloorDist || ySpeed>0)
+ move(vec3(0.f, ySpeed*_deltaT, 0.f));
+ else
+ {
+ move(vec3(0.f, yFloorDist, 0.f));
+ // ySpeed = 0; //set to FloorSpeed?
+ }
+ if (_deltaT > 0)
+ {
+ ySpeed -= _deltaT*YFALL_SPEED;
+ }
+ }
+
+ }
+
+ updateAnimation(_deltaT);
+
+ btTransform tmp;
+
+ if(!alive)
+ tmp.setFromOpenGLMatrix(value_ptr(translate(vec3(0.f, .3f, 0.f))*modelMat));
+ else
+ tmp.setFromOpenGLMatrix(value_ptr(modelMat));
+ bt_collision_object->setWorldTransform(tmp);
+ yFloorDist = 100;
if (activated)
{
using std::string;
-#define YFALL_SPEED 9.8f
-
static inline bool file_exist(const std::string& name) {
struct stat buffer;
return (stat(name.c_str(), &buffer) == 0);