Jump to content
  • Advertisement
Sign in to follow this  
jnmanyaga

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.

If you intended to correct an error in the post then please contact us.

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]

Share this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
Share on other sites
Quote:
Original post by jnmanyaga
a) What can u suggest for an FPS game?


Novodex - look at the character controller class/samples.

Quote:
Original post by jnmanyaga
b) 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 jnmanyaga
c) 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 this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!