Enum Class FieldAxis
- All Implemented Interfaces:
Serializable,Comparable<FieldAxis>,Constable,net.minecraft.util.StringRepresentable
Defines local and topological spatial reference axes and their corresponding kinetic impulse
unit vectors relative to a reference entity's orientation and an evaluation epicenter.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>Nested classes/interfaces inherited from interface net.minecraft.util.StringRepresentable
net.minecraft.util.StringRepresentable.EnumCodec<E extends Enum<E> & net.minecraft.util.StringRepresentable>, net.minecraft.util.StringRepresentable.StringRepresentableCodec<S extends net.minecraft.util.StringRepresentable> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionPoints tangentially around theVERTICALaxis ($\vec{r} \times \hat{u}_{\text{vertical}}$), producing horizontal yaw-plane orbital motion.Aligns with the reference entity's horizontal right vector ($\text{forward} \times \text{up}$, or $+X$ if no entity is present).Aligns with the reference entity's direct line of sight (forward view vector, or $+Z$ if no entity is present).Points tangentially around theLATERALaxis ($\vec{r} \times \hat{u}_{\text{lateral}}$), producing longitudinal pitching orbital motion.Points radially outward fromoffsetEpicentertowardtargetPos.Points tangentially around theLONGITUDINALaxis ($\vec{r} \times \hat{u}_{\text{longitudinal}}$), producing lateral rolling orbital motion.Aligns with the reference entity's local up vector (or the global $+Y$ axis if no entity is present). -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<FieldAxis> Codec for serializing and deserializingFieldAxisconstants by their lowercase identifier.Fields inherited from interface net.minecraft.util.StringRepresentable
PRE_BUILT_MAP_THRESHOLD -
Method Summary
Modifier and TypeMethodDescriptionabstract net.minecraft.world.phys.Vec3getImpulseVector(net.minecraft.world.entity.Entity spatialReference, net.minecraft.world.phys.Vec3 offsetEpicenter, net.minecraft.world.phys.Vec3 targetPos) Computes the normalized kinetic impulse vector attargetPosrelative tooffsetEpicenter.abstract net.minecraft.world.phys.Vec3getReferenceAxis(net.minecraft.world.entity.Entity spatialReference) Retrieves the normalized primary reference axis vector based on the entity's orientation.@NotNull Stringstatic FieldAxisReturns the enum constant of this class with the specified name.static FieldAxis[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
VERTICAL
Aligns with the reference entity's local up vector (or the global $+Y$ axis if no entity is present). -
LONGITUDINAL
Aligns with the reference entity's direct line of sight (forward view vector, or $+Z$ if no entity is present). -
LATERAL
Aligns with the reference entity's horizontal right vector ($\text{forward} \times \text{up}$, or $+X$ if no entity is present). -
RADIAL
Points radially outward fromoffsetEpicentertowardtargetPos. -
AZIMUTHAL
Points tangentially around theVERTICALaxis ($\vec{r} \times \hat{u}_{\text{vertical}}$), producing horizontal yaw-plane orbital motion. -
NUTATIONAL
Points tangentially around theLATERALaxis ($\vec{r} \times \hat{u}_{\text{lateral}}$), producing longitudinal pitching orbital motion. -
TORSIONAL
Points tangentially around theLONGITUDINALaxis ($\vec{r} \times \hat{u}_{\text{longitudinal}}$), producing lateral rolling orbital motion.
-
-
Field Details
-
CODEC
Codec for serializing and deserializingFieldAxisconstants by their lowercase identifier.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getReferenceAxis
public abstract net.minecraft.world.phys.Vec3 getReferenceAxis(net.minecraft.world.entity.Entity spatialReference) Retrieves the normalized primary reference axis vector based on the entity's orientation.- Parameters:
spatialReference- The entity defining the local coordinate frame, ornullfor world-axis defaults.- Returns:
- The normalized direction vector.
-
getImpulseVector
public abstract net.minecraft.world.phys.Vec3 getImpulseVector(net.minecraft.world.entity.Entity spatialReference, net.minecraft.world.phys.Vec3 offsetEpicenter, net.minecraft.world.phys.Vec3 targetPos) Computes the normalized kinetic impulse vector attargetPosrelative tooffsetEpicenter.- Parameters:
spatialReference- The entity defining the local coordinate frame, ornull.offsetEpicenter- The world-space origin point of the impulse field.targetPos- The world-space position of the target being evaluated.- Returns:
- The normalized impulse direction vector, or
Vec3.ZEROif degenerate.
-
getSerializedName
- Specified by:
getSerializedNamein interfacenet.minecraft.util.StringRepresentable
-