#### Archived

This topic is now archived and is closed to further replies.

# Hand 2 Hand fighting

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

## Recommended Posts

Hi Im currently working on a 3d fighting game where the players are using swords, knifes, daggers and axes. I just have one problem... How should I program this hand to hand weapon? How can I test for collision with a sword? Please any sourcecode or articles would be great. Btw. I''m very good at math so don''t get scared by using advanced math to solve this problem Best regards Roquqkie

##### Share on other sites
quote:
Original post by Roquqkie
How can I test for collision with a sword?

The same way you test for collision with every other 3D model in your game.

##### Share on other sites
You can probably fake a sword collision by testing for a line-segment collision. It''s not too inaccurate, and it''ll let you collide-test it against some fairly complex geometry (i.e. a person) with little performance hit.

Decide what the sword needs to collide with (in terms of a person). Bounding boxes might suffice; I suggest many for a single person.

To determine whether swords collide with EACH OTHER will be a bit more tricky, since they no longer have volume, and could easily pass through each other in a single timestep. Look for information about "Plucker coordinates"; it''s an alternative coordinate system that can be used to easily manipulate lines and determine whether one line is on the "other side" of another line from where it was before.

Don''t listen to me. I''ve had too much coffee.

##### Share on other sites
If you sweep the line from one position to another you get a plane segment - two of these can esily be tested for collisions (intersection). You shouldn''t use normal collision detection - this is normally not detailed as it doesn''t matter, but for your game I guess you need to know whichpart of the body is hit, and how deeply.
How are you implementing physics/control for your fighters? ie how do they stand up without falling, or know how to move their arms to attack?

NEW (13th August): A new screenshot is up, plus diaries for week #3

John 3:16

1. 1
2. 2
3. 3
Rutin
18
4. 4
5. 5
JoeJ
13

• 14
• 10
• 25
• 9
• 57
• ### Forum Statistics

• Total Topics
632644
• Total Posts
3007624
• ### Who's Online (See full list)

There are no registered users currently online

×