Feat: Add per-joint finger pose API#148
Open
1001Bits wants to merge 1 commit into
Open
Conversation
Expose per-joint finger control through the public API. The existing setHandPoseCustomFingerPositions accepts 5 per-finger values that get duplicated across all 3 joints. The new setHandPoseCustomJointPositions accepts 15 values (3 per finger: proximal, medial, distal) for fine-grained control needed by mods like Heisenberg (HIGGS F4VR port) that animate individual finger joints during object grabbing. Internally, FRIK already supports per-joint values (setHandPoseOverride, HAND_FINGERS_POINTING_POSE, etc.) — this just exposes it through the API. API version bumped from 2 to 3. Fully backward compatible: the new function pointer is appended at the end of FRIKApi, existing v2 mods are unaffected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
setHandPoseCustomJointPositions(tag, hand, values[15])to the FRIK API for per-joint finger controlMotivation
The existing
setHandPoseCustomFingerPositionsduplicates a single value across all 3 joints of each finger. This works for simple poses but doesn't allow independent joint control needed for realistic object gripping (e.g. wrapping fingers around items of different sizes).FRIK internally already supports per-joint values —
setHandPoseOverride(),HAND_FINGERS_POINTING_POSE[15], andcalculateHandPose()all work per-bone. This PR simply exposes that capability through the public API.Changes
FRIK_API_VERSIONto 3, addsetHandPoseCustomJointPositionsfunction pointersetFingerJointPositions(isLeft, values[15])internal functionValue ordering
Matches internal
LEFT_HAND_FINGERS[]/RIGHT_HAND_FINGERS[]bone order. Values 0.0 = bent, 1.0 = straight.Backward compatibility
New function pointer appended at end of
FRIKApistruct. Existing v2 mods never access it.clearHandPose()works unchanged for both old and new API paths.