Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(3)  |  Derive(0)  |  Import(1)

src/w/r/Wrappyr-HEAD/tests/test_box2d.py   Wrappyr(Download)
from Box2D.common import b2Vec2
from Box2D.collision.shapes import b2PolygonShape
from Box2D.dynamics import b2World, b2Body, b2BodyDef, b2FixtureDef, b2RayCastCallback
 
#from Box2D import *
world = b2World(gravity, False)
 
groundBodyDef = b2BodyDef()
groundBodyDef.position = b2Vec2(0.0, -10.0)
groundBody = world.CreateBody(groundBodyDef)
groundBody.CreateFixture(fixtureDef)
 
bodyDef = b2BodyDef()
bodyDef.type = 2
bodyDef.position = b2Vec2(0.0, 4.0)
body.CreateFixture(fixtureDef)
 
slopeBodyDef = b2BodyDef()
slopeBodyDef.position = b2Vec2(0.0, -9.0)
slopeBody = world.CreateBody(slopeBodyDef)