Advertisement

Capsule vs AABB and OBB intersection

Started by September 21, 2014 03:16 PM
2 comments, last by Arbitror 10 years, 5 months ago

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.

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.

Advertisement

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

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.

My current game project Platform RPG

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

This topic is closed to new replies.

Advertisement