[ODE] ANN: New version of pyODE and 3rd tutorial

Matthias Baas baas at ira.uka.de
Wed Jun 18 00:04:02 2003


At 07:00 18.06.2003 +0100, Paul Rudin wrote:
>   File "tutorial3.py", line 92, in create_box
>     body.shape = "box"
>AttributeError: 'ode.Body' object has no attribute 'shape'
>
>I guess I must have a different version of something somewhere?

It looks like you're still using the first version of pyode. But to run the 
tutorial you need the updated version (this time, you can download a 
*.tar.gz with Unix style newlines. :)

In the new version you can add arbitrary attributes to a Body class (like 
"shape" in the above code), just like you're used from any pure Python 
class (this is similar to using dBodySetData() in the C API). I'm using 
this in the tutorial to add some attributes that are used during rendering. 
Actually, it wouldn't really be necessary in this example as all bodies are 
boxes with the same dimension. But when I started creating the tutorial I 
also had spheres and capped cylinders which I distinguished using the above 
attributes. But I removed them to keep the program small (and they wouldn't 
add anything new for understanding collision detection anyway).

- Matthias -