Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2010-10-18 19:13:58 +0000
committerStijn Buys <ingar@osirion.org>2010-10-18 19:13:58 +0000
commit4c5b00221c9405c5af06143974fbc6296ebe46b5 (patch)
tree3bbe7fbc47f6238a086260c56964d2d654cf6124 /src/core/zone.cc
parent85e3fd447aa3f45ba1dfe063b29a3e13f3416f11 (diff)
local vstrafe support, initial ship collision, g_damping factor
Diffstat (limited to 'src/core/zone.cc')
-rw-r--r--src/core/zone.cc11
1 files changed, 4 insertions, 7 deletions
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;
}