Contents
Class HeadRotation
java.lang.Object
com.hypixel.hytale.server.core.modules.entity.component.HeadRotation
- All Implemented Interfaces:
Component<EntityStore>, Cloneable
Represents the head rotation on the entity.
-
Field Summary
FieldsFields inherited from interface Component
EMPTY_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()getAxis()org.joml.Vector3istatic org.joml.Vector3igetAxisDirection(float pitch, float yaw, org.joml.Vector3i result) org.joml.Vector3igetAxisDirection(org.joml.Vector3i result) static ComponentType<EntityStore, HeadRotation> org.joml.Vector3dorg.joml.Vector3ivoidsetRotation(Rotation3fc rotation) voidteleportRotation(Rotation3f rotation) Set the head rotation.Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Component
cloneSerializable
-
Field Details
-
CODEC
-
-
Constructor Details
-
HeadRotation
public HeadRotation() -
HeadRotation
-
-
Method Details
-
getComponentType
-
getRotation
-
setRotation
-
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
- 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
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
- Specified by:
clonein interfaceComponent<EntityStore>- Returns:
- a clone instance of the original component instance.
-