# Capsule vs AABB and OBB intersection

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

## Recommended Posts

Hi there,

I am struggling with my implementation of a Capsule surrounding the character and collisions versus AABBs and OBBs.

The problem I have, that I cannot figure out how to deal with this.

I already implemented Capsule vs Sphere which is quite easy (Point vs Segment). But vs a Box I do not have a constant value like the radius.

What I did so far:

- find the nearest point on the segment to the center of the box (dunno if this is useful at all)

- detect collision (which is more or less just a box vs box test)

- I thought about Seperating Axis Theorem, but doesn't it only work on boxes or not round objects?

Hoping for a push in the right direction :)

Thanks.

##### Share on other sites

Haha I don't know why, but after posting this I cam up with a solution :)

I first find the nearest point on the segment from there I treat the check like a sphere vs box collision.

##### Share on other sites

Haha I don't know why, but after posting this I cam up with a solution

I first find the nearest point on the segment from there I treat the check like a sphere vs box collision.

That happens to me sometimes. There must be something about explaining the problem that helps you find the solution.

##### Share on other sites

Actually it's pretty common once explaining a bug you find the solution.

http://en.wikipedia.org/wiki/Rubber_duck_debugging or otherwise known as the teddy bear approach

1. 1
2. 2
Rutin
18
3. 3
4. 4
5. 5

• 26
• 11
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633701
• Total Posts
3013443
×