Hi guys.
I'm new to box2d and wck, but I found it very good to use.
I'm working on a project where I add bubbles to the world, what works perfectly, but when I want to add joints to each bubble than I can't figure out how to do that.
This code doesn't work as I expected:
Code:
var joint:Joint = new BubbleJoint();
joint.connectorClassName = "Connectline";
joint.type = "Distance";
joint.target1Object = newBubble; // newly created Bubble BodyShape
joint.target2Object = MLM_WORLD.B1; // old Bubble BodyShape
Util.addChildAbove(joint, newBubble);
joint.create();
The result is the bubble is sticked to the position where it has been created.
I tried to give all different parameters to the target1Object and target2Object, but none of them works.
On the other hand this code works perfectly:
Code:
var distanceJointDef:b2DistanceJointDef = new b2DistanceJointDef();
distanceJointDef.Initialize(newBubble.b2body, MLM_WORLD.B1.b2body,
newBubble.b2body.GetWorldCenter(), MLM_WORLD.B1.b2body.GetWorldCenter());
MLM_WORLD.b2world.CreateJoint(distanceJointDef);
Is there a way to make the wck version to work or there is a bug in it?
Thank you.