Final IK丨 (1) Introduction and key script FullBodyBipedIK explanation

1. Term explanation

Forward motion mechanics:

By changing the parent node, the child node changes naturally, which is forward kinematics.

Inverse Kinematics IK:

By setting the state of a joint, its parent node changes after calculation. This is inverse kinematics. For example, it is more practical to use it when the feet touch different grounds and automatically calculate the body state.

 

 

Second, preview the effect

1. Import Final IK SDK, import humanoid model

2. Add FullBodyBipedIK script to the root node of the humanoid model

3. Set the left hand weight of the script to 1, and you will see a blue square in the Scene view. Run the game and drag it to see the effect.

 

 

Three, FullBodyBipedIK attribute explanation

1. Global attributes

FixTransform: Refresh the IK position (when Animator and this option are not checked, the character moves like space.)

 

Reference: There is a bone node, an example function, you can get the collision on the node as a gunshot judgment, etc.

Weight: weight, the weight of the place is the overall weight.

Iterations: The frequency of updating other nodes. When you don’t use it, you can change it to 0. In this way, you can only drag your hands manually, and your arms and bodies will not follow the refresh to move.

 

2、Body

UseThighs: Use thigh muscles, ticked by default, exercise cushioning will be softer. The effects of unchecking and checking are as follows:

Mapping:

Spine: It's the part of the abdomen (thorax). The weight should be 1, so that when rotating and stretching, the chest and abdomen will move with the body, and the chest and abdomen will not be deformed due to changes in other positions.

MaintainHeadRot: The weight of the default head animation. When it is 0, the head does not follow other positions and keeps the original animation. 1 o'clock, very soft

 

3、Arm

 Chain:

Pull: Left and right hands, one in front and one in the back (to the limit both forward and backward, similar to the state of extending the arm). The body is in the middle. The bigger the pull of someone is, the more the whole body will be drawn to whom (of course it will follow the deformation matching action) and close to whom.

Reach: Left and right hands, one in the front and one in the back (to the limit both forward and backward, similar to the state of straight arms). The thoracic cavity is in the middle. The bigger the Reach of someone is, the more the chest is drawn towards and closer to whom.

Push: Left and right hands, one at the front and one at the back (the arms are curled up, similar to cold, the mantis hands are half-shrunk on the chest). The thoracic cavity is in the middle. Whose Push is bigger, the body will be pushed back

Smoothing: a way to smooth movement 

BendGoal: The elbow (at the joints of the forearm and upper arm) turned outward. Create a new empty object and assign it to it. Control the position of this empty object and point your elbow to this position.

MappingWeight: Parent bone weight. The default is 1, when it is 0, drag the hand, the arm will not calculate the movement in reverse, only the straight movement, and the other positions of the body will calculate the movement.

MaintainHandRot: The weight of the default hand animation. When it is 0, the animation is all calculated by IK, which is very soft. When it is 1, it is the default animation (provided that the weight of the arm is 0), which is a bit violent. . .

 

 

Four, code control

Reference: FinalIK official website Full Body Biped IK

1. Total weight:

GetComponent<FullBodyBipedIK>().solver.SetIKPositionWeight(1);

2. Weight: Pull, Reach: set left and right Arm, left and right legs

GetComponent<FullBodyBipedIK>().solver.SetChainWeights(FullBodyBipedChain.LeftArm,1, 1);

3. Weight: Body position, left and right hands, feet, shoulders, thighs Thigh

GetComponent<FullBodyBipedIK>().solver.SetEffectorWeights(FullBodyBipedEffector.Body,1, 1);

Guess you like

Origin blog.csdn.net/sun124608666/article/details/111872064