From: Chris B. <chr...@gm...> - 2005-03-03 09:41:15
|
On Wed, 2 Mar 2005 23:35:28 -0500 (EST), Jonathan V Toups <to...@ph...> wrote: > > j.attach(geom1.getBody(),geom2.getBody()); > > Causes a nasty error. This is because if one of the Geom objects is an > immovable object, getBody returns None. This behaviour is puzzling, since > in Linux, I am clearly getting a body, perhaps where I shouldn't be. Are you sure? The behaviour under linux and windows should be identical... it's the same code. getBody should return None. > So the question is, how do you handle adding contact joints to > objects which do not have bodies? Or, how do you make an object with a > body permanantly fixed in space? Or, am I doing something totally > ridiculous? You can't add joints to geoms. You can only use joint constraints on ODE bodies. You can fix a body in space by creating a fixedjoint with the environment (pass 0 as the body arg). However, this is generally advised against since it adds unnecessary constraints. The usual way to get what your trying to do is to place the geom somewhere, and then calculate contact joints. The contact joint should be attached to the static environment. afaik, calling getBody should return None, and your contact joint is created with that and a real body, so your code should already work! |