Soft bodies & terrain collision?

isidoryphore
Posts: 1
Joined: Thu Aug 14, 2008 6:50 pm

Soft bodies & terrain collision?

Post by isidoryphore »

Hello everybody!

I am new to bullet and, having tried a few things out, got stuck at the point where I am trying to place a soft body (an ellipsoid) on a terrain object (btHeightfieldTerrainShape).

First thing, it crashes in "btSoftBodyConcaveCollisionAlgorithm.cpp" because of the line:

Code: Select all

shapeCache[partId][triangleIndex] = tm;
It seems partId is an index of the terrain grid (between 0 and 128 in my test application)

shapeCache is a static initialised as so:

Code: Select all

static const int maxParts = 1;
static const int maxTriangleIndex = 100*100;
btCollisionShape* shapeCache[maxParts][maxTriangleIndex];
I've then tried setting maxParts to 128: this solves the crash, but the ellipsoid goes through the terrain.

Has anybody managed to have terrain/soft-body collision working?

Thanks in advance for any information,

Isi

PS: I've tested this in bullet 2.69.and 2.70. What I've done is basically mix the ccd, soft body and car demo: collision between soft & rigid bodies works fine, it's just with the terrain that it goes wrong =/


Edited: I'm still investigating the problem. Interestingly, the collision works fine when disabling this shape cache.