diff options
author | Brian <brian@laptop.org> | 2008-07-14 15:47:03 (GMT) |
---|---|---|
committer | Brian <brian@laptop.org> | 2008-07-14 15:47:03 (GMT) |
commit | 7c56f20c8a7fd4eb23ef6415d57735f84a5fdd66 (patch) | |
tree | b9785507066b3e6347ba06020d088d44550c2732 /elements | |
parent | 042b7fc5b3fa06fa30e64b4fe42dc5dab17df523 (diff) |
Gears... right click with joint tool
Diffstat (limited to 'elements')
-rw-r--r-- | elements/add_objects.py | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/elements/add_objects.py b/elements/add_objects.py index eb396d8..bac1606 100644 --- a/elements/add_objects.py +++ b/elements/add_objects.py @@ -465,7 +465,7 @@ class Add: self.parent.world.CreateJoint(jointDef) def fixedJoint(self, *args): - if len(args) == 2: + if len(args) >= 2: # Fixed Joint to the Background, don't assume the center of the body
b1 = self.parent.world.GetGroundBody()
b2 = args[0]
@@ -473,7 +473,10 @@ class Add: jointDef = box2d.b2RevoluteJointDef()
jointDef.Initialize(b1, b2, p1)
-
+ if len(args) == 3: + jointDef.maxMotorTorque = 900.0 + jointDef.motorSpeed = 20.0 + jointDef.enableMotor = True self.parent.world.CreateJoint(jointDef)
elif len(args) == 1:
# Fixed Joint to the Background, assume the center of the body
@@ -485,7 +488,7 @@ class Add: jointDef.Initialize(b1, b2, p1)
self.parent.world.CreateJoint(jointDef) - + def revoluteJoint(self,b1,b2,p1): # revolute joint between to bodies
p1 = self.to_b2vec(p1) @@ -518,7 +521,13 @@ class Add: jointDef.maxLength2 = maxLength2 self.parent.world.CreateJoint(jointDef) - + + #def jointMotor(self,b1,b2,p1,speed): + # p1 = self.tob2vec(p1) + # jointDef = box2d.b2RevoluteJointDef() + # jointDef.Initialize(b1, b2, p1) + # jointDef. + # def joint(self, *args): print "* Add Joint:", args
|