# Effective Collision Detection 4 FPS

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

## Recommended Posts

how to perform collision for an FPS game effectively? some people suggest to use a bounding ellipsoid, how does bounding ellipsoid is perform? is it the same as bounding sphere? but in ellipsoid radius are not equal so i cant compute the collision by just using the center and the radius. so in summary ; a) What can u suggest for an FPS game? b) if u said ellipsoid then how can i compute the ellipsoid from an D3DX mesh? c) How to perform collision with an ellipsoid to the scene or with a triangle? // edit - added a title [Edited by - LessBread on October 5, 2005 11:23:49 AM]

bump

##### Share on other sites
a) What can u suggest for an FPS game?

Ellipsoid would be great, but capsules (a cylinder capped with spheres) are easier to work with.

b) if u said ellipsoid then how can i compute the ellipsoid from an D3DX mesh?
Well, just calculate the bounding box of the mesh, then width/2= x radius,depth/2= y radius,height/2= z radius.

for a capsule find which one is bigger width or depth, then divide by 2, you get the radius of the spheres and the cylinder, then height-2 times the radius will give you the height of the cylinder.

c) How to perform collision with an ellipsoid to the scene or with a triangle?

You have to transform the scene to a worldspace where the ellipsoid becomes a sphere of radius 1, this is done by dividing all points by the radii of the ellipsoid, calculate the collision using the standard sphere-triangle collision detection and then revert the result by multiplying by the radii again.

[Edited by - Kwizatz on October 5, 2005 7:47:51 PM]

##### Share on other sites
Quote:
 Original post by jnmanyagaa) What can u suggest for an FPS game?

Novodex - look at the character controller class/samples.

Quote:
 Original post by jnmanyagab) if u said ellipsoid then how can i compute the ellipsoid from an D3DX mesh?

Don't use an ellipsoid (mainly because novodex doesn't support them) - the character controller has built-in functionality for jumping, steps, etc.

Quote:
 Original post by jnmanyagac) How to perform collision with an ellipsoid to the scene or with a triangle?

call g_scene->simulate (delta_time) and then m_actor->getGlobalPose () to get the new location of your object.

Unless you either a) enjoy stabbing yourself in the eyes on a regular basis or b) want to learn how to write a physics engine, use Novodex (or another free physics engine) and then focus on making the game fun.

##### Share on other sites
>opinion goes here<

1. 1
Rutin
24
2. 2
3. 3
JoeJ
20
4. 4
5. 5

• 9
• 46
• 41
• 23
• 13
• ### Forum Statistics

• Total Topics
631746
• Total Posts
3002021
×