Class ArmaturePose

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

public final class ArmaturePose extends Object
How far each joint is moved from its rest this frame: what the animation layers made of it, open to modifiers before it is drawn. Values are in the units of Blockbench's animation panel: degrees and pixels, with Bedrock's axes, so rotate("head", 20, 0, 0) does what a rotation keyframe of [20, 0, 0] would. Joints are named or given by index; a name the armature doesn't have is ignored.
  • Field Details

  • Method Details

    • read

      public void read(int joint, float[] out)
      One joint's values in the model's own axes, for code that applies a pose elsewhere (CoolCatLib's vanilla models do): out[0..2] rotation in radians, [3..5] position in pixels, [6..8] scale, [9..10] bend amount and direction in radians, [12..15] how much override layers took over rotation, position, scale and bend (0 to 1), [16] 1 if hidden. Blockbench's axes: Y up, facing north.
    • bend

      public ArmaturePose bend(String joint, float degrees, float direction)
      Bends a joint along its length (a limb at its middle: an elbow, a knee), in degrees, on top of what the clips do.
      Parameters:
      direction - which way round the limb it bends, in degrees: 0 forward, 90 to its left, 180 back
    • armature

      public BakedArmature armature()
    • rotate

      public ArmaturePose rotate(String joint, float x, float y, float z)
      Turns a joint further, in degrees.
    • rotate

      public ArmaturePose rotate(int joint, float x, float y, float z)
    • setRotation

      public ArmaturePose setRotation(String joint, float x, float y, float z)
      Replaces whatever turn the animation gave a joint, in degrees.
    • rotation

      public float[] rotation(String joint)
      A joint's turn from rest, in degrees, as [x, y, z].
    • translate

      public ArmaturePose translate(String joint, float x, float y, float z)
      Moves a joint (and everything on it), in pixels.
    • translate

      public ArmaturePose translate(int joint, float x, float y, float z)
    • scale

      public ArmaturePose scale(String joint, float x, float y, float z)
      Scales a joint (and everything on it) further.
    • scale

      public ArmaturePose scale(int joint, float x, float y, float z)
    • scale

      public ArmaturePose scale(String joint, float scale)
    • hide

      public ArmaturePose hide(String joint)
      Hides a joint and everything on it for this frame only (see Animator.hide(String) to keep it hidden).