D2: Collision Detection Mathematics

Due Thursday, February 5th, at the start of class.

It is often useful in a game to know if two shapes are overlapping and where they overlap. The goal of this assignment is for you to consider this problem and work through the mathematics involved in determining the overlap of various types of shapes.

What to determine

Write pseudo-code to determine if pairs of circles, convex polygons, and rectangles overlap.

Optional, but useful later (and to flex your math skills):

For Rays, determine the first point along the ray at which overlap occurs with circles, rectangles, and convex polygons.

What to hand in

Work through the rectangle-rectangle, circle-circle, and convex-convex overlap cases. Hand in typeset or handwritten page(s) describing (in pseudo-code/math) how to determine if overlap occurs.

Supporting Material

Source code from Box2D.

A fine basis for collision detection is the separating axis theorem.