Final Project: Physics Simulation

CMPS 161, Winter 2008, UCSC


Guy Oron - goron@ucsc.edu

For my final project I wanted implement an interactive physics simulation. The idea was that this simulation would contain objects that the user could interact with and control and which will also interact with each other in a physically-realistic way. Objects would fall, bounce, collide, slide, roll, etc.

I decided to use ODE, the Open Dynamics Engine library to facilitate the dynamics. I spent a lot of the time I had for this project figuring out how to use the libraries (what files should be linked to what files, what should include what, how to communicate between classes and files, how and where the libraries store important information, how and where they capture mouse events, etc). As I had no prior experience with C++ or VS before this class, and all our class projects came ready to start on, this took me a lot of time to figure out.

I got some example code provided with the library to work, and began working to add the picking feature. The idea was that the mouse could pick up objects and throw them around. As it turned out, most of the other funtionality only required setting it up. That is, falling, rolling, bouncing, collision tests, and such were all provided seamlessly by the library. I had the idea that I would have to work on these. So I tried to get the picking to work, and could not do it in the time I had left. I worked for many hours on it, and got a bit closer, but not close enough. It required really going into deeper files in the library and modifying them. Just understanding how to do this (with Alisa's help), and how to recompile the libraries also took a lot of time. I didn't finish. At the last minute I tried to implement "picking" using keyoard commands, but did not have time to accomplish this either.

To attempt picking in the program, press m (this toggles picking mode, otherwise the mouse will manipulate the camera). The rest of the picking code does not work correctly.

Screenshots: