ElbowController
A class in Root.Township, Alta.Character.
Character rig component that places the elbow IK hint by matching the hand's pose against a set of recorded elbow data points and averaging the best matches.
- Listed in Players and characters
- Inherits or implements
CharacterComponentController
Constructors
| Member | What it is |
|---|---|
ElbowController() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
13 private and internal fields
| Member | What it is |
|---|---|
private Vector3 averagePoint | Last computed elbow hint position in world space. |
private GameObject averagePointVisual | Debug sphere showing averagePoint. |
private List<ElbowDataPointScore> bestMatches | Sorted list of the best scoring data points this update. |
private Transform body | Backing field for Body. |
private float[] dataPointDistanceSquared | Scratch array of squared distances from the hand to each data point. |
private List<IElbowGuideDataPoint> dataPoints | Data points for this hand, mirrored where needed. |
private List<GameObject> dataPointVisuals | Debug spheres for the best matches. |
private Transform elbow | Backing field for Elbow. |
private Transform elbowTarget | Backing field for ElbowTarget. |
private HandIndex handIndex | Backing field for HandIndex. |
private Transform handTarget | Backing field for HandTarget. |
private int numberOfBestMatchedToAverage | Backing field for NumberOfBestMatchedToAverage. |
private Transform shoulder | Backing field for Shoulder. |
Properties
| Member | What it is |
|---|---|
Transform Body { get; set; } | Body transform that hand positions and data points are measured in. |
Transform Elbow { get; set; } | The elbow (forearm) bone. |
ElbowDataPointSet ElbowDataPoints { get; set; } | The shared ElbowDataPointSet on PlayerSettings. Setting it only works if none is set yet. |
Transform ElbowTarget { get; set; } | The elbow hint transform moved towards the best match each fixed update. |
HandIndex HandIndex { get; set; } | Which arm this is; data points for the other hand are mirrored. |
Transform HandTarget { get; set; } | Hand IK target used to pick matching data points. |
int NumberOfBestMatchedToAverage { get; set; } | How many of the best data points are averaged. Read from settings in Awake. |
Transform Shoulder { get; set; } | The shoulder bone. |
1 private and internal property
| Member | What it is |
|---|---|
private ElbowControllerSettings Settings { get; } | Shortcut to PlayerSettings.ElbowControllerSettings. |
Methods
| Member | What it is |
|---|---|
override void FixedUpdateCharacterComponent() | Moves the elbow target towards the best hint position at a speed from the settings curve. |
5 private and internal methods
Used in
Members of other types that take, return or hold a ElbowController: