From: Simon H. <twi...@ob...> - 2007-04-23 00:15:52
|
Firstly, I'd like to second Martijn's sentiment - ODE (and PyODE) are very nice to work with. :) Secondly - I have a problem that I hope someone has already solved, and that they can point me in the right direction... I'm working on a physics-enabled boardgame environment ( http://groups.google.com/group/pyglet-users/web/geoffrey-a-board-game-environment ) and I'm using PyODE for selection and collision detection/physics. The selection code works perfectly (using glUnProject to position a GeomRay in the scene, then test for contacts with pieces) but I'm slightly stuck on *moving* the selected piece to keep it under the mouse pointer each frame. First I tried setting it's position every frame, but that doesn't seem like the right way to do it, as collisions become unreliable. I tried setting it's linear velocity so that it would move to the target position each frame, but I couldn't get that working nicely either. I've experimented with attaching the object to *another* object, and setting *it's* position, but that didn't seem like the right solution - and applying a force (as per the 'thrust control logic' article in the wiki) didn't seem like it would solve my problem either. Am I going about this the wrong way? I *do* seem to be fighting ODE for control of the object - is it back-to-front to think I can control an ODE object's exact position, while still having it collide with other objects? Any suggestions welcome. :) Sincerely, Simon Hildebrandt. |