Thursday, May 29, 2008

Status report: week 1

So far, I have physics engine which:
  1. Handles static and dynamic bodies
  2. Deals with spheres and planes
  3. Detects collisions and treats them as completely elastic and frictionless
These are global TODOs:
  1. Rotation. I deliberately chose such shapes that aren't sensitive to rotation, but this need to be done anyway. As I see, only two things are needed: to respect angular velocity during integration and to apply torque during collision.
  2. More shapes are needed to test rotation. It will be good to implement generic polyhedra.
  3. Friction and restitution. There are problems with these, because coefficients of friction and restitution depends on two bodies (i.e. you cannot directly derive them from the properties of separate bodies). I'll need to investigate how this is implemented in other PEs.
  4. Some code is currently suboptimal (e.g. some calculations are duplicated)
Plans for the next week:
  1. Visualization. It's the best method of testing that I see.
  2. Restitution and friction
  3. Types. Currently I use lists for vectors, but as Manuel Chakravarty pointed out, this prevents compiler optimizations, so it's better to use explicit datatypes. Shouldn't be much of work.

Monday, May 26, 2008

The first day

Today my coding period has started.

Some initial code is darcs-pushed to http://code.haskell.org/hpysics. Now I want my mentors to look at the data structures I've defined and tell me if some of they won't play nicely with NDP.

Then, my nearest plans are to get basic collision handling working. Also, though I planned visualization for the late June, I probably will do it earlier -- it's very tempting to see your physics engine produces plausible results.

Friday, May 23, 2008

Literature

This book will be my bible during this summer: This is printed Brian Mirtich's thesis about rigid body simulations.

Tuesday, May 13, 2008

Wiki page

I've started a wiki page for hpysics. It summarizes what I've learnt about existing physics engines.