From: Matthias B. <ba...@ir...> - 2005-03-03 09:45:05
|
Alan Blount wrote: > geom.setCategoryBits(1) > > Traceback (most recent call last): > File "minimum.py", line 7, in ? > geom.setCategoryBits(1) > File "geomobject.pyx", line 234, in ode.GeomObject.setCategoryBits > SystemError: Objects/longobject.c:240: bad argument to internal function > > Any idea what gives? I looked at the pyrex source for geomobject.pyx > and didn't see anything obvious wrong. This is rather a "bug" in the documentation as setCategoryBits() and setCollideBits() actually expect a long value and not an int (I also wasn't aware of that until recently when I stumbled across the same exception). This means you have to change your code to: geom.setCategoryBits(1L) or geom.setCategoryBits(long(1)) However, I've just commited a change so that also int values can be passed (and I corrected the doc strings). (On the other hand, should that really be changed? It will break programs written for PyODE >1.0.0 when they're used with 1.0.0. Maybe it would be better to update the docs only. Any opinions?) - Matthias - |