1. icon for News
  2. icon for TCHOW


Tuesday, July 9, 2013

Collision in Rainbow

One of the things I'm revisiting in the C++ port of Rainbow is the way in which the bow fronts collide with level geometry, and how this splits up the fronts.

Splitting fronts is an important part of the game because smaller fronts are more maneuverable. However, in the HTML5 version of rainbow, the only way to split a front was to run it into something in a way that stopped one of the frequency bands. In the C++ port, I wanted to make it so that (with certain level geometry) one could actually split a front nondestructively.

The key to this is to use ray-vs-level tests to determine bow collision and convex-vs-level tests to figure out where to split the front. This way, frequency bands only crash if their centers intersect level geometry, but bow fronts can split gracefully around thin geometry. I finally added convex-convex collision today, so this splitting system is up and running.