Checking surface support in Bullet (Havok's checkSupport)

Please don't post Bullet support questions here, use the above forums instead.
yuyu
Posts: 4
Joined: Wed Jul 29, 2009 1:22 pm

Checking surface support in Bullet (Havok's checkSupport)

Post by yuyu »

Hi,

I am very new to both Bullet and Havok and I'm helping in an effort to switch from Havok to Bullet. We are trying to find the equivalent of Havok's features in Bullet and use them in our engine.

Right now, I am stuck finding how to check for surface support in Bullet. In Havok, we check what surfaces a character has contact with and if it is supported, unsupported or sliding in a given direction.

In Bullet, I am not quite sure what type of body is most appropriate to do this. btKinematicCharacterController looks promising, but a look at the code with a few features on the todo list, I decided to go with a rigid body.

So far, it looks like predictIntegratedTransform() might help in deciding in what direction the body will move (while setting its current velocity to zero?), and therefore if it is supported in a given direction. However, I am still not sure of this kind of approach and so far it has been difficult to find the information I'm looking for.

I was wondering if anyone had to deal with this issue before, and if so, if I'm on the right track or not. Or maybe there is a very simple way to do this, and I am completely missing the point? :-p

Thanks.
yuyu
Posts: 4
Joined: Wed Jul 29, 2009 1:22 pm

Re: Checking surface support in Bullet (Havok's checkSupport)

Post by yuyu »

It seems that the predictIntegratedTransform() will simply use the current velocity and position linearly to infer the position at a later time (x = vt+x0)... This can differ greatly from the real position given the forces and constraints on the body. An of course, if I set the body's initial velocity to zero, it won't even move...

Is there a way to accurately compute in which direction a btRigidBody will move next (taking everything into account)?

I also looked at the simplex solver demo but I am not quite sure if/how it could apply to my problem.

Regards.
Dirk Gregorius
Posts: 861
Joined: Sun Jul 03, 2005 4:06 pm
Location: Kirkland, WA

Re: Checking surface support in Bullet (Havok's checkSupport)

Post by Dirk Gregorius »

I think the Simplex Solver Demo in Bullet is related to GJK while the simplex solver in Havok is used with the character controller and something totally different.
Johan Gidlund
Posts: 26
Joined: Mon Jun 01, 2009 2:21 pm
Location: Sweden

Re: Checking surface support in Bullet (Havok's checkSupport)

Post by Johan Gidlund »

Unless I remember incorrectly checkSupport in Havok simply checks the contact manifold to see if you are currently in contact with any objects.

I have never worked with Bullet but I am quite sure they have some methods to get this information for a given rigid body and set the correct state given if there are contact points or not.
You might want to check contact normals as well since you should typically not be supported by contacts above you and if the "contact slope" is too steep I guess you want to put the character into sliding.