Sorry if this has been brought up before but I'm having issues with circles sticking to walls as illustrated in the example below: (i.e. I'm looking to get the circle to bounce aroud continuously at the correct angle)
http://www.inboxwork.co.uk/box2d/PhysTest.html
I've tried tweaking various parameters for both the wall and the circle including restitution but haven't found a solution yet.
The walls are default TestBed and the circle is made using:
Can anyone help?
Thanks
Dave
http://www.inboxwork.co.uk/box2d/PhysTest.html
I've tried tweaking various parameters for both the wall and the circle including restitution but haven't found a solution yet.
The walls are default TestBed and the circle is made using:
Code:
var cd:b2CircleDef = new b2CircleDef();
cd.radius = 10 / m_physScale;
cd.density = 1;
cd.restitution = 1;
bd = new b2BodyDef();
bd.position.Set(250/m_physScale, 300/m_physScale );
body = m_world.CreateBody(bd);
body.CreateShape(cd);
body.SetMassFromShapes();
body.ApplyImpulse(new b2Vec2(1, 0.3), body.GetWorldCenter());
cd.radius = 10 / m_physScale;
cd.density = 1;
cd.restitution = 1;
bd = new b2BodyDef();
bd.position.Set(250/m_physScale, 300/m_physScale );
body = m_world.CreateBody(bd);
body.CreateShape(cd);
body.SetMassFromShapes();
body.ApplyImpulse(new b2Vec2(1, 0.3), body.GetWorldCenter());
Can anyone help?
Thanks
Dave