Kinematic / Character manifold collision points [SOLVED-ish]

Post Reply
User avatar
Octavius_Ace
Posts: 20
Joined: Sat Jun 04, 2016 10:34 pm
Location: Edinburgh

Kinematic / Character manifold collision points [SOLVED-ish]

Post by Octavius_Ace »

Hi,
I have a Kinematic platform (box) object and a btKinematicCharacterController object, both of which I can move around under user control.

If I move the character object so it collides with the stationary platform, the "recoverFromPenetration" function in the btKinematicCharacterController class handles the overlapping pair correctly and finds one contact point in the character/platform's overlapping pair manifold. The penetration recovery works as expected and the character steps up onto the platform and rests on its upper surface.

However, if the kinematic platform is moving and collides with the character, the character becomes embedded in the platform. This happens irrespective of whether the character is moving or stationary.

Looking into the "recoverFromPenetration" function in this second failing scenario, I see that the overlapping platform/character pair is being detected but that there are no contact points in the associated manifold and so no penetration recovery takes place.

I wondered if the problem related to collision groups, masks or collision object collision flags but trying different combinations, doesn't seem to affect things.

Looking through the forum, I see that folk sometimes mistakenly omit the step:

Code: Select all

physicsBroadphase->getOverlappingPairCache()->setInternalGhostPairCallback(new btGhostPairCallback());
In my case, this is being done immediately following creation of the btDiscreteDynamicsWorld.

I'm aware that the btKinematicCharacterController class is regarded as a little flaky but this issue seems to relate to straightforward collision detection rather than issues with the character controller itself.

Any ideas on where to focus my bug hunting would be much appreciated.

As an aside, how do the collision filter groups/masks relate to/interact with the collision object's collision flags?
As an example, btCollisionObject::CF_KINEMATIC_OBJECT = 2 whereas btBroadphaseProxy::KinematicFilter = 4, so I assume these don't interact, but I'm unclear on what the collision flag is used for.

Cheers.
Last edited by Octavius_Ace on Sun Jul 24, 2016 4:13 pm, edited 1 time in total.
User avatar
Octavius_Ace
Posts: 20
Joined: Sat Jun 04, 2016 10:34 pm
Location: Edinburgh

Re: Kinematic / Character manifold collision points

Post by Octavius_Ace »

Hi,
a lot of views for this question but no responses, so I'm not sure if there's a lack of specific detail or the post is too wordy. It might help if I re-phrase and simplify the question:

What could cause Bullet to report overlapping pairs with an empty manifold, when a ghost object collides with a kinematic object ?
In my case:
A moving ghost object colliding with a stationary kinematic object, reports overlapping pair and contacts.
A stationary ghost object colliding with moving a kinematic object, reports overlapping pair but no contacts.

Thanks.
User avatar
Octavius_Ace
Posts: 20
Joined: Sat Jun 04, 2016 10:34 pm
Location: Edinburgh

Re: Kinematic / Character manifold collision points [SOLVED-

Post by Octavius_Ace »

Hi,
I'm not sure my resolution to this will help anyone else but as I've inadvertently managed to fix the problem, I'll detail what I did.

To debug the narrow phase collision detection, I replaced the shared Bullet libs I was using (v2.8.3), with what I thought was the same version of BulletCollision, BulletDynamics and LinearMath(s) source in my Eclipse IDE project.

An unexpected side-effect of this, was to fix the empty manifold issue I was having when colliding a moving Kinematic object and a stationary Character ghost object.

As my character controller is a modified version of the Bullet one, this hasn't been changed by adding the Bullet source to my project.

So I assume one of two things has happened:
1) The source code I used in place of the libs was a slightly older version and this behaved better than the latest v2 version. Unfortunately, I have several historic copies of Bullet lying around and am not sure which I've used as source code. (probably a v2.8.n)

2) Different code was generated by the preprocessor within my IDE (based on different "define" attributes)


If I isolate the Bullet version where the behaviour changed, I'll post a final comment on this thread.

Cheers.
Post Reply