Cloth and arbitrary objects collisions

Please don't post Bullet support questions here, use the above forums instead.
frontiervision
Posts: 5
Joined: Sun Aug 02, 2009 10:39 pm

Cloth and arbitrary objects collisions

Post by frontiervision »

Hi,

i am new to Bullet Physics programming. I would like to implement cloth/3d mesh collision, but i am having a problem.

You can see what is happening here : http://img90.imageshack.us/img90/963/clothproblem2.jpg

The green cloth fall on the gray object, but it pass through it...
I am using the softbody demo source code. I would like to avoid this...

I create the rigid mesh (the gray object) in this way:

int numt, numv;
numt = sizeof(objFacedata)/sizeof(int);
numv = sizeof(objVertexdata)/sizeof(float);
btTriangleIndexVertexArray* indexVertexArrays = new btTriangleIndexVertexArray(numt/3,
(int *)objFacedata,
3*sizeof(int),
numv/3,
(btScalar*) objVertexdata,
3*sizeof(float));

// This is the shape of the object used for collision detection
btGImpactMeshShape *trimesh = new btGImpactMeshShape( indexVertexArrays );
trimesh->setLocalScaling(btVector3(.10f,.10f,.10f));
//trimesh->setMargin(0.07f);
trimesh->updateBound();

Than, i add the rigid body in the world in this way:


btTransform startTransform;
startTransform.setIdentity();
startTransform.setOrigin(btVector3(0,-5,0));
pdemo->localCreateRigidBody(10, startTransform, trimesh);



Maybe i need to setup some collision flag for the softbody/rigid body collision?
The more accurate the collision between the two objects the more happy i will be!!!

Any idea????

Thanks