Class PlayerPose

java.lang.Object
lol.trq.helios.model.PlayerPose

public final class PlayerPose extends Object
What a player model's attachment points depend on, for one frame: position, the body and head angles interpolated to the frame, and the states that move parts of the 1.8.9 model. Mutable and reused, so reading a pose each frame allocates nothing. MinecraftPlayerPose fills one from a live player.

Angles are in degrees, as Minecraft stores them: yaw 0 faces +Z (south) and grows clockwise seen from above; pitch is positive looking down.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    float
    Body yaw (renderYawOffset), interpolated to the frame.
    boolean
    Whether a chestplate is worn: back attachments sit on the armour, one model pixel out.
    boolean
    Whether this is the player the client controls.
    float
    Head yaw (rotationYawHead), interpolated to the frame.
    boolean
    Whether a helmet is worn: head attachments sit on the armour, one model pixel out.
    float
    Body yaw of the living entity being ridden, interpolated to the frame, or NaN when not riding one.
    float
    Head pitch (rotationPitch), interpolated to the frame.
    boolean
    Whether the player is sneaking.
    double
    Feet position relative to the camera, x.
    double
    Feet position relative to the camera, y.
    double
    Feet position relative to the camera, z.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Resets to a player standing at the camera, facing south, with nothing worn.
    boolean
    Returns whether the player rides a living entity.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • x

      public double x
      Feet position relative to the camera, x.
    • y

      public double y
      Feet position relative to the camera, y.
    • z

      public double z
      Feet position relative to the camera, z.
    • bodyYaw

      public float bodyYaw
      Body yaw (renderYawOffset), interpolated to the frame.
    • headYaw

      public float headYaw
      Head yaw (rotationYawHead), interpolated to the frame.
    • pitch

      public float pitch
      Head pitch (rotationPitch), interpolated to the frame.
    • sneaking

      public boolean sneaking
      Whether the player is sneaking.
    • clientPlayer

      public boolean clientPlayer
      Whether this is the player the client controls. Vanilla lowers every other sneaking player by 0.125 blocks, but not this one.
    • mountYaw

      public float mountYaw
      Body yaw of the living entity being ridden, interpolated to the frame, or NaN when not riding one. Riding clamps how far the body turns from the mount, as vanilla does.
    • helmet

      public boolean helmet
      Whether a helmet is worn: head attachments sit on the armour, one model pixel out.
    • chestplate

      public boolean chestplate
      Whether a chestplate is worn: back attachments sit on the armour, one model pixel out.
  • Constructor Details

    • PlayerPose

      public PlayerPose()
  • Method Details

    • reset

      public PlayerPose reset()
      Resets to a player standing at the camera, facing south, with nothing worn.
      Returns:
      this pose
    • riding

      public boolean riding()
      Returns whether the player rides a living entity.
      Returns:
      true when mountYaw is set