[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] PyODE

I've been playing with PyODE today, after finding a bug of sorts in my Pygame game's simple physics code. So far, using Pygame as the display, I was able to get circles bouncing and colliding. But does anyone know how to feed collision information back to the program outside PyODE?

That is, it's great that ODE can compute the locations of objects when they hit each other. But for, say, a lunar lander game, I would need to get notified when the lander hits the ground so I can find the collision speed and damage the lander if it's too fast -- game stuff rather than pure physics stuff. For my main game project I'd want to notify the game objects represented by the physics objects, to trigger sound effects, damage, etc.. Does anyone know how to do this? I tried wrapping the ODE objects or parts of them in a new class with an "owner" field referring to the game object, and that didn't work.