Home » Community » Forums » » Collision Detection
  Intel sponsors gamedev.net search:   
[Control Panel] [Register] [Bookmarks] [Who's Online] [Active Topics] [Stats] [FAQ] [Search]

Add Forum to Favorites |  Send Topic To a Friend | View Forum FAQ | Track this topic


 Last Thread Next Thread 
 Collision Detection
Post Reply 
I belive that is a good algorithm. I have been looking for one for a long time now. I came up with something like that a long time ago but it had muy grande problemas. anyway, I guess i can spend another hour or two of my life pulling up my old project and polishing its collision detection.

Thanks alot.
selen_03@yahoo.com

 User Rating: 1015    Report this Post to a Moderator | Link


template < class T >
const bool &overlaps( const T& x0,const T& y0,const T& x1,const T& y1,const T& x2,const T& y2,const T& x3,const T& y3) const {
return
((!(
((x0)<(x2) && (x1)<(x2))||
((x0)>(x3) && (x1)>(x3))||
((y0)<(y2) && (y1)<(y2))||
((y0)>(y3) && (y1)>(y3))
)));
};

 User Rating: 1015    Report this Post to a Moderator | Link

dg

 User Rating: 1015    Report this Post to a Moderator | Link

hi :p

 User Rating: 1015    Report this Post to a Moderator | Link

Thank you for a great article :)


 User Rating: 1072   |  Rate This User  Send Private MessageView ProfileView Journal Report this Post to a Moderator | Link

Out of curiosity, how did someone manage to resurrect this thread?

 User Rating: 1620   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

I read the article. Was good. Described it very well. I have a suggestion however. And i'm sure I will probably get told it has it's flaws.

When constructing the overlap rectangle. I believe the best thing to do is just to test the center pixel in the rectangle to see if it is overlapping in both bitmaps. Would this not be far more efficient while also giving you some degree of interaction better than just reduced rectangle formula?

1. Saves you of testing all pixels which improves efficiency.
2. gives you a greater degree of collision detection than just reduced rectangles.

Let me know your thoughts.

I might see if I can sketch some ascii art to represent my point.

[Edited by - aschk on December 22, 2006 5:39:56 AM]

 User Rating: 1015   |  Rate This User  Send Private MessageView Profile Report this Post to a Moderator | Link

All times are ET (US)

Post Reply
 Last Thread Next Thread 
Forum Rules:
You may not post new threads
You may post replies
You may not edit your posts
You may not use HTML in your posts
Jump To:
Administrative Options: