Wednesday, March 10, 2010

body and updation

b2BodyDef bodyDef9c8;
bodyDef9c8.type =b2_staticBody;

bodyDef9c8.position.Set(9,9);//
//bodyDef9c8.angle=-58;
//bodyDef.userData = sprite;
b2Body* body9c8;
//= world->CreateBody(&groundBodyDef5);
body9c8 = world->CreateBody(&bodyDef9c8);

// Define another box shape for our dynamic body.
b2PolygonShape dynamicBox9c8;
dynamicBox9c8.SetAsBox(1.7f, .1f);//These are mid points for our 1m box

// Define the dynamic body fixture.
b2FixtureDef fixture9c8;
//fixture99.userData = @"Box";

fixture9c8.shape = &dynamicBox9c8;
fixture9c8.density = 0;
fixture9c8.friction = 0.3f;
fixture9c8.restitution=1.1f;
body9c8->CreateFixture(&fixture9c8);



#####################
update
###################
body0->SetTransform (b2Vec2(8,12),0);//target replaced by setXform

No comments:

FEEDJIT Live