player vs player collision

Started by
2 comments, last by oliii 14 years, 2 months ago
I've recently read the Improved Collision detection and Response article, and implemented player-vs-world collision system. I was wondering what is the best way to do play-vs-play collision? Since the "Collision Response" part of the algorithm only needs an intersectionPoint and intersectionDistance, I assume the only thing that needs to change is "Collision Detection" part. If one of the player is defined as a unit sphere(after being scaled by the Ellipsoid Vector Space) and the other player is an ellipsoid (assuming it doesn't have the same radii as the first player) what is the best way to determine if an intersection has occurred, and if so, find the intersection point?
Advertisement
ellipsoid - ellipsoid collision is difficult. For your players, you could use bounding boxes instead of ellipsoids. Of three spheres that roughly approximate your ellipsoid and do sphere-sphere collision.

That is trivial to do, and in fact, the code is already there in the paper. Vertex-sphere is basically equivalent to doing a sphere with zero radius against a sphere. It's not hard to extrapolate the code and write a sphere-sphere algorithm, which will give you the contact point and the normal of collision.

To simplify, when you test a player (player A) against another (player B), you can consider player B as static to detect the time of collision of A against B. However, when computing the collision response (how va and vb changes after the collision), the velocity you will have to consider will be (va - vb), and compute the change of momentums on the two players. afaik, that's what Quake 3 does.

Everything is better with Metal.

thanks for the reply oliii.I know there are a lot of articles on the net about sphere-to-sphere collision, but the part that confuses me is changing vector spaces. In this article, all points (basePoint, velocity, and the 3 triangle points) are scaled by eSpace before the collisionPoint is detected. When I test against a sphere, do I have to scale the sphere's position and radius as well?
That's probably overkill. The transform is needed for the ellipsoid but not the sphere.

Everything is better with Metal.

This topic is closed to new replies.

Advertisement