Jump to content
  • Advertisement
Sign in to follow this  
spyridonz

3d Collision detection with weapons...

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

I'm currently working on a game that is going to be a side scrolling fighting game, that plays pretty much like a 2d one, just uses 3d rendering for the improved visuals. I am new to programming in 3d environments though. One thing I dont know how to do is collision detections for weapons in a 3d environment. Is there any way possible to have a box or sphere "pinned to" and tracked to a certain point of my model? (that point being my weapon in this example) If that is not possible, I am not quite sure how I am supposed to track the damage radius of the weapon during my animations in 3 dimensions, since it will constantly be moving and repositioning itself. Since the actual gameplay is going to be in a 2d style environment, it may be better to do 2d collision detection for this, but even if I did 2d collision detection, I still dont know how I am supposed to track the weapon during the attack animations. In 2d it was easy because I had the coordinates of each sprite on the sprite sheet - which I cant do with these animations. So I am kind of stuck on this.

Share this post


Link to post
Share on other sites
Advertisement
I take it you're referring to melee weapons?

Check if enemy player is within a certain radius (sphere OR box collision), and that the player is facing that direction, and you have a match.

If you want perfect collision checks, i.e. exact hits from a moving weapon, then your weapon should have its own collision volume which is re-positioned and rotated (maybe even re-calculated depending how the weapon works) along with each animation frame.

Share this post


Link to post
Share on other sites
Yes I do mean melee weapons, Sorry I didnt specify.

Hmm, well that actually would work fine for my game, since it does not have to be any more exact then I would be able to achieve with this. Thanks! I was expecting something more complicated since it is in 3d but it is pretty much the same methods.

Out of curiousity, for the commercial fighting games that are in true 3d, would they be using a method similar to this, except tracking the radius of the direction they are facing also? Or do they do something a bit more advanced?

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!