Hey everyone, I just have a (not so) little problem with some of my Python code, and with OdeJoints.
Basically, what I want to do is make some code that binds one model with a joint, to another, with joint movements constrained around one axis.
Here is the code I came up with:
joint1 = OdeUniversalJoint(get_phys_world())
joint2 = OdeUniversalJoint(get_phys_world())
joint3 = OdeUniversalJoint(get_phys_world())
joint4 = OdeUniversalJoint(get_phys_world())
joint5 = OdeUniversalJoint(get_phys_world())
joint1.setAxis1(0, 0, 0)
joint1.setAxis2(0, 0, 0)
joint2.setAxis1(0, 0, 0)
joint2.setAxis2(0, 0, 0)
joint3.setAxis1(0, 0, 0)
joint3.setAxis2(0, 0, 0)
joint4.setAxis1(0, 0, 0)
joint4.setAxis2(0, 0, 0)
joint5.setAxis1(0, 0, 0)
joint5.setAxis2(0, 0, 0)
joint1.attach(self.world.element[self.name + '_torso'].phys_obj.body, self.world.element[self.name + '_larm'].phys_obj.body)
joint2.attach(self.world.element[self.name + '_torso'].phys_obj.body, self.world.element[self.name + '_rarm'].phys_obj.body)
joint3.attach(self.world.element[self.name + '_torso'].phys_obj.body, self.world.element[self.name + '_lleg'].phys_obj.body)
joint4.attach(self.world.element[self.name + '_torso'].phys_obj.body, self.world.element[self.name + '_rleg'].phys_obj.body)
joint5.attach(self.world.element[self.name + '_torso'].phys_obj.body, self.world.element[self.name + '_head'].phys_obj.body)
phys_obj.body is the OdeBody for the model I’m trying to bind.
When I run this code, though, the following happens:
See the figure on the left, rolled up in a ball? That’s the figure affected by the above code.
Could someone please tell me whats wrong?
Thanks,
DangerOnTheRanger