Jump to content
  • Advertisement
Sign in to follow this  

Shape casting a capsule against a convex polyhedra

This topic is 2464 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Let's say I have a upright capsule shape (swept sphere) that I would like to cast it along a velocity vector. I would like to be able to find the point of contact and a surface normal for any convex shapes it would intersect along this path. I would also like to find the distance the swept caspule traveled to the point of first contact.

Heres a quick diagram of a capsule being casted against a large convex polyhedra (only one face is drawn) 3ouuf.png

What kind of algorithm or process could do this? I assume it would be similar to a sphere-cast, but i can't find much on that either.

Share this post


Link to post
Share on other sites
Advertisement
You'll need to google for Minkowski Difference.

In short the convex shape grows by the shape of capsule, and the capsule shrinks to a single point at the origin, then the test simplifies to a point vs convex object test.

If you want time of intersection, you shoot a ray from the origin along the velocity of the object, the point of intersection and normal on the Minkowski Difference are the things you are after :)

You can see how it all works here:

http://www.wildbunny.co.uk/blog/2011/04/20/collision-detection-for-dummies/

:)

Cheers, Paul.


Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!