Hi Mizipzor,

You aren't keeping references to your ode.Joint objects, so they're
getting deallocated. Try this patch:

--- xorig.py    2007-04-22 10:11:33.000000000 +0100
+++ x.py        2007-04-22 10:20:41.000000000 +0100
@@ -3,8 +3,8 @@

 world = None # the gravity world
 worldscale = 1
-
-class Joint():
+objs=[]
+class Joint:
     """ a joining between two ropes """
     def __init__(self, mass, radius, length, parent, attachPoint):
         #create the mass
@@ -31,13 +31,14 @@

         #create the joint
         j = ode.BallJoint(world)
+        objs.append(j)
         if parent == None:
             j.attach(self.body, ode.environment)
         if not parent == None:
             j.attach(self.body, parent.body)
         j.setAnchor((attachPoint[0],attachPoint[1],0))

-class Rope():
+class Rope:
     """ a rope """
     def __init__(self, topPosition, joints, mass, radius, length):
         self.joints = []

Incidentally, you don't need to explicitly compare to None either...
you can just do 'if parent: x.. if not parent: ...' which looks
cleaner.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Pyode-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyode-user

Reply via email to