penetration depth using convexSweepTest??

ola
Posts: 169
Joined: Sun Jan 14, 2007 7:56 pm
Location: Norway

penetration depth using convexSweepTest??

Post by ola »

Hi all,

I am looking for a way to get the pentration depth when using convexSweepTest against my collision world.

I use a cylinder test shape. So far I get the contact points and normal vectors on the surface of the objects that my test shape collides with. Now I also need the depth of how far these points are inside my test shape. The actual application of this is "how much is my wheel tyre compressed", so that I can calculate a spring force.

I have looked at using the btGjkEpaPenetrationDepthSolver, as well as doing a rayTestSingle from the collision point along the normal vector to find the distance to the surface of my test shape. Both of these might get a bit complicated, so I'm looking for the recommended way to do this. Maybe there is something in the convexSweepTest that I can re-use, I see that the internal objectQuerySingle sets up a penetration depth solver but cannot see for what exactly it is used.

I also spotted the SVN log entry (r1169) about penetration depth added to convexSweepTest, which sounds like what I need. But I've been unable to figure out how this works...

Very grateful for any help!!

Best regards,
Ola

ps:
Also, if anyone have got hints to a good way of simulating a motorcycle-shaped wheel instead of a cylinder... :-) I haven't had much luck with combining discs and spheres using the btMinkowskiSumShape yet.