Skip to main content

ArmIKController

A class in Root.Township, Alta.Character.

Arm controller that runs the Final IK limb solver and the game's clavicle, twist, elbow and shoulder controllers in a fixed order each fixed update.

Constructors​

MemberWhat it is
ArmIKController()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

8 private and internal fields
MemberWhat it is
private ClavicleController clavicleControllerBacking field for ClavicleController.
private TwistRelaxer clavicleTwistRelaxerBacking field for ClavicleTwistRelaxer.
private ElbowController elbowControllerBacking field for ElbowController.
private bool isGettingControllersInspector-only field that draws the Get Controllers button.
private LimbIK limbIKBacking field for LimbIK.
private RotationLimitWrapper rotationLimitWrapperWrapper that applies the wrist rotation limit.
private ShoulderTwistController shoulderTwistControllerBacking field for ShoulderTwistController.
private TwistRelaxerController twistRelaxerControllerBacking field for TwistRelaxerController.

Properties​

MemberWhat it is
ClavicleController ClavicleController { get; set; }Controller that rotates the clavicle towards the targets.
TwistRelaxer ClavicleTwistRelaxer { get; set; }Final IK twist relaxer on the clavicle.
ElbowController ElbowController { get; set; }Controller that places the elbow bend goal.
LimbIK LimbIK { get; set; }The Final IK LimbIK solver for this arm, updated externally.
ShoulderTwistController ShoulderTwistController { get; set; }Controller that limits shoulder twist.
TwistRelaxerController TwistRelaxerController { get; set; }Controller that relaxes forearm twist.

Events​

MemberWhat it is
event UpdateHandler PostIKUpdateFired after the arm's IK and controllers have run in a fixed update.
event UpdateHandler PostPostIKUpdateFired right after PostIKUpdate, for work that must run after it.

Methods​

MemberWhat it is
override void FixedUpdateCharacterComponent()Runs clavicle, limb IK, rotation limit, twist relaxers, elbow and shoulder twist, then fires PostIKUpdate and PostPostIKUpdate.
void SetActive(bool isActive)Enables or disables this controller and its clavicle, limb IK, twist relaxers and elbow controller.
2 private and internal methods
MemberWhat it is
private void GetControllers()Editor: fills the controller fields from components on this object and sets the limb bend modifier to Goal.
private void OnValidate()Editor: runs GetControllers when the inspector button is pressed.