Class WalkGaitParameters.LimbReachGroup

Namespace
CodeSmile.AnyMotion.AnimateYourself.Gait
/
Assembly
ApiSource.dll

O4 (knee pop): how any two-bone IK chain behaves as it approaches full extension. Read once per frame by WalkGait.Evaluate and GaitDriver.ApplyNow, then applied by IkTargetSpaceDriver.SolveTwoBone, which is the one function that solves all four limbs — so every setting here reaches both arms and both legs, and none of them is knee-specific.

[Serializable]
public sealed class WalkGaitParameters.LimbReachGroup
Expand Details ...
Inheritance
object
WalkGaitParameters.LimbReachGroup

Remarks

The arm is not a marginal case: the gait's own hand target sits at 0.974 to 0.988 of arm span for the whole cycle at the default Arms.ElbowBend of 18 degrees, so an arm is inside the softening band on every frame of an ordinary walk, with no hand target assigned. A leg's own hip-to-ankle distance varies across the stride instead, with step height and stride length, so unlike an arm a leg is not necessarily inside the band on every frame. Where a leg sits relative to the band was not measured; the figures below are arm measurements.

On an arm, soft reach replaces the authored posture rather than trimming it. Measured by calling the shipped functions at SoftReachStart 0.90 (the default at the time of measurement; the current default is 0.94, and this measurement has not been redone at that value), Arms.ElbowBend 18°, Arms.ElbowSwing 8°: the authored elbow bend runs 18.0° to 26.0° across the cycle, and the rendered one runs 38.6° to 39.2°. The rendered bend rises with the authored bend, so the two ends pair as 18.0° rendering as 38.6° and 26.0° rendering as 39.2°. At the authored 18.0° end the gait's hand target is 0.9877 of arm span, which IkTargetSpaceDriver.ClampArmReachDistance caps at 0.9800 and IkTargetSpaceDriver.SoftenReach maps to 0.9439; at the authored 26.0° end the hand target is 0.9744, which is below the cap and softens to 0.9422. The authored 8° of Arms.ElbowSwing renders as 0.61°, which is the 38.6°-to-39.2° span. With BoneStretch on at MaxBoneStretch 0.05 (its default at the time of measurement; the current default is 0.042105) the arm segments grow 4.48 %, the hand moves from 0.944 to 0.969 of span (13.7 mm on a 0.55 m arm), and the elbow bends about 5° further, from 38.6° with the stretch off to 44.0° with it on, because the softening then applies against the longer span.

This is not visible as motion. Every figure in this paragraph was measured at the same SoftReachStart 0.90 as the paragraph above; the current default is 0.94 and the measurement has not been redone at that value. The arm is inside the softening band on every frame of the cycle, so the rendered elbow bend stays within 38.6° to 39.2° for the whole cycle: the authored 8° of Arms.ElbowSwing is suppressed to 0.61°, and the elbow reads as nearly rigid. There is almost no change over time for a viewer to notice, even though the rendered angle differs from the authored one by 13.2° to 20.6° at every instant. The difference between authored and rendered is not constant — it is 20.6° at the authored 18.0° end and 13.2° at the authored 26.0° end.

Fields

BoneStretch

O4 (knee pop) from the ik-pop-flip-prevention scout report, second half of the Kovar fix whose first half is SoftReachStart. Off by default and bit-for-bit inert when off — see IkTargetSpaceDriver.ResolveStretchFactor, which returns exactly 1 for every input while this is off, so the solver's own arithmetic is unchanged rather than merely equivalent.

[Tooltip("Lets a limb's two segments grow slightly, and only inside the Soft Reach Start band, so the hand or foot reaches a distant target instead of falling short of it. Off by default: it changes the limb's visible length, which suits stylised characters more than realistic ones. Soft Reach Start alone already removes the pop; this recovers the reach that softening gives up. Applies to both arms and both legs.")]
public bool BoneStretch

Field Value

bool

MaxBoneStretch

O4: bound on BoneStretch, as a fraction of each segment's own bind-pose length rather than of the whole chain, so an unusually short shin is never given a thigh-sized absolute stretch. Applied per segment and reached only at full extension. Capped further by IkTargetSpaceDriver.ResolveStretchCeiling, which is where the cap's analytic derivation and the measurement of why a cap is needed at all are written down. The 0.042105 default is that formula's value at the shipped SoftReachStart of 0.94, which is 0.04210526, shortened to six decimal places and so still below it: the value in force and the value on the slider agree until one of the two is changed.

[Tooltip("How much longer a limb segment may become at full extension, as a fraction of its own length. The default 0.042105 adds 4.2105 percent to the thigh and 4.2105 percent to the shin, and the same 4.2105 percent to the upper arm and the forearm, so the limb reaches 4.2105 percent further and recovers part of the reach the softening gives up. Only reached at full extension, and zero at Soft Reach Start. A raised Soft Reach Start narrows the band this has to work in and lowers the value that can be used: above 0.04210526 at the default Soft Reach Start of 0.94 the limb would start to bend more as it reaches further, so the value is capped there, which is why the default sits just under it at 0.042105. Has no effect while Bone Stretch is off.")]
[Range(0, 0.1)]
public float MaxBoneStretch

Field Value

float

SoftReachStart

[Tooltip("How close to full extension a limb starts easing off its reach instead of hitting a hard limit, as a fraction of that limb's own full reach. Prevents a knee or an elbow from popping straight the instant a target passes out of reach. Lower values soften earlier and reduce the pop further, at the cost of the limb visibly falling short of a distant target sooner. Applies to both arms and both legs.")]
[Range(0, 1)]
public float SoftReachStart

Field Value

float