CSC 471 Final Project

Physics Simulation

Tim Biggs




Description:

This project is my attempt at real-time 3d physics of rigid bodies. It uses simple bounding box collision detection and elastic collision handling (with some 'fake' energy loss) to simulate cubes and spheres bouncing off each other. There is also a score counter if you want to see how many blocks you can hit (its based on the number of times objects collide and a score multiplier).


A Few Technical Details:

-Every object involved in collision, including the ground, is kept in a single list. If an object is not a physics one (say, the ground), its physics handler is set to null, the net effect of which is that the object is treated as if it has infinite mass.

-When 2 objects collide, the simulator attempts to 'back up' one of them until the objects no longer collide before continuing with the simulation. This helps somewhat with preventing objects getting stuck in each other, but does not always work well (see below).

-The simulator uses an update function to change an object's position at a specific time interval. Ideally this interval would be set to the current frame rate (with a max of 60 FPS), but it is just currently set to 60 FPS constant.


Known Issues:

-Collision is still a bit buggy. Objects are prone to getting stuck inside each other, and occasionally falling through the ground. Unfortunately, this means blocks cannot be stacked on each other.

-There is no object rotation.

-The simulation is not a truly accurate one, primarily due to its handling of collision response.













Controls:

w – move forward

a – strafe left

s – move backward

d – strafe right

e – throw ball

1 – set to stage 1

2 – set to stage 2

3 – set to stage 3

q – pause simulation

z – step through while paused

References:

-Game Physics Tutorial

-My Roommate (Paul)