AutoMovie API
    Preparing search index...

    Function curlChainUntilContact

    • Close articulated chains (fingers and thumb) around an object: each joint, proximal first, flexes until a capsule of its chain first touches the object's colliders or its flexion reaches the rig's range of motion, and the next joint then continues from there.

      This is the closing rule of kinematic grasp execution in grasp planners and game engines: GraspIt!'s auto-grasp closes every joint of a hand at a set rate and stops the joints proximal to a link once that link touches the object, while the distal ones keep closing (Miller and Allen 2004, IEEE Robot. Autom. Mag. 11(4):110); Unity and Unreal hand interaction systems rotate each finger bone until a sweep against the held object hits. Here the joints of a chain close one at a time, proximal to distal, which is the same stopping rule evaluated sequentially: joint k turns its phalanx and every phalanx after it as a rigid unit, so it stops at the first contact of any of them, and the joints after it close from that state.

      Each phalanx is a capsule of the chain's radius from its joint to the next joint of the chain, the last one to tip (a point in the distal bone's rest frame relative to its joint). The gap of a phalanx is the exact signed distance from its segment to each collider less the radius: the segment-to-segment distance for spheres and capsules (closestPointsBetweenSegments), and for boxes the minimum of the box's signed distance along the segment, a convex function of the segment parameter, found by golden-section search to 1e-9 of the segment. Contact is a gap of zero or less.

      Every joint's flexion is searched from its current value upward in steps of step degrees, the first step whose gap is not positive is bracketed and the bracket closed to the width 30 bisections leave (HALVINGS), by false position on the gap, which is continuous in the angle (bracketedCrossing), and by bisection for whatever width that leaves; the joint keeps the bracket's lower end, the last angle read with a positive gap, so a phalanx stops touching the collider within that resolution and never inside it. A joint already in contact does not move. A joint that meets nothing stops at the flexion the skeleton's range of motion allows (clampJointToSkeleton), so the result never needs a later clamp. Forward kinematics is the engine's resolvePose with the same axes and rest frames, so the angles read the same everywhere.

      The search is deterministic: a fixed step, a fixed bracket resolution and a fixed chain and joint order. A step larger than the thinnest part of an object can step a phalanx past it; the default of 1 degree moves a 0.1 m phalanx tip less than 2 mm.

      Parameters

      Returns IAutoMovieCurlChainUntilContact.IResult

      The curled pose and each chain's final angles and gap.

      When a chain names a bone the pose cannot resolve, the radius or step is not positive, or a collider is malformed.