Anonymous avatar Anonymous committed 7abd3ac

update tests for joint and collision (now test1.py looks right)

Comments (0)

Files changed (3)

     body1.position = 100, 100
     body1.velocity = 2,0
     body1.restitution = 1.0
+    body1.rotation = 2
+    body1.mass = 80*33
     w.add_body(body1)
     body2 = physics.Body()
     body2.shape = physics.RectShape (20,20,0)
     body2.position = 200, 100
     body2.velocity = -2, 0
     body1.restitution = 1.0
+    body1.rotation = 3
+    body1.angle_velocity = 1
+    body1.mass = 20*20
     w.add_body(body2)
     return w
 
     body = physics.Body()
     body.shape = physics.RectShape (20, 20, 0)
     body.position = 200, 100
-    body.restitution = 1.0
+    body.restitution = 3.0
     body.static = True
     w.add_body(body)
     body1 = physics.Body()
     body1.shape = physics.RectShape (20,20,0)
     body1.position = 200, 200
-    body1.restitution = 1.0
+    body1.restitution = 300.0
     w.add_body(body1)
     body2 = physics.Body()
     body2.shape = physics.RectShape (20,20,0)
     body2.position = 300, 200
-    body1.restitution = 1.0
+    body1.restitution = 3.0
     w.add_body(body2)
     
     joint1 = physics.DistanceJoint(body1,body,1)
+    #joint1.distance = 10
     joint1.anchor1 = 0, 0
     joint1.anchor2 = 0, 0
     w.add_joint(joint1)
     joint2 = physics.DistanceJoint(body1,body2,1)
+    #joint2.distance = 10
     joint2.anchor1 = 0, 0
     joint2.anchor2 = 0, 0
     w.add_joint(joint2)
     
     
     body2 = physics.Body()
-    body2.shape = physics.RectShape (1000,20,0)
+    body2.shape = physics.RectShape (760, 20, 0)
     body2.position = 400, 600
     body2.restitution = 0.0
     body2.mass = 1e100
     body2.static = True
+    body2.rotation = 0.2
     w.add_body(body2)
     
     return w
         
     #rect = pygame.Rect(0,0,20,20)
     #pointlist = [(0,10),(10,0),(0,0)]
-    white = 250, 250, 250
+    white = 0, 250, 250
     theta = 0
     world = init_world()
     
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.