hello there,
I created trebuchet, but I`m not happy how it works 🙂
I think the problem is in mass of the objects (and density)
maybe you could have any idea?

for 3 distance joints i used settings:
stone:
object 1:
object 2:
and there is a revoluteJoint:
so, the point is: the more rubbish you put into object1,
the distance for throwing the stone can be longer..
but as I said it doesnt work pretty
do you have any ideas?
regards,
greg
I created trebuchet, but I`m not happy how it works 🙂
I think the problem is in mass of the objects (and density)
maybe you could have any idea?

for 3 distance joints i used settings:
Code:
the_joint.collideConnected = true;
the_joint.length = 2;
the_joint.length = 2;
stone:
Code:
.density = 2;
_masa = new b2MassData();
_masa.mass = 1;
_masa.I = 1;
_masa = new b2MassData();
_masa.mass = 1;
_masa.I = 1;
object 1:
Code:
.density = .5;
_masa.mass = 30 + (45 * numberOfRubbish);
_masa.mass.I = 1;
_masa.mass = 30 + (45 * numberOfRubbish);
_masa.mass.I = 1;
object 2:
Code:
.density = .1;
_masa.mass = 2;
_masa.I = 1;
_masa.mass = 2;
_masa.I = 1;
and there is a revoluteJoint:
Code:
var the_rev_joint:b2RevoluteJointDef = new b2RevoluteJointDef();
the_rev_joint.Initialize(object2, anchor, anchor.GetWorldCenter());
_joint = _world.CreateJoint(the_rev_joint) as b2RevoluteJoint;
the_rev_joint.Initialize(object2, anchor, anchor.GetWorldCenter());
_joint = _world.CreateJoint(the_rev_joint) as b2RevoluteJoint;
so, the point is: the more rubbish you put into object1,
the distance for throwing the stone can be longer..
but as I said it doesnt work pretty
do you have any ideas?
regards,
greg