Closed V-HuangChunMing closed 2 years ago
when i want to set length dynamicly , i find that either bodyA and bodyB transform have no changes.also the anchor and localanchor. the only change is length. I think there may something wrong or my code has bugs?
setDistanceJoint(config: { jointId: string, length: number, }) { const joint = <Box2D.b2DistanceJoint>this.checkJoint(config.jointId)?.b2Joint if (joint) { joint.SetLength(config.length); // console.log(joint.GetLength()); // console.log(joint.GetStiffness()); console.log(joint.GetAnchorA()) console.log(joint.GetAnchorB()) // console.log(joint.GetReactionForce(1)); // console.log(joint.GetReactionTorque(1)); // console.log(joint.SetMinLength(config.length)); } }
you mast set minLength and maxLength when you wants to use and not init with length
when i want to set length dynamicly , i find that either bodyA and bodyB transform have no changes.also the anchor and localanchor. the only change is length. I think there may something wrong or my code has bugs?