From 4c5b00221c9405c5af06143974fbc6296ebe46b5 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Mon, 18 Oct 2010 19:13:58 +0000 Subject: local vstrafe support, initial ship collision, g_damping factor --- src/core/zone.cc | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/core/zone.cc') diff --git a/src/core/zone.cc b/src/core/zone.cc index 8a8c056..a38959f 100644 --- a/src/core/zone.cc +++ b/src/core/zone.cc @@ -127,6 +127,7 @@ Zone::Zone(std::string const & label) : Label(label) zone_bullet_cache = new btAxisSweep3(worldAabbMin, worldAabbMax, maxProxies); zone_bullet_world = new btDiscreteDynamicsWorld(Physics::dispatcher(), zone_bullet_cache, Physics::solver(), Physics::configuration()); + zone_bullet_raycaster = new btDefaultVehicleRaycaster(zone_bullet_world); // disable gravity zone_bullet_world->setGravity(btVector3(0.0f, 0.0f, 0.0f)); @@ -151,6 +152,9 @@ Zone::~Zone() zone_content.clear(); + if (zone_bullet_raycaster) + delete zone_bullet_raycaster; + if (zone_bullet_world) delete zone_bullet_world; @@ -172,19 +176,12 @@ void Zone::print() void Zone::add(Entity *entity) { zone_content.push_back(entity); - if (physics() && entity->body()) { - physics()->addRigidBody(entity->body()); - entity->reset(); - } } void Zone::remove(Entity *entity) { for (Content::iterator it = zone_content.begin(); it != zone_content.end(); it++) { if ((*it) == entity) { - if (physics() && entity->body()) { - physics()->removeRigidBody(entity->body()); - } zone_content.erase(it); return; } -- cgit v1.2.3