Jump to content
  • Advertisement
Sign in to follow this  
JustSuds

Simple collisions - there has to be an easier way

This topic is 3173 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 understand/can perform collisions in XNA, with the bounding box. But surely there has to be a more accurate/easier way of doing things. Lets say for arguments sake that I have a square sprite, split down the middle. The left half being empty or transparent, the right half being a solid colour, lets say blue. Is there some secretive method in the XNA framework (or popular third party snap-in of some sort) that would literally perform collisions based on the contents of the sprite, say, (psuedo code) if (bluePart intersects wallSprite){ do stuff; } as opposed to creating a bounding box that covers just the blue half of the sprite. I make that example chasing the folling idea; An image with a hollow semi-circle arc in it. Instead of creating 12 bounding boxes to cover the arc adequately, while also suffering from inaccuracies associated with turning a round object into a bunch of square ones; it would be much simpler to have an 'intelligent' collision-checking system that literally checks the contents of the sprites as opposed to the boundaries that you physically prescribe in code. Is there such a system that's not in conventional tutorials/short courses? I was bored, and just wondering. Its relevant to a game idea I was thinking about for the future, I just thought I'd bring it up for discussion.

Share this post


Link to post
Share on other sites
Advertisement
The whole point of bounding boxes is to exclude heavy collision detection checks when there's obviously no collision. It was never meant to be an accurate means of detecting them.

Bounding volume collides --> You do a better test.
No bounding volume collision -> You don't have to.

Share this post


Link to post
Share on other sites
Quote:
Original post by Gage64
Take a look here.

Yeah what you want or are thinking of is per-pixel collision. It's one of the game programming idioms you should run into if you keep making games.
I used it on an old pirates clone to detect when the ship sailing around in the water hit land.



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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!