I am able to reproduce a hard to find bug where a sphere placed several units above the terrain will fall through the terrain. Here is some of my code:
for(i=0;i<20;++i) { CSphere *pSphere = new CSphere; pSphere->SetMass(0.5f,0.05f); pSphere->SetFlags(ePhysical); D3DXVECTOR3 v(rand() % 201 - 100,0,rand() % 201 - 100); D3DXVec3Normalize(&v,&v); v /= 2; pSphere->SetPosition( (rand() % 150)/100.0f + .2f, // Remove .2f and the first ball goes through the terrain (rand() % 100)/100.0f + 1.5f + fBaseHeight, (rand() % 150)/100.0f); g_Spheres.AddInstance(pSphere); }
The point of this code illustration is to emphasize that all the balls are created exactly the same.
The first ball falls through, the other 19 are fine. I have tried adding as many as 50 balls and all of them behave except the first. I say it is hard to reproduce because even cutting and pasting the initial positions from the rand() from my debug window does not cause the error.
It appears it depends on some strange numerical conditions, but I am able to reliably reproduce the problem. I am using [ode-src-0.8-rc1.zip] built in VC2005 (no Service pack installed).
If anyone wants to look into this I can provide you with more details and the dataset.