TINPE

This Is Not a Physics Engine. That is what I kept telling myself while working on TINPE, but building a physics engine was certainly on my mind. TINPE is only a very simple model: one ball bouncing off of a number of "plates." My model does not use iterative collision detection, rather, it uses analytic collision detection. The ball's path is calculated each frame and compared to all the sufaces it might hit. If it will hit a surface, the ball moves to the position is which it will collide, calculates it's new velocity, and continues on its new path. Keep in mind, all that happens within the space of one frame.


Looking down on the ball
Other Features

Almost all my energy for this project went into researching, tracking down, or deriving the algorithms for detecting and handling collisions. A bouncing ball isn't very exiting if you can't tell it's a ball, though. I used the full Phong Shading model to color the ball and plates. The ball itself is made using GluQuadrics, while the plates are simple, hard coded meshes.


Research

Most of the formulas and methods I worked with came from Wikipedia.

Line and Sphere Intersection How to Solve a Generic Quartic Equation

This site was useful for circle-circle and circle-point intersections.

Non-Linear Circle Collision Detection

And finally, where I found code to determine if a point lies inside a triangle.

Point in Triangle Test
Compiling and Running

Just use the included Makefile to compile TINPE (linux only). The exe is the very basic "a.out." There are no controls: this program was mainly for research and demonstration.