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

Spherical joint motors unavailable in JS #791

Open
fzembow opened this issue Jan 23, 2025 · 0 comments
Open

Spherical joint motors unavailable in JS #791

fzembow opened this issue Jan 23, 2025 · 0 comments

Comments

@fzembow
Copy link

fzembow commented Jan 23, 2025

Reading the user guide about Joint motors, it says:

Spherical, revolute, and prismatic joints support joint motors.

However, I am unable to create joint motors with a SphericalImpulseJoint.

The configureMotorVelocity() and other methods are missing. They're also missing from the JavaScript Bindings 3D Documentation, although they look like they are present in the rust version (SphericalJoint)

Perhaps these are accidentally not exposed to the WASM world?

Minimal reproduction

const RAPIER = await import('@dimforge/rapier3d')
let body1Desc = RAPIER.RigidBodyDesc.dynamic();
const body1 = world.createRigidBody(body1Desc);
let body2Desc = RAPIER.RigidBodyDesc.dynamic();
body2Desc.setTranslation(0, 1, 0);
const body2 = world.createRigidBody(body2Desc);

const jointData = RAPIER.JointData.spherical(
  { x: 0.0, y: 0.5, z: 0 },
  { x: 0.0, y: -0.5, z: 0 }
);
const joint = world.createImpulseJoint(jointData, body1, body2, true);
(joint as SphericalImpulseJoint).configureMotorVelocity(1.0, 0.5);

Results in

Uncaught TypeError: joint.configureMotorVelocity is not a function

Could it be that the JS bindings just haven't been published in a long time? I see the latest rust version is 0.23 but the version of the JS bindings on NPM is 0.14... just thinking out loud.

Thank you!

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

1 participant