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.

1 comment:

chak said...

I wouldn't worry too much about different shapes for the moment. Rather get more functionality with few shapes and then extend the set of shapes later. This way you'll get to the interesting bits more quickly.