Skip to content

CCDIKSolver: Fix limitation handling.#33386

Merged
Mugen87 merged 1 commit into
mrdoob:devfrom
Mugen87:dev5
Apr 14, 2026
Merged

CCDIKSolver: Fix limitation handling.#33386
Mugen87 merged 1 commit into
mrdoob:devfrom
Mugen87:dev5

Conversation

@Mugen87

@Mugen87 Mugen87 commented Apr 14, 2026

Copy link
Copy Markdown
Collaborator

Fixed #25338.

Description

The PR fixes a sign-loss bug in CCDIKSolver's limitation handling. The previous code rebuilt the quaternion using √(1−w²), which is always non-negative, so any rotation past 0° around the limitation axis got mirrored to the positive side (you can clearly see this buggy behavior in #25338 (comment)).

The PR projects the quaternion's vector part onto the limitation axis and preserves that sign, so negative rotations stay negative. This restores the expected +-range when limitation is combined with rotationMin/rotationMax.

I've migrated the old example code so it was possible to do a test and with the fix in place. The demo works now as expected.

Bildschirmaufnahme.2026-04-14.um.13.21.40.mov

@Mugen87 Mugen87 added this to the r184 milestone Apr 14, 2026
@Mugen87 Mugen87 merged commit b61142f into mrdoob:dev Apr 14, 2026
9 checks passed
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.

CCD IK does not honor bones (joints) rotation limits

1 participant