From: <ob...@us...> - 2006-06-17 21:50:48
|
Revision: 24641 Author: obi666 Date: 2006-06-17 14:50:34 -0700 (Sat, 17 Jun 2006) ViewCVS: http://svn.sourceforge.net/crystal/?rev=24641&view=rev Log Message: ----------- - Piotr Obrzut fixed phystut "crash on exit" problem (when running with bullet plugin) Modified Paths: -------------- CS/trunk/docs/history.txt CS/trunk/plugins/physics/bullet/bullet.cpp Modified: CS/trunk/docs/history.txt =================================================================== --- CS/trunk/docs/history.txt 2006-06-17 20:25:16 UTC (rev 24640) +++ CS/trunk/docs/history.txt 2006-06-17 21:50:34 UTC (rev 24641) @@ -6,6 +6,9 @@ individual changes for each given day, however, are in normal (ascending) chronological order. +17-Jun-2006 + - Piotr Obrzut fixed phystut crash on exit problem (when running + with bullet plugin) 16-Jun-2006 - AndyDude fixed the MacOSX menu bug and launching in background bug. - AndyDude changed the non-error CoreAudio messages to be not so Modified: CS/trunk/plugins/physics/bullet/bullet.cpp =================================================================== --- CS/trunk/plugins/physics/bullet/bullet.cpp 2006-06-17 20:25:16 UTC (rev 24640) +++ CS/trunk/plugins/physics/bullet/bullet.cpp 2006-06-17 21:50:34 UTC (rev 24641) @@ -107,7 +107,6 @@ csBulletDynamicsSystem::csBulletDynamicsSystem () : scfImplementationType (this) { - ConstraintSolver* solver = new SimpleConstraintSolver; CollisionDispatcher* dispatcher = new CollisionDispatcher (); BroadphaseInterface* broadphase = new SimpleBroadphase(); @@ -115,6 +114,8 @@ } csBulletDynamicsSystem::~csBulletDynamicsSystem () { + bodies.DeleteAll (); + delete bullet_sys; } void csBulletDynamicsSystem::SetGravity (const csVector3& v) { @@ -270,6 +271,7 @@ ccdObjectCi.m_collisionShape->SetMargin (1); ccdObjectCi.m_gravity = SimdVector3(0,0,0); ccdObjectCi.m_localInertiaTensor = SimdVector3(0,0,0); + ccdObjectCi.m_physicsEnv = dynsys->GetBulletSys (); mass = ccdObjectCi.m_mass = 1; ccdObjectCi.m_MotionState = ms; @@ -320,7 +322,6 @@ if (pc->GetCollisionShape ()->GetShapeType () != EMPTY_SHAPE_PROXYTYPE) { BroadphaseProxy* bpproxy = (BroadphaseProxy*)pc->GetRigidBody ()->m_broadphaseHandle; - //bpproxy->SetClientObjectType(pc->GetRigidBody()->GetCollisionShape()->GetShapeType()); ds->GetBulletSys ()->GetBroadphase()->CleanProxyFromPairs(bpproxy); SimdVector3 newinertia; @@ -355,8 +356,8 @@ const csOrthoTransform& trans, float friction, float density, float elasticity, float softness) { - if (pc->GetRigidBody ()->GetCollisionShape ()) - delete pc->GetCollisionShape (); + //if (pc->GetRigidBody ()->GetCollisionShape ()) + // delete pc->GetCollisionShape (); SimdVector3 s (size.x / 2, size.y / 2, size.z / 2); pc->GetRigidBody ()->SetCollisionShape (new BoxShape (s)); @@ -678,9 +679,7 @@ } void csBulletCollider::ResetShape () { - BroadphaseProxy* bpproxy = (BroadphaseProxy*)pc->GetRigidBody ()->m_broadphaseHandle; - //bpproxy->SetClientObjectType(pc->GetRigidBody()->GetCollisionShape()->GetShapeType()); ds->GetBulletSys ()->GetBroadphase()->CleanProxyFromPairs(bpproxy); SimdVector3 newinertia; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |