So far, I have physics engine which:
- Handles static and dynamic bodies
- Deals with spheres and planes
- Detects collisions and treats them as completely elastic and
frictionless
These are global TODOs:
- 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.
- More shapes are needed to test rotation. It will be good to implement
generic polyhedra.
- 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.
- Some code is currently suboptimal (e.g. some calculations are
duplicated)
Plans for the next week:
- Visualization. It's the best method of testing that I see.
- Restitution and friction
- 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:
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.
Post a Comment