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

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

## 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 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.

1. 1
Rutin
33
2. 2
3. 3
4. 4
5. 5

• 13
• 76
• 11
• 10
• 14
• ### Forum Statistics

• Total Topics
632968
• Total Posts
3009584
• ### Who's Online (See full list)

There are no registered users currently online

×