Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

BlueChip

advice about a specific collision.

This topic is 5583 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

Hi folk... when I''ve need of a perfect collision between a bounding box and a triangle, I use 8 times a ray/plane collision. This way is too much slow.... can you give me a better idea? thanks ;-)

Share this post


Link to post
Share on other sites
Advertisement
Use the velocity of the triangle as the ray. Then dot product this ray against the normals of each face of the box. if the result is <= 0, then the face is either facing away or parallel to the ray, and thus can''t be in collision. this should limit u to at most testing 1 ray versus 3 faces.

Share this post


Link to post
Share on other sites
ok.... thank you MelvinElvin.
but in this way I would have to apply the velocity in all three vertices of triangle.... doing 3*3 = 9 checks... and however the test could not be right , because the box could to be in the center of the triangle.

Am I in mistake?

[edited by - BlueChip on August 8, 2003 11:28:59 AM]

Share this post


Link to post
Share on other sites
just give your triangle 1 velocity, not each vertex of the triangle. Yes, the test does not work if objects start off inside each other. This is the most common way of doing collision detection though. The fact it fails if something is inside another thing is just something u have to live with and work around, unless you use another technique for colliding of course.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!