A class in Root.Township, the global namespace.
After a LimbIK solve, copies a target's world rotation onto a bone, optionally clamped by its RotationLimitAngle. Needs a LimbIK on the same object.
Constructors
| Member | What it is |
|---|
RotationOverrider() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
6 private and internal fields
| Member | What it is |
|---|
private IKSolver ikSolver | The IK solver whose post-update triggers the override. Replaced in Awake with the LimbIK solver. |
private bool isUsingRotationLimit | Whether to clamp with the RotationLimitAngle. Default true. |
private RotationLimitAngle rotationLimit | RotationLimitAngle on the overridden transform, if any. |
private Transform target | Transform whose world rotation is copied. |
private GameObject test | Unused object reference. |
private Transform transformToOverride | The bone to rotate. Null means this object's transform. |
Methods
5 private and internal methods
| Member | What it is |
|---|
private void Awake() | Defaults the overridden transform to its own, gets the IK solver from LimbIK and finds the rotation limit. |
private void OnDisable() | Unhooks UpdateRotation from the solver's post-update. |
private void OnDrawGizmos() | Empty. |
private void OnEnable() | Hooks UpdateRotation to the solver's post-update. |
private void UpdateRotation() | Sets the transform's rotation to the target's, then applies the rotation limit if enabled. |