Korovic And The Squid - Day 2

Day 2 has seen rapid progress what with it being a bank holiday in the UK. I've bunged together some fairly crude physics courtesy of Pymunk and bolted that into Pyglet to render the art that I largely drew yesterday.

I've not used Pymunk before - I've always used pyBox2D in my experiments. On the plus side Pymunk seems to be more Pythonic, with excellent support for various collision callbacks. On the downside I've not found moment of inertia and centre of gravity calculations built in. Or perhaps I'm missing a trick.

So right now we can tweak Susie's engines:



And rather clumsily fly her:

(log in to comment)

Comments

If your talking about finding the moment of inertia to define bodies, pymunk has some built in:
pymunk.moment_for_poly
pymunk.moment_for_box
pymunk.moment_for_segment
pymunk.moment_for_circle

You can find the docs at the pymunk googlecode website.
Yes, I'm using those, but you have to sum them yourself across all the shapes in the body.
Cripes, it's worse than that. Chipmunk doesn't support insertion points that differ from the centre of gravity of the body. If you want this you have to track it yourself. In Box2D you just say "The body IS here" and when you add shapes to it, it works out its centre of gravity and moment of inertia. The point you told the body to be is tracked and can be used for game logic.

Just come across this as I've tried to add components with insertion points offset from the centre of gravity.