Skip to content

Expose impulse joint motor max force#371

Merged
sebcrozet merged 1 commit into
dimforge:masterfrom
zdtango:codex/expose-motor-max-force
May 23, 2026
Merged

Expose impulse joint motor max force#371
sebcrozet merged 1 commit into
dimforge:masterfrom
zdtango:codex/expose-motor-max-force

Conversation

@zdtango
Copy link
Copy Markdown
Contributor

@zdtango zdtango commented May 23, 2026

Summary

Expose setMotorMaxForce(maxForce) on UnitImpulseJoint for JavaScript users.

Rapier core already exposes this through set_motor_max_force, but the JS/WASM wrapper currently exposes motor model/velocity/position configuration without exposing the separate max-force setter.

Why

This lets JS users cap solver-level joint motor force/torque directly instead of approximating motor force limits outside the joint solver. It is useful for cases like vehicle wheel motors, brakes, doors, and robotics where motor targets need a finite force limit.

Changes

  • Add RawImpulseJointSet.jointSetMotorMaxForce(...) in the wasm binding layer.
  • Add UnitImpulseJoint.setMotorMaxForce(maxForce) in the TypeScript wrapper.

Validation

  • cargo check -p dimforge_rapier3d
  • cargo fmt --check -- src/dynamics/impulse_joint.rs
  • npx prettier --check src.ts/dynamics/impulse_joint.ts

@zdtango zdtango marked this pull request as ready for review May 23, 2026 01:06
@zdtango zdtango marked this pull request as draft May 23, 2026 01:07
@zdtango zdtango marked this pull request as ready for review May 23, 2026 01:16
@sebcrozet sebcrozet merged commit 6b57282 into dimforge:master May 23, 2026
6 checks passed
@sebcrozet
Copy link
Copy Markdown
Member

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants