Sign in to follow this  

What information do you need to calculate a collision between two entities?

This topic is 3863 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

Joe swings his sword attemping to hit Bob. What math do you need from each player to calculate a collision? Here is what I think, and you can probably correct me. 1) The bounding box min,max of joe's body (A rectangle) 2) The bounding box min,max of joe's sword (A rectangle) 3) The bounding box min,max of bob's body (A rectangle) Somehow I need to calculate joe's maximum reach & arc of his sword swing. Now depending on each players position I should be able to detect if a collision will occur yes?

Share this post


Link to post
Share on other sites
To do it properly you need to do collision detection between the sword and bob, using a collision mesh matching bob. I think you need more than a cylinder - a person in combat is not especially cylindrical, so e.g. joe's sword will swing through bob's outstretched sword arm without it registering. So you model bob and the sword using polygons and use one of a number collision systems.

Or you do what any number of games have done and just give each weapon a 'reach' value and say that when joe and bob are within this distance the weapon hits, subject to weapon skill and shielding modifiers etc.. Many games don't even bother with this, giving all weapons the same reach, unless they are ranged.

Share this post


Link to post
Share on other sites

This topic is 3863 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this