# I'm trying to impliment physics using...

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

## Recommended Posts

...This webpage: Collision.html My problem is the collision normal 'N', with regards to an OBB. What I understand: When dealing with a sphere or a particle, the collision normal is the direction from the point of collision to the center/location of the sphere or particle. That's fine; I can calculate that. The collision normal of a box is the face normal of the face collided with. Therefore - How do I get the face collided with? I could get the closest face, but then, the closest face is not necessarily the one collided with. ...Or, hmm...If I relocate to its last position, then do...Er, bisection?...Testing till it's 'resting', then the closest face is likely enough to be the one collided with. Now, all I need is alternate intersection methods that return the distance of intersection along with wether there is intersection. Thoughts? Thanks for any and all help.

##### Share on other sites
Physics isn't my forte but maybe could the velocity vector of the object relative to the cube give you a hint as to which face of the cube was hit?

##### Share on other sites
There are a couple of ways to handle this.

The easiest to understand is the separating axis theorem. See this link for a good introduction.

The SAT relies on the bodies not really rotating, though. If your bodies rotate a great deal between one frame and the next, or you want to find the exact[ time of collision, you have to delve into some iterative schemes like "conservative advancement", which is described (not necessarily called that, though) in Mirtich's PhD thesis, chapter 2 ("Collision detection"). This is usually where the PhD lives, but the link seems to be down right now.

##### Share on other sites
I'd prefer to be able to handle fast rotations; it's for a graphics/physics library I'm writing (Re: Here)

Thanks, I'll check on that link again later.

I've got the calculations down for a spherical collision, but it turns out I forgot something - Getting the point(s) of collision. What are the options there?

##### Share on other sites
If the two shapes are spheres, you can find the exact time of collision by solving the equation (p2(t) - p1(t))^2 = (r1+r2)^2, where p is your position over time and r is the radius. Then plug in that time value to find the position of either sphere, and then you do n = p2(t) - p1(t) and normalize n and that's your collision normal.

1. 1
2. 2
Rutin
16
3. 3
4. 4
5. 5

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

• Total Topics
633710
• Total Posts
3013482
×