Jump to content
• Advertisement

#### Archived

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

# AABB collision sliding

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

i''have some problem when my AABB collide with some polygons.I don''t succeed the exact distance between AABB and polygon for make sliding effect (like quake3).someone know the exact way to make right distance for sliding effect??? i''he read this paper "Fly3DCollisionDetection". thanks in advantage. (sorry for my english)

#### Share this post

##### Share on other sites
Advertisement

I solved the problem by using the smooth vertex normals as the plane of collision. So, for an edge-AABBox collision, instead of having the edge hitting the box dead-on and catch the edge, I linearly interpolate the two vertex normals of the edge, find the normal at the point of collision, and use that to make the plane of collision.

Alternatively, you can use an algo similar to a phong-shading, and linearly interpolate the normal all the way accross the triangle. That should give you a smooth surface, but maybe too smooth. Just using that on the edges did the trick for me. And obviously, it counts also for the triangle corners.

                                   ^              \              ncoll |        /               \                   |       /                \                  |      /                 +-----------------*-----+                                 pcoll

If you use dynamic collison detection (using velocity or displacement between frames), this should also help you get a good sliding effect.

http://www.gamedev.net/community/forums/topic.asp?topic_id=166540

a note, to get the point of collision on the box, I had to ''raytrace'' inside the box, along the normal of collision down te normal of collision.

And for your information, Quake uses a BSP tree, which takes away the pain of dealing with edges and corners. You might want to investigate that. Look at Stan Melax and ''Dynamic Plane Shifting'' on Google.

#### Share this post

##### Share on other sites
thanks for your reply.

my problem is when my AABB collide with a point of any polygons.
my distance isn''t correct,and after few recursions my AABB doesn''t collide with a point.

#### Share this post

##### Share on other sites

• Advertisement

### Announcements

• Advertisement

• ### Popular Now

• 10
• 16
• 9
• 13
• 41
• Advertisement
• 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!