class Texture
{
public:
+ //Material: (ambient, point, directional, glossyness)
static Texture* newTImage(const std::string& path, const vec4& material);
static void deleteTImage(const unsigned int handle);
int numContacts = _contactManifold->getNumContacts();
//For each contact point in that manifold
- double pdist = (_contactManifold->getContactPoint(0).getDistance());
+ float pdist = (_contactManifold->getContactPoint(0).getDistance());
btVector3 ptN = (_contactManifold->getContactPoint(0).m_normalWorldOnB);;
for (int j = 0; j < numContacts; j++) {
//Get the contact information
pdist = pt.getDistance();
ptN = pt.m_normalWorldOnB;
}
-
+
}
- if (ptN.getY() >= .4f)
+ vec3 normal = vec3(ptN.getX(), ptN.getY(), ptN.getZ());
+
+ if (normal[1] >= .4f && pdist > -1)
{
_other->ySpeed = 5;
//BOAR DIE!!!
- return;
+ alive = false;
+
+ _other->move(-pdist * (float).5 * vec3(0.f, normal[1], 0.f));
+ }
+
+
+ if (normal[1] <= .3f && pdist<0 && pdist > -1)
+ {
+ _other->move(-pdist * (float).5 * vec3(normal[0], 0.f, normal[2]));
+ _other->move_delta = 0;
}
- if (pdist >= .0f)
+ if (pdist >= .0f || !alive)
return;
Message::info("Spiel Verloren!->" + std::to_string(pdist));
return (stat(name.c_str(), &buffer) == 0);
}
-
+//Material: (ambient, point, directional, glossyness)
SceneObject::SceneObject(const mat4& _modelMat, const vec4& _material, string _modelpath, string texturepath) :
model(nullptr),
collision(nullptr),