teaching machines

Feature 12

May 9, 2013 by . Filed under cs455, postmortems, spring 2013.

This feature was fairly simply, though so is the result. This is not anywhere near a realistic collision detection system. The way my collision detection works is this:

Several box-shaped regions are defined and added to the collision object. These regions are defined by giving a vector for the center of the region and a vector for the dimensions of the region, both in world-space coordinates. Once all regions have been given to the collision object, it is passed to the camera.

I was hoping to avoid this intertwining of the classes, as the camera shouldn’t really be worried about collision. However, every other way I thought of had too much repeated code for my liking. After the camera has the collision object, it simply checks if a movement would land itself in one of those regions before moving, in which case it simply doesn’t move.

This shows another one of the simplicities of my system. Most systems would allow the player to slide along the object in the general direction they were trying to move. Mine simply stops them dead in their tracks.

Here is an album showing some of the different structures of the new code: http://imgur.com/a/S3S9q#0

Here is a video demoing the result:

[youtube http://www.youtube.com/watch?v=nyPF7p69L1Q?feature=player_detailpage]