btCollisionObject and btGhostObject not colliding

dvorgaz
Posts: 1
Joined: Fri Jan 02, 2009 11:28 pm

btCollisionObject and btGhostObject not colliding

Post by dvorgaz »

Hello

I tried to make something similar to the kinematic character demo, but without the dynamic stuff, using only a CollisionWorld (using only bullets collision library); the problem is, it doesn't seem to detect collision between the static objects and the ghost object.

What I did was I created a btCollisionWorld, added a couple of btCollisionObjects (.bsp brushes converted to convex hulls), set their filters, so they don't collide with each other. Then I added a ghost object with a capsule shape, coupled with a controller class (similar to the kinemaitc character controller), set its filters so it collides with the brushes. In every frame I call the collisionWorld.PerformDiscreteCollisionDetection() and then do a convex sweep test with the ghost to determine if I can move it all the way to its destination (this part is basicly the same as the StepForwardAndStarfe() in the character demo, without the sliding part), but there is never a collision (callback.hasHit() is always false). I checked out in the debugger, the ghost does move around whith the camera in game, yet it doesn't collide with anything.

Do I have to call something else between the PerformDiscreteCollisionDetection() and the convexSweepTest() for it to work or something?