Update of /cvsroot/pyode/pyode/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12588/src
Modified Files:
joints.pyx
Log Message:
- Added XODE importer package and unit tests.
- Modified examples/tutorial2.py to use XODE. The original code is still there
and can be used by changing the second to last line.
- Added a getBody() method to the Joint class.
Index: joints.pyx
===================================================================
RCS file: /cvsroot/pyode/pyode/src/joints.pyx,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** joints.pyx 3 Jul 2004 16:57:41 -0000 1.2
--- joints.pyx 7 Jul 2004 11:46:32 -0000 1.3
***************
*** 68,75 ****
--- 68,80 ----
cdef dJointFeedback* feedback
+ cdef object body1
+ cdef object body2
+
def __new__(self, *a, **kw):
self.jid = NULL
self.world = None
self.feedback = NULL
+ self.body1 = None
+ self.body2 = None
def __init__(self, *a, **kw):
***************
*** 94,99 ****
--- 99,116 ----
def attach(self, Body Body1, Body Body2):
"""TODO: What if there's only one body."""
+
+ self.body1 = Body1
+ self.body2 = Body2
dJointAttach(self.jid, Body1.bid, Body2.bid)
+ # getBody
+ def getBody(self, index):
+ if (index == 0):
+ return self.body1
+ elif (index == 1):
+ return self.body2
+ else:
+ raise IndexError()
+
# setFeedback
def setFeedback(self, flag=1):
***************
*** 143,148 ****
######################################################################
!
!
# BallJoint
cdef class BallJoint(Joint):
--- 160,165 ----
######################################################################
!
!
# BallJoint
cdef class BallJoint(Joint):
|