Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revolute joint limits not working #523

Closed
noih opened this issue Sep 18, 2023 · 1 comment
Closed

Revolute joint limits not working #523

noih opened this issue Sep 18, 2023 · 1 comment

Comments

@noih
Copy link

noih commented Sep 18, 2023

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.

When the rectangle collides with something, the rotation angle isn't restricted. Did I misunderstand the meaning of "limits"?

clip.mov

JS @dimforge/rapier2d 0.11.2

@noih noih changed the title Revolute limits not working Revolute joint limits not working Sep 18, 2023
@sebcrozet
Copy link
Member

sebcrozet commented Jan 28, 2024

There was a bug with the way joint limits were specified, addressed in #579. I recommend trying again with rapier JS 0.12, and reopen this issue if the problem persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants