The Allegro Wiki is migrating to github at https://github.com/liballeg/allegro_wiki/wiki

Difference between revisions of "Collision detection"

From Allegro Wiki
Jump to: navigation, search
m (Collision Detection moved to Collision detection: {{redirect from alternative capitalization}})
(change the links)
Line 6: Line 6:
  
 
==Bounding Box==
 
==Bounding Box==
 +
 +
{{main|Bounding Box}}
  
 
While not the fastest method of collision detection (and not technically even a method for collision detection), Bounding Box (BB) is often a favourite among many developers. Put simply, this technique involves checking whether an object has intercepted (overlapped) an invisible square boundary that is usually placed over, and often remains relative to, a game object.
 
While not the fastest method of collision detection (and not technically even a method for collision detection), Bounding Box (BB) is often a favourite among many developers. Put simply, this technique involves checking whether an object has intercepted (overlapped) an invisible square boundary that is usually placed over, and often remains relative to, a game object.
 
[http://wiki.allegro.cc/Bounding_Box Click here for more information on Bounding Boxes and their implementation]
 
  
 
[[Category:Collision detection]]
 
[[Category:Collision detection]]

Revision as of 19:07, March 14, 2008

This article is incomplete and needs some revision or has some pending TODOs. Please help Allegro by editing and finishing it. When the article becomes complete, you may remove this tag.


Introduction

Arguably the most important aspect of incorporating a system for collision detection into a design document or product is choosing the technique that best suits your particular project. Collision detection is a vast and often confusing topic. While one particular method may suit a project perfectly, it can also be entirely illogical for another. After all, a roguelike isn't likely to need a pixel-perfect implementation, while a game incorporating an advanced physics engine may well require something slightly more precise. At the end of the day, choosing a method for collision detection involves considering the key aspects of your projects gameplay and weighing them against your various computational constraints. That is to say, if you are anticipating the need to check collisions against thousands of particles at a fairly frequent rate, you will want to be find a good balance between accuracy and computationally inexpensive routines.

Bounding Box

Main article: Bounding Box

While not the fastest method of collision detection (and not technically even a method for collision detection), Bounding Box (BB) is often a favourite among many developers. Put simply, this technique involves checking whether an object has intercepted (overlapped) an invisible square boundary that is usually placed over, and often remains relative to, a game object.