More physics updates

Okay, more news are in regarding SIEGE physics – new features which will make the physics engine way more powerful now.

Here they are, roughly in chronological order of introduction:

  • Physics shapes now have settable groups (shapes of the same group do not interact), friction and restitution (elasticity)
  • Constraints are added (although they are still heavily work-in-progress), meaning that two bodies can now be linked together properly
  • A bug has been fixed – if a body is attached to no entity, it will crash in the collision callback handler as it tries to dereference a NULL pointer
  • Each physics space now comes with a default “static body” – one which has no shapes by default, but has infinite mass and moment of inertia, to be used as a base for static shapes. Of course, creation of static bodies in “the old fashioned way” still works perfectly fine.

There are some unrelated fixes as well:

  • An unrelated bug has also been fixed with mouse handling in SDL (press/release events now work properly)
  • “Normal” keyboard and mouse events (those without Press/Release/Repeat) now work as expected – they are triggered at every tick as they should be

I’ll try to throw a demo together shortly.

Here is the commit: https://gitorious.org/siege/siege/commit/d03d563d1873a2c9fb72b0e6c30191d7471fbd04

Posted in SIEGE.