Better FPS Collisions

Started by
12 comments, last by Kwizatz 14 years, 10 months ago
Stop thinking in terms of (character) model triangles, once you get character movement right, you can think about cars, for that you will need a physics library like ODE or PhysX and probably to get familiar with rag doll physics, for now, just focus on character and world collision.

Advertisement
the SAT is good, but it is a lot of work if you are not familiar with it. You can develop the SAT in 2D, and then expand to 3D relatively easily.

You first have to be familiar with basic vector maths such as the dot product and cross product (also vector addition, multiplication, scaling, ect...).

Sphere collisions are usually quite straight forward. The simplest algorithm you can use is to find the closest point on a triangle to the sphere centre, and check if that point is inside the sphere or not.

If it is, you can push the sphere along the direction of the closest point towards the sphere centre.

If you are unsure about all that stuff, your best bet would be to use a 3rd party physics / collision engine such as PhysX.



sphere collisions with mesh.

does basic collisions with a 3D mesh. There are three main files, the first does a very simple interference response (move objects away from the collisions), the others have slightly more involved collision response code.

you can also look at discussion about the SAT in 3D and OBBs, with code and executable.

Everything is better with Metal.

Quote:Original post by Kwizatz
Stop thinking in terms of (character) model triangles, once you get character movement right, you can think about cars, for that you will need a physics library like ODE or PhysX and probably to get familiar with rag doll physics, for now, just focus on character and world collision.


Sorry I should have explained myself a bit better, I dont mean cars to drive around in, it was just an example of a static object in a scene so the player can stand on them etc. Sorry.

Thanks oliii I have downloaded the source from the one you linked on your post and it looks very good to get me moving in the right direction I will try to implement it myself, thanks very much, everyone.
Quote:Original post by Maddius
Sorry I should have explained myself a bit better, I dont mean cars to drive around in, it was just an example of a static object in a scene so the player can stand on them etc. Sorry.


Oh, ok, in that case the car should have a proxy as well, either a rough convex hull of sorts or something simpler like an oriented box, or a series of boxes, how detailed this proxy would be depends on your needs, you'll need more detail if you want the characters to be able to jump on the car and walk on top of it than you would if you only want them not to walk through it.

This topic is closed to new replies.

Advertisement