Hello.
Once again I am having trouble with physics.
I have this code:
It gives me the error:
Here is my entire code for making a floor object:
What's wrong?
Once again I am having trouble with physics.
I have this code:
Code:
bound->CreateShape(bounddef);
It gives me the error:
No member named 'CreateShape' in 'b2body'
Here is my entire code for making a floor object:
Code:
-(void)makebound {
b2PolygonShape bounddef;
b2FixtureDef boundfix;
b2BodyDef boundbodydef;
b2Body* bound;
b2Vec2 verticies [4];
b2Vec2(verticies [0]).Set(0 / ratio, 0 / ratio);
b2Vec2(verticies [1]).Set(550 / ratio, 0 / ratio);
b2Vec2(verticies [2]).Set(550 / ratio, 10 / ratio);
b2Vec2(verticies [3]).Set(0 / ratio, 10 / ratio);
bounddef.Set(verticies, 6);
boundfix.shape=&bounddef;
boundfix.density = 0.0;
boundfix.friction=0.5;
boundfix.restitution = 0.3;
bound->CreateFixture(&boundfix);
boundbodydef.position.Set(0 / ratio, 390 / ratio);
bound = World->CreateBody(&boundbodydef);
bound->CreateShape(bounddef);
}
What's wrong?