Go Cart Collision

Introduction
In this assignment, I am required to implement collision detection for the scene that was rendered previously.

Collision detection techniques have been around for a long time, there are various types of techniques, such as Axis-Aligned Bounding Boxes (AABB), Oriented Bounding Boxes (OBB), Sphere vs plane, Exact Collision Detection, etc. Each of these techniques have its own advantages and disadvantages, mainly the computational time involved play a major role.

Approach
I have decided to implement AABB collision detection. This is due to the fact that my scene was relatively easy where objects are placed according to the axis. In addition, simple point-inside test can be carried out quickly to detect whether collision occurs.

However, if an object is not position in such a way that is not aligned to axis, using AABB may result inaccurate collisions. But this will not happen to my scene as mentioned above.


Implementation
Bounding Boxes for all the objects in the scene were defined initially (13 Boxes). In addition, to create a miniature game experience in the scene, spheres/balls were created for the Go Cart to collide into (10 boxes).

Spheres/balls where created and positioned randomly each time the program is executed, or when the player choose to restart the game.


The Game
Initially, you started off with 0 ball collected. The objective is to collect all 10 balls by moving around in the scene and avoid colliding with the rest of the objects.

Screenshots

Start

Collecting balls by 'colliding'


Colliding with a lamppost


Game Completed

Conclusion
Using AABB collision techniques, moving around in the scene becomes more realistic, as the feeling of knocking into an object becomes apparent. With this, gaming experience becomes more realistic and it is very crucial in game genre like 1st person shooters.

Imagine without collision detection, players can run thru walls, shoot thru walls, etc. Nobody will want to play this kind of game!

Download Code and Executable

Acknowledgments
1. I wish to thank Dr Edmond C. Prakash for this opportunity to do some hands-on on the concepts of collision detection learned in lecture.

2. Ronny André Reierstad from morrowland.com for his tutorial and code on collision detection.


-Home-