Improved BulletSoftBody serialization, added cluster support. Joints and copying data from GPU back to softbody are the main todo.

Updated the Bullet/Demos/SerializeDemo to load .bullet files with the softbody data.

BulletSoftBody should use getWorldTransform and not getInterpolationWorldTransform
Fix btBulletWorldImporter so that it creates a copy of the index/vertex data, this prevents crashes when deleting the .bullet file with triangle meshes.
This commit is contained in:
erwin.coumans
2010-12-03 03:11:21 +00:00
parent 032c6bfe2c
commit 6173a30bce
9 changed files with 964 additions and 472 deletions

View File

@@ -52,8 +52,8 @@ static btRigidBody* staticBody = 0;
static float waveheight = 5.f;
const float TRIANGLE_SIZE=8.f;
#define DEMO_MODE_TIMEOUT 500.f
unsigned current_demo=23;
#define DEMO_MODE_TIMEOUT 15.f //15 seconds for each demo
#ifdef _DEBUG
@@ -768,6 +768,7 @@ static void Init_Torus(SoftDemo* pdemo)
psb->setTotalMass(50,true);
pdemo->getSoftDynamicsWorld()->addSoftBody(psb);
pdemo->m_cutting=true;
}
@@ -1255,7 +1256,7 @@ static void Init_TetraCube(SoftDemo* pdemo)
unsigned current_demo=19;
/* Init */
void (*demofncs[])(SoftDemo*)=
@@ -1329,10 +1330,6 @@ void SoftDemo::clientResetScene()
delete obj;
}
m_softBodyWorldInfo.m_sparsesdf.Reset();
current_demo=current_demo%(sizeof(demofncs)/sizeof(demofncs[0]));
//create ground object
btTransform tr;
@@ -1352,6 +1349,13 @@ void SoftDemo::clientResetScene()
m_dynamicsWorld->addCollisionObject(newOb);
m_softBodyWorldInfo.m_sparsesdf.Reset();
current_demo=current_demo%(sizeof(demofncs)/sizeof(demofncs[0]));
motorcontrol.goal = 0;
motorcontrol.maxtorque = 0;