Vixen
02b45cc4
csharp
public sealed class AimGoal

An axis on a joint should point at something.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

⚠ Parameterised by angular deviation and an authored distance, not by a target point. "Point at this position" retargets badly: the same authored deviation applied from a different origin, or at a different distance, either overshoots or falls short, and it is worst exactly where it is most visible — a character spraying past the window it was authored to spray into.

So the deviation is applied to the current origin-to-frame vector and then scaled by AuthoredDistance over the current distance. Aim at something twice as far and the angular correction halves, which is what keeps the point of aim on the object rather than on the angle.

Fields and properties (6)

  • public override GoalKind Kind

    What it asks for.

  • public Vector3 Axis

    Which way the joint faces in its own space.

  • public Vector3 Origin

    Where on the joint the aim starts, in the joint's own space.

  • public Quaternion Deviation

    How far off the origin-to-frame vector the aim was authored.

  • public float AuthoredDistance

    How far away the thing being aimed at was when it was authored, in metres.

  • public float Region

    How far off it may be and still count as satisfied, in radians.

Methods (2)

  • public Vector3 Target(in Frame frame, Vector3 origin)

    Where the aim should end up pointing, given where the frame turned out to be.

  • public static Quaternion ScaleRotation(Quaternion rotation, float scale)

    The same rotation through a fraction of its angle.

Used by (7)

  • ConstraintGizmosVixen.Animation
  • ConstraintTagRecordVixen.Animation
  • ConstraintTestsVixen.Animation.Tests
  • DefaultConstraintArbiterVixen.Animation
  • RigidBodySolverVixen.Animation
  • VariationHarnessVixen.Animation
  • WeightedTestArbiterVixen.Animation.Tests