[solved]character controller ghostObject falls through level

Post Reply
eagletree
Posts: 28
Joined: Sun Jul 31, 2011 11:20 pm

[solved]character controller ghostObject falls through level

Post by eagletree » Sun Aug 14, 2011 2:03 pm

In this case, the "level" is a btBvhTriangleMeshShape created from a btTriangleIndexVertexArray I created using code Erwin had posted. This "level" is a static rigidbody. The triangles are large in my opinion, about 30 times the character width. Character (ghostObject) is 1 unit wide, 2 high in capsule shape. I don't have the production models and levels yet and have been incorporating bullet in our irrlicht based game while waiting.

I'm using a kinematic character controller and have it working well with one exception. The character falls through occasionally. My test has one dynamic and one static object both of which collide well with the ghostObject. The character can walk all over the level, up and down hills and out to the edges, but will suddenly fall through, not during a jump or moving quickly. I did a day of testing to collect coordinates and found nothing interesting such as sinking at the Y axis.

It seems to be easier to reproduce at vertex points but, it seemed to occur while I was avoiding them (using debugDraw). I'm at a loss. Do I have a faulty level, am I conceptually wrong in attempting to use this triangle mesh as a test level, or is there something else to look at with this scenario?

Edit: I won't call this solved because I haven't a solution, but from what I've read, this is likely a bad mesh. I created it myself and am nowhere near a modeler, it's a simple place holder so I could continue with development. Blender is more difficult than bullet even with millions of tutorials ;)). The things I've found in blogs and such, suggest it's duplicated vertices. I would still be interested in opinions if anyone cares to venture one.

Edit 2: Though I suspect it is the level, a workaround was suggested by SteveDefacto. This was to use:

Code: Select all

World->getDispatchInfo().m_allowedCcdPenetration = 0.0001f;
which I placed after my initialization. After this, testing showed no more of the tendency to fall through at triangle junctions. I could still penetrate the level by going to places the character was not supposed to be, and jumping off a cliff. There are threads that address this so I think it's a different issue.

Post Reply