Class LookAt

java.lang.Object
net.ixdarklord.coolcatcanvas.api.client.armature.LookAt

public final class LookAt extends Object
A joint that turns to look at something. A living entity's joints follow where it looks; anything else (a turret block, a statue's head, a held item) follows the nearest player in range unless given a target. Several joints can share the turn: lookAt("neck").weight(0.4F) and lookAt("head").weight(0.6F).
animator.lookAt("head").maxYaw(70).maxPitch(40);
animator.lookAt("turret").range(16).smoothing(0.25F);
animator.lookAt("eye").target(ctx -> someWorldPosition);
  • Method Details

    • joint

      public String joint()
    • weight

      public LookAt weight(float weight)
      How much of the turn this joint takes, 0 to 1.
    • maxYaw

      public LookAt maxYaw(float degrees)
      The furthest it turns left or right, in degrees.
    • maxPitch

      public LookAt maxPitch(float degrees)
      The furthest it tilts up or down, in degrees.
    • smoothing

      public LookAt smoothing(float seconds)
      Seconds it takes to turn most of the way to a new direction; 0 snaps. Living entities' heads are already smooth.
    • range

      public LookAt range(double blocks)
      How near a player must be to be looked at, for things without a head of their own to follow.
    • target

      public LookAt target(Function<ArmatureContext, @Nullable net.minecraft.world.phys.Vec3> target)
      What to look at, in the world; null from the function looks ahead.