Closed noih closed 8 months ago
I followed the example in the document, and the code is as follows:
const param = RAPIER.JointData.revolute({ x: 0, y: 0 }, { x: 0, y: 0 }) param.limitsEnabled = true param.limits = [-45 * (Math.PI / 180), 45 * (Math.PI / 180)] const joint = world.createImpulseJoint(param, body1, body2, true)
body1 is a square, body2 is a long and narrow rectangle, with the joint connecting their centers, and the rectangle being larger than the square.
body1
body2
When the rectangle collides with something, the rotation angle isn't restricted. Did I misunderstand the meaning of "limits"?
https://github.com/dimforge/rapier/assets/33519169/89483811-e60d-4d96-a58e-871ece54b9ce
JS @dimforge/rapier2d 0.11.2
There was a bug with the way joint limits were specified, addressed in https://github.com/dimforge/rapier/pull/579. I recommend trying again with rapier JS 0.12, and reopen this issue if the problem persists.
I followed the example in the document, and the code is as follows:
body1
is a square,body2
is a long and narrow rectangle, with the joint connecting their centers, and the rectangle being larger than the square.When the rectangle collides with something, the rotation angle isn't restricted. Did I misunderstand the meaning of "limits"?
https://github.com/dimforge/rapier/assets/33519169/89483811-e60d-4d96-a58e-871ece54b9ce
JS @dimforge/rapier2d 0.11.2