Class HeadRotation

java.lang.Object
com.hypixel.hytale.server.core.modules.entity.component.HeadRotation
All Implemented Interfaces:
Component<EntityStore>, Cloneable

public class HeadRotation extends Object implements Component<EntityStore>
Represents the head rotation on the entity.
  • Field Details

  • Constructor Details

    • HeadRotation

      public HeadRotation()
    • HeadRotation

      public HeadRotation(@Nonnull Rotation3fc rotation)
  • Method Details

    • getComponentType

      public static ComponentType<EntityStore, HeadRotation> getComponentType()
    • getRotation

      @Nonnull public Rotation3f getRotation()
    • setRotation

      public void setRotation(@Nonnull Rotation3fc rotation)
    • getDirection

      public org.joml.Vector3d getDirection()
    • getAxisDirection

      @Nonnull public org.joml.Vector3i getAxisDirection()
      Returns:
      The direction of the rotation locked to an axis
    • getAxisDirection

      @Nonnull public org.joml.Vector3i getAxisDirection(@Nonnull org.joml.Vector3i result)
    • getHorizontalAxisDirection

      @Nonnull public org.joml.Vector3i getHorizontalAxisDirection()
      Returns:
      The horizontal direction (ignoring pitch) locked to an axis (X or Z only, never Y)
    • getAxis

      @Nonnull public Axis getAxis()
      Returns:
      The axis of the rotation
    • getAxisDirection

      @Nonnull public static org.joml.Vector3i getAxisDirection(float pitch, float yaw, @Nonnull org.joml.Vector3i result)
      Returns:
      The direction of the rotation locked to an axis
    • teleportRotation

      public void teleportRotation(@Nonnull Rotation3f rotation)
      Set the head rotation. NaN/non-finite values will be ignored.
      Parameters:
      rotation - the rotation to set, with NaN for any component that should not be set.
    • clone

      @Nonnull public HeadRotation clone()
      Specified by:
      clone in interface Component<EntityStore>
      Returns:
      a clone instance of the original component instance.