Skip to content

Expose revolute joints with separate local axes#372

Merged
sebcrozet merged 2 commits into
dimforge:masterfrom
zdtango:codex/revolute-with-axes
May 24, 2026
Merged

Expose revolute joints with separate local axes#372
sebcrozet merged 2 commits into
dimforge:masterfrom
zdtango:codex/revolute-with-axes

Conversation

@zdtango
Copy link
Copy Markdown
Contributor

@zdtango zdtango commented May 24, 2026

Summary

Adds a 3D JointData.revoluteWithAxes(anchor1, anchor2, axis1, axis2) constructor for creating revolute joints whose two attached rigid-bodies use different local hinge axes.

The Rust binding builds this from an existing GenericJointBuilder with the same locked-axis mask as a revolute joint, while setting local_axis1 and local_axis2 independently. The existing JointData.revolute(anchor1, anchor2, axis) path is unchanged.

Why

Some engines and asset formats represent a hinge with separate local axes on each body. Those axes can differ in local space while still describing the same world-space hinge. The current JS revolute helper only accepts one local axis, so consumers need this lower-level access to preserve authored joint frames.

Validation

  • cargo fmt --check
  • ./node_modules/.bin/prettier --check src.ts/dynamics/impulse_joint.ts
  • ./builds/prepare_builds/prepare_all_projects.sh
  • cargo check -p dimforge_rapier3d

@zdtango zdtango marked this pull request as ready for review May 24, 2026 05:26
Copy link
Copy Markdown
Member

@sebcrozet sebcrozet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you. Just need a small simplification.

Comment thread src/dynamics/joint.rs Outdated
Co-authored-by: Sébastien Crozet <sebastien@crozet.re>
@zdtango zdtango requested a review from sebcrozet May 24, 2026 18:22
@sebcrozet sebcrozet merged commit 6c7e720 into dimforge:master May 24, 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