why some place the penetration is so deep?

liyu
Posts: 3
Joined: Sat Jun 14, 2008 12:26 am

why some place the penetration is so deep?

Post by liyu »

i have occured a really strange problem, i create a rigid body of player(use convex shape), the ground is a heightfiled shape, most time the simulation is ok, but in some place the penetration is very deep, i do ray test in that place and get the right result, i tried reducing the timestep, but no help. very confused, any hints?

btw, most code orgin from the character controller demo, only not use motion state.
You do not have the required permissions to view the files attached to this post.
liyu
Posts: 3
Joined: Sat Jun 14, 2008 12:26 am

Re: why some place the penetration is so deep?

Post by liyu »

just let you know, I have resolved the problem by using btBvhTriangleMeshShape replace btHeightfieldTerrainShape. so it's maybe a bug in btHeightfieldTerrainShape.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: why some place the penetration is so deep?

Post by Erwin Coumans »

There are several ways of triangulating a heightfield, it has to match the convention you use for rendering. Have you tried different settings for flipQuadEdges and/or setUseDiamondSubdivision?

Have you implemented a debug drawer (derived from btIDebugDraw), to make sure your rendering matches the physics tesselation of the heightfield?

Thanks,
Erwin
liyu
Posts: 3
Joined: Sat Jun 14, 2008 12:26 am

Re: why some place the penetration is so deep?

Post by liyu »

yes, I'm sure the physics and render using the same triangle(i do implement a debug drawer derived from btIDebugDraw), and i can get right height value when using ray test. I tried other shapes (capsulte) on the character but result is same, worth to mention, the impulse resolver seems know about the penetration and tried to push the character up.

hope this can help and thanks for the great library :D
sparkprime
Posts: 508
Joined: Fri May 30, 2008 2:51 am
Location: Ossining, New York

Re: why some place the penetration is so deep?

Post by sparkprime »

you could try chucking some boxes and spheres around to test the ground works ok