Project Update: Collision Detection


No I’m not dead, sorry to disappoint.  I’ve been working on collision detection and am not getting too far with it right now.

I am using a simple but flexible design, each entity has an outer bounding box – a rectangle – that is used for an initial broad phase, then one or more convex polygons that are tested for the narrow phase.  This allows for a quick removal of un-necessary checks and some added flexibility in the narrow phase, for example in a space shooter getting hit in the cockpit could cause death whilst a hit to the engine could cause speed loss or manoeuvrability issues.

In the image above the green box represents the outer bounding box and would be used for the broad phase, the three blue polygons would be used in the narrow phase to determine which area had been hit.

Initially this started quite well, the broad phase is easy and works nicely, the narrow phase is not going quite so well.  I’m currently failing to implement a routine based on the separating axis theorem because – and I’m pretty sure this is the reason – I’m a moron.

Maybe I’ll look at tidying up the scene manager instead…

Advertisements

Author: Stuart

Crazy Person

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s