Class Vec3d

java.lang.Object
net.minecraft.util.math.Vec3d
All Implemented Interfaces:
Position

public class Vec3d extends Object implements Position
An immutable vector composed of 3 doubles.

This vector class is used for representing position, velocity, rotation, color, etc.

This vector has proper hashCode() and equals(Object) implementations and can be used as a map key.

See Also:
Mappings:
Namespace Name
named net/minecraft/util/math/Vec3d
intermediary net/minecraft/class_243
official frd
  • Field Details

    • CODEC

      public static final com.mojang.serialization.Codec<Vec3d> CODEC
      Mappings:
      Namespace Name Mixin selector
      named CODEC Lnet/minecraft/util/math/Vec3d;CODEC:Lcom/mojang/serialization/Codec;
      intermediary field_38277 Lnet/minecraft/class_243;field_38277:Lcom/mojang/serialization/Codec;
      official a Lfrd;a:Lcom/mojang/serialization/Codec;
    • PACKET_CODEC

      public static final PacketCodec<ByteBuf,Vec3d> PACKET_CODEC
      Mappings:
      Namespace Name Mixin selector
      named PACKET_CODEC Lnet/minecraft/util/math/Vec3d;PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;
      intermediary field_52694 Lnet/minecraft/class_243;field_52694:Lnet/minecraft/class_9139;
      official b Lfrd;b:Laat;
    • ZERO

      public static final Vec3d ZERO
      The zero vector (0, 0, 0).
      Mappings:
      Namespace Name Mixin selector
      named ZERO Lnet/minecraft/util/math/Vec3d;ZERO:Lnet/minecraft/util/math/Vec3d;
      intermediary field_1353 Lnet/minecraft/class_243;field_1353:Lnet/minecraft/class_243;
      official c Lfrd;c:Lfrd;
    • X

      public static final Vec3d X
      Mappings:
      Namespace Name Mixin selector
      named X Lnet/minecraft/util/math/Vec3d;X:Lnet/minecraft/util/math/Vec3d;
      intermediary field_61914 Lnet/minecraft/class_243;field_61914:Lnet/minecraft/class_243;
      official d Lfrd;d:Lfrd;
    • Y

      public static final Vec3d Y
      Mappings:
      Namespace Name Mixin selector
      named Y Lnet/minecraft/util/math/Vec3d;Y:Lnet/minecraft/util/math/Vec3d;
      intermediary field_61915 Lnet/minecraft/class_243;field_61915:Lnet/minecraft/class_243;
      official e Lfrd;e:Lfrd;
    • Z

      public static final Vec3d Z
      Mappings:
      Namespace Name Mixin selector
      named Z Lnet/minecraft/util/math/Vec3d;Z:Lnet/minecraft/util/math/Vec3d;
      intermediary field_61916 Lnet/minecraft/class_243;field_61916:Lnet/minecraft/class_243;
      official f Lfrd;f:Lfrd;
    • x

      public final double x
      The X coordinate of this vector.
      Mappings:
      Namespace Name Mixin selector
      named x Lnet/minecraft/util/math/Vec3d;x:D
      intermediary field_1352 Lnet/minecraft/class_243;field_1352:D
      official g Lfrd;g:D
    • y

      public final double y
      The Y coordinate of this vector.
      Mappings:
      Namespace Name Mixin selector
      named y Lnet/minecraft/util/math/Vec3d;y:D
      intermediary field_1351 Lnet/minecraft/class_243;field_1351:D
      official h Lfrd;h:D
    • z

      public final double z
      The Z coordinate of this vector.
      Mappings:
      Namespace Name Mixin selector
      named z Lnet/minecraft/util/math/Vec3d;z:D
      intermediary field_1350 Lnet/minecraft/class_243;field_1350:D
      official i Lfrd;i:D
  • Constructor Details

    • Vec3d

      public Vec3d(double x, double y, double z)
      Creates a vector of the given coordinates.
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/util/math/Vec3d;<init>(DDD)V
      intermediary <init> Lnet/minecraft/class_243;<init>(DDD)V
      official <init> Lfrd;<init>(DDD)V
    • Vec3d

      public Vec3d(Vector3fc vec)
      Copies the given vector.
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/util/math/Vec3d;<init>(Lorg/joml/Vector3fc;)V
      intermediary <init> Lnet/minecraft/class_243;<init>(Lorg/joml/Vector3fc;)V
      official <init> Lfrd;<init>(Lorg/joml/Vector3fc;)V
    • Vec3d

      public Vec3d(Vec3i vec)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/util/math/Vec3d;<init>(Lnet/minecraft/util/math/Vec3i;)V
      intermediary <init> Lnet/minecraft/class_243;<init>(Lnet/minecraft/class_2382;)V
      official <init> Lfrd;<init>(Lke;)V
  • Method Details

    • of

      public static Vec3d of(Vec3i vec)
      Copies the given vector.
      Mappings:
      Namespace Name Mixin selector
      named of Lnet/minecraft/util/math/Vec3d;of(Lnet/minecraft/util/math/Vec3i;)Lnet/minecraft/util/math/Vec3d;
      intermediary method_24954 Lnet/minecraft/class_243;method_24954(Lnet/minecraft/class_2382;)Lnet/minecraft/class_243;
      official a Lfrd;a(Lke;)Lfrd;
    • add

      public static Vec3d add(Vec3i vec, double deltaX, double deltaY, double deltaZ)
      Returns a new vector from vec with deltaX, deltaY, and deltaZ added to X, Y, Z values, respectively.
      Returns:
      a new vector from vec with deltaX, deltaY, and deltaZ added to X, Y, Z values, respectively
      Mappings:
      Namespace Name Mixin selector
      named add Lnet/minecraft/util/math/Vec3d;add(Lnet/minecraft/util/math/Vec3i;DDD)Lnet/minecraft/util/math/Vec3d;
      intermediary method_49273 Lnet/minecraft/class_243;method_49273(Lnet/minecraft/class_2382;DDD)Lnet/minecraft/class_243;
      official a Lfrd;a(Lke;DDD)Lfrd;
    • ofCenter

      public static Vec3d ofCenter(Vec3i vec)
      Creates a vector representing the center of the given block position.
      Mappings:
      Namespace Name Mixin selector
      named ofCenter Lnet/minecraft/util/math/Vec3d;ofCenter(Lnet/minecraft/util/math/Vec3i;)Lnet/minecraft/util/math/Vec3d;
      intermediary method_24953 Lnet/minecraft/class_243;method_24953(Lnet/minecraft/class_2382;)Lnet/minecraft/class_243;
      official b Lfrd;b(Lke;)Lfrd;
    • ofBottomCenter

      public static Vec3d ofBottomCenter(Vec3i vec)
      Creates a vector representing the bottom center of the given block position.

      The bottom center of a block position pos is (pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5).

      See Also:
      Mappings:
      Namespace Name Mixin selector
      named ofBottomCenter Lnet/minecraft/util/math/Vec3d;ofBottomCenter(Lnet/minecraft/util/math/Vec3i;)Lnet/minecraft/util/math/Vec3d;
      intermediary method_24955 Lnet/minecraft/class_243;method_24955(Lnet/minecraft/class_2382;)Lnet/minecraft/class_243;
      official c Lfrd;c(Lke;)Lfrd;
    • ofCenter

      public static Vec3d ofCenter(Vec3i vec, double deltaY)
      Creates a vector representing the center of the given block position but with the given offset for the Y coordinate.
      Returns:
      a vector of (vec.getX() + 0.5, vec.getY() + deltaY, vec.getZ() + 0.5)
      Mappings:
      Namespace Name Mixin selector
      named ofCenter Lnet/minecraft/util/math/Vec3d;ofCenter(Lnet/minecraft/util/math/Vec3i;D)Lnet/minecraft/util/math/Vec3d;
      intermediary method_26410 Lnet/minecraft/class_243;method_26410(Lnet/minecraft/class_2382;D)Lnet/minecraft/class_243;
      official a Lfrd;a(Lke;D)Lfrd;
    • relativize

      public Vec3d relativize(Vec3d vec)
      Subtracts this vector from the given vector.
      Returns:
      the difference between the given vector and this vector
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named relativize Lnet/minecraft/util/math/Vec3d;relativize(Lnet/minecraft/util/math/Vec3d;)Lnet/minecraft/util/math/Vec3d;
      intermediary method_1035 Lnet/minecraft/class_243;method_1035(Lnet/minecraft/class_243;)Lnet/minecraft/class_243;
      official a Lfrd;a(Lfrd;)Lfrd;
    • normalize

      public Vec3d normalize()
      Normalizes this vector.

      Normalized vector is a vector with the same direction but with length 1. Each coordinate of normalized vector has value between 0 and 1.

      Returns:
      the normalized vector of this vector
      Mappings:
      Namespace Name Mixin selector
      named normalize Lnet/minecraft/util/math/Vec3d;normalize()Lnet/minecraft/util/math/Vec3d;
      intermediary method_1029 Lnet/minecraft/class_243;method_1029()Lnet/minecraft/class_243;
      official d Lfrd;d()Lfrd;
    • dotProduct

      public double dotProduct(Vec3d vec)
      Returns the dot product of this vector and the given vector.
      Mappings:
      Namespace Name Mixin selector
      named dotProduct Lnet/minecraft/util/math/Vec3d;dotProduct(Lnet/minecraft/util/math/Vec3d;)D
      intermediary method_1026 Lnet/minecraft/class_243;method_1026(Lnet/minecraft/class_243;)D
      official b Lfrd;b(Lfrd;)D
    • crossProduct

      public Vec3d crossProduct(Vec3d vec)
      Returns the cross product of this vector and the given vector.
      Mappings:
      Namespace Name Mixin selector
      named crossProduct Lnet/minecraft/util/math/Vec3d;crossProduct(Lnet/minecraft/util/math/Vec3d;)Lnet/minecraft/util/math/Vec3d;
      intermediary method_1036 Lnet/minecraft/class_243;method_1036(Lnet/minecraft/class_243;)Lnet/minecraft/class_243;
      official c Lfrd;c(Lfrd;)Lfrd;
    • subtract

      public Vec3d subtract(Vec3d vec)
      Subtracts the given vector from this vector.
      Returns:
      the difference between this vector and the given vector
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named subtract Lnet/minecraft/util/math/Vec3d;subtract(Lnet/minecraft/util/math/Vec3d;)Lnet/minecraft/util/math/Vec3d;
      intermediary method_1020 Lnet/minecraft/class_243;method_1020(Lnet/minecraft/class_243;)Lnet/minecraft/class_243;
      official d Lfrd;d(Lfrd;)Lfrd;
    • subtract

      public Vec3d subtract(double value)
      Mappings:
      Namespace Name Mixin selector
      named subtract Lnet/minecraft/util/math/Vec3d;subtract(D)Lnet/minecraft/util/math/Vec3d;
      intermediary method_61888 Lnet/minecraft/class_243;method_61888(D)Lnet/minecraft/class_243;
      official a Lfrd;a(D)Lfrd;
    • subtract

      public Vec3d subtract(double x, double y, double z)
      Subtracts the given vector from this vector.
      Returns:
      the difference between this vector and the given vector
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named subtract Lnet/minecraft/util/math/Vec3d;subtract(DDD)Lnet/minecraft/util/math/Vec3d;
      intermediary method_1023 Lnet/minecraft/class_243;method_1023(DDD)Lnet/minecraft/class_243;
      official a Lfrd;a(DDD)Lfrd;
    • add

      public Vec3d add(double value)
      Mappings:
      Namespace Name Mixin selector
      named add Lnet/minecraft/util/math/Vec3d;add(D)Lnet/minecraft/util/math/Vec3d;
      intermediary method_61889 Lnet/minecraft/class_243;method_61889(D)Lnet/minecraft/class_243;
      official b Lfrd;b(D)Lfrd;
    • add

      public Vec3d add(Vec3d vec)
      Returns the sum of this vector and the given vector.
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named add Lnet/minecraft/util/math/Vec3d;add(Lnet/minecraft/util/math/Vec3d;)Lnet/minecraft/util/math/Vec3d;
      intermediary method_1019 Lnet/minecraft/class_243;method_1019(Lnet/minecraft/class_243;)Lnet/minecraft/class_243;
      official e Lfrd;e(Lfrd;)Lfrd;
    • add

      public Vec3d add(double x, double y, double z)
      Returns the sum of this vector and the given vector.
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named add Lnet/minecraft/util/math/Vec3d;add(DDD)Lnet/minecraft/util/math/Vec3d;
      intermediary method_1031 Lnet/minecraft/class_243;method_1031(DDD)Lnet/minecraft/class_243;
      official b Lfrd;b(DDD)Lfrd;
    • isInRange

      public boolean isInRange(Position pos, double radius)
      Checks if the distance between this vector and the given position is less than radius.
      Mappings:
      Namespace Name Mixin selector
      named isInRange Lnet/minecraft/util/math/Vec3d;isInRange(Lnet/minecraft/util/math/Position;D)Z
      intermediary method_24802 Lnet/minecraft/class_243;method_24802(Lnet/minecraft/class_2374;D)Z
      official a Lfrd;a(Ljt;D)Z
    • distanceTo

      public double distanceTo(Vec3d vec)
      Returns the distance between this vector and the given vector.
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named distanceTo Lnet/minecraft/util/math/Vec3d;distanceTo(Lnet/minecraft/util/math/Vec3d;)D
      intermediary method_1022 Lnet/minecraft/class_243;method_1022(Lnet/minecraft/class_243;)D
      official f Lfrd;f(Lfrd;)D
    • squaredDistanceTo

      public double squaredDistanceTo(Vec3d vec)
      Returns the squared distance between this vector and the given vector.

      Can be used for fast comparison between distances.

      See Also:
      Mappings:
      Namespace Name Mixin selector
      named squaredDistanceTo Lnet/minecraft/util/math/Vec3d;squaredDistanceTo(Lnet/minecraft/util/math/Vec3d;)D
      intermediary method_1025 Lnet/minecraft/class_243;method_1025(Lnet/minecraft/class_243;)D
      official g Lfrd;g(Lfrd;)D
    • squaredDistanceTo

      public double squaredDistanceTo(double x, double y, double z)
      Returns the squared distance between this vector and the given vector.

      Can be used for fast comparison between distances.

      See Also:
      Mappings:
      Namespace Name Mixin selector
      named squaredDistanceTo Lnet/minecraft/util/math/Vec3d;squaredDistanceTo(DDD)D
      intermediary method_1028 Lnet/minecraft/class_243;method_1028(DDD)D
      official c Lfrd;c(DDD)D
    • isWithinRangeOf

      public boolean isWithinRangeOf(Vec3d vec, double horizontalRange, double verticalRange)
      Mappings:
      Namespace Name Mixin selector
      named isWithinRangeOf Lnet/minecraft/util/math/Vec3d;isWithinRangeOf(Lnet/minecraft/util/math/Vec3d;DD)Z
      intermediary method_55230 Lnet/minecraft/class_243;method_55230(Lnet/minecraft/class_243;DD)Z
      official a Lfrd;a(Lfrd;DD)Z
    • multiply

      public Vec3d multiply(double value)
      Return a vector whose coordinates are the coordinates of this vector each multiplied by the given scalar value.
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named multiply Lnet/minecraft/util/math/Vec3d;multiply(D)Lnet/minecraft/util/math/Vec3d;
      intermediary method_1021 Lnet/minecraft/class_243;method_1021(D)Lnet/minecraft/class_243;
      official c Lfrd;c(D)Lfrd;
    • negate

      public Vec3d negate()
      Creates a vector with the same length but with the opposite direction.
      Mappings:
      Namespace Name Mixin selector
      named negate Lnet/minecraft/util/math/Vec3d;negate()Lnet/minecraft/util/math/Vec3d;
      intermediary method_22882 Lnet/minecraft/class_243;method_22882()Lnet/minecraft/class_243;
      official e Lfrd;e()Lfrd;
    • multiply

      public Vec3d multiply(Vec3d vec)
      Returns a vector whose coordinates are the product of each pair of coordinates in this vector and the given vector.
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named multiply Lnet/minecraft/util/math/Vec3d;multiply(Lnet/minecraft/util/math/Vec3d;)Lnet/minecraft/util/math/Vec3d;
      intermediary method_18806 Lnet/minecraft/class_243;method_18806(Lnet/minecraft/class_243;)Lnet/minecraft/class_243;
      official h Lfrd;h(Lfrd;)Lfrd;
    • multiply

      public Vec3d multiply(double x, double y, double z)
      Returns a vector whose coordinates are the product of each pair of coordinates in this vector and the given vector.
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named multiply Lnet/minecraft/util/math/Vec3d;multiply(DDD)Lnet/minecraft/util/math/Vec3d;
      intermediary method_18805 Lnet/minecraft/class_243;method_18805(DDD)Lnet/minecraft/class_243;
      official d Lfrd;d(DDD)Lfrd;
    • getHorizontal

      public Vec3d getHorizontal()
      Mappings:
      Namespace Name Mixin selector
      named getHorizontal Lnet/minecraft/util/math/Vec3d;getHorizontal()Lnet/minecraft/util/math/Vec3d;
      intermediary method_61890 Lnet/minecraft/class_243;method_61890()Lnet/minecraft/class_243;
      official f Lfrd;f()Lfrd;
    • addRandom

      public Vec3d addRandom(Random random, float multiplier)
      Returns a vector with each value added by random.nextFloat() - 0.5f) * multiplier.
      Returns:
      a vector with each value added by random.nextFloat() - 0.5f) * multiplier
      Mappings:
      Namespace Name Mixin selector
      named addRandom Lnet/minecraft/util/math/Vec3d;addRandom(Lnet/minecraft/util/math/random/Random;F)Lnet/minecraft/util/math/Vec3d;
      intermediary method_49272 Lnet/minecraft/class_243;method_49272(Lnet/minecraft/class_5819;F)Lnet/minecraft/class_243;
      official a Lfrd;a(Lbgq;F)Lfrd;
    • addHorizontalRandom

      public Vec3d addHorizontalRandom(Random random, float multiplier)
      Mappings:
      Namespace Name Mixin selector
      named addHorizontalRandom Lnet/minecraft/util/math/Vec3d;addHorizontalRandom(Lnet/minecraft/util/math/random/Random;F)Lnet/minecraft/util/math/Vec3d;
      intermediary method_75276 Lnet/minecraft/class_243;method_75276(Lnet/minecraft/class_5819;F)Lnet/minecraft/class_243;
      official b Lfrd;b(Lbgq;F)Lfrd;
    • length

      public double length()
      Returns the length of this vector.

      The length of a vector is equivalent to the distance between that vector and the ZERO vector.

      Returns:
      the length of this vector
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named length Lnet/minecraft/util/math/Vec3d;length()D
      intermediary method_1033 Lnet/minecraft/class_243;method_1033()D
      official g Lfrd;g()D
    • lengthSquared

      public double lengthSquared()
      Returns the squared length of this vector.

      Can be used for fast comparison between lengths.

      Returns:
      the squared length of this vector
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named lengthSquared Lnet/minecraft/util/math/Vec3d;lengthSquared()D
      intermediary method_1027 Lnet/minecraft/class_243;method_1027()D
      official h Lfrd;h()D
    • horizontalLength

      public double horizontalLength()
      Returns the horizontal length of this vector.

      This length is same as the length of a 2-vector with the x and z components of this vector, or the euclidean distance between (x, z) and the origin.

      Returns:
      the horizontal length of this vector
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named horizontalLength Lnet/minecraft/util/math/Vec3d;horizontalLength()D
      intermediary method_37267 Lnet/minecraft/class_243;method_37267()D
      official i Lfrd;i()D
    • horizontalLengthSquared

      public double horizontalLengthSquared()
      Returns the squared horizontal length of this vector.

      Can be used for fast comparison between horizontal lengths.

      Returns:
      the squared horizontal length of this vector
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named horizontalLengthSquared Lnet/minecraft/util/math/Vec3d;horizontalLengthSquared()D
      intermediary method_37268 Lnet/minecraft/class_243;method_37268()D
      official j Lfrd;j()D
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
      Mappings:
      Namespace Name Mixin selector
      named equals Lnet/minecraft/util/math/Vec3d;equals(Ljava/lang/Object;)Z
      intermediary equals Lnet/minecraft/class_243;equals(Ljava/lang/Object;)Z
      official equals Lfrd;equals(Ljava/lang/Object;)Z
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • lerp

      public Vec3d lerp(Vec3d to, double delta)
      Performs linear interpolation from this vector to the given vector.
      Parameters:
      to - the vector to interpolate to
      delta - the interpolation coefficient in the range between 0 and 1
      Mappings:
      Namespace Name Mixin selector
      named lerp Lnet/minecraft/util/math/Vec3d;lerp(Lnet/minecraft/util/math/Vec3d;D)Lnet/minecraft/util/math/Vec3d;
      intermediary method_35590 Lnet/minecraft/class_243;method_35590(Lnet/minecraft/class_243;D)Lnet/minecraft/class_243;
      official a Lfrd;a(Lfrd;D)Lfrd;
    • rotateX

      public Vec3d rotateX(float angle)
      Rotates this vector by the given angle counterclockwise around the X axis.
      Parameters:
      angle - the angle in radians
      Mappings:
      Namespace Name Mixin selector
      named rotateX Lnet/minecraft/util/math/Vec3d;rotateX(F)Lnet/minecraft/util/math/Vec3d;
      intermediary method_1037 Lnet/minecraft/class_243;method_1037(F)Lnet/minecraft/class_243;
      official a Lfrd;a(F)Lfrd;
    • rotateY

      public Vec3d rotateY(float angle)
      Rotates this vector by the given angle counterclockwise around the Y axis.
      Parameters:
      angle - the angle in radians
      Mappings:
      Namespace Name Mixin selector
      named rotateY Lnet/minecraft/util/math/Vec3d;rotateY(F)Lnet/minecraft/util/math/Vec3d;
      intermediary method_1024 Lnet/minecraft/class_243;method_1024(F)Lnet/minecraft/class_243;
      official b Lfrd;b(F)Lfrd;
    • rotateZ

      public Vec3d rotateZ(float angle)
      Rotates this vector by the given angle counterclockwise around the Z axis.
      Parameters:
      angle - the angle in radians
      Mappings:
      Namespace Name Mixin selector
      named rotateZ Lnet/minecraft/util/math/Vec3d;rotateZ(F)Lnet/minecraft/util/math/Vec3d;
      intermediary method_31033 Lnet/minecraft/class_243;method_31033(F)Lnet/minecraft/class_243;
      official c Lfrd;c(F)Lfrd;
    • rotateYClockwise

      public Vec3d rotateYClockwise()
      Mappings:
      Namespace Name Mixin selector
      named rotateYClockwise Lnet/minecraft/util/math/Vec3d;rotateYClockwise()Lnet/minecraft/util/math/Vec3d;
      intermediary method_70762 Lnet/minecraft/class_243;method_70762()Lnet/minecraft/class_243;
      official k Lfrd;k()Lfrd;
    • fromPolar

      public static Vec3d fromPolar(Vec2f polar)
      Converts pitch and yaw into a direction vector.
      Parameters:
      polar - the vector composed of pitch and yaw
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named fromPolar Lnet/minecraft/util/math/Vec3d;fromPolar(Lnet/minecraft/util/math/Vec2f;)Lnet/minecraft/util/math/Vec3d;
      intermediary method_1034 Lnet/minecraft/class_243;method_1034(Lnet/minecraft/class_241;)Lnet/minecraft/class_243;
      official a Lfrd;a(Lfrc;)Lfrd;
    • fromPolar

      public static Vec3d fromPolar(float pitch, float yaw)
      Converts pitch and yaw into a direction vector.
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named fromPolar Lnet/minecraft/util/math/Vec3d;fromPolar(FF)Lnet/minecraft/util/math/Vec3d;
      intermediary method_1030 Lnet/minecraft/class_243;method_1030(FF)Lnet/minecraft/class_243;
      official a Lfrd;a(FF)Lfrd;
    • getYawAndPitch

      public Vec2f getYawAndPitch()
      Mappings:
      Namespace Name Mixin selector
      named getYawAndPitch Lnet/minecraft/util/math/Vec3d;getYawAndPitch()Lnet/minecraft/util/math/Vec2f;
      intermediary method_75278 Lnet/minecraft/class_243;method_75278()Lnet/minecraft/class_241;
      official l Lfrd;l()Lfrc;
    • floorAlongAxes

      public Vec3d floorAlongAxes(EnumSet<Direction.Axis> axes)
      Applies the floor function to the coordinates chosen by the given axes.
      Mappings:
      Namespace Name Mixin selector
      named floorAlongAxes Lnet/minecraft/util/math/Vec3d;floorAlongAxes(Ljava/util/EnumSet;)Lnet/minecraft/util/math/Vec3d;
      intermediary method_1032 Lnet/minecraft/class_243;method_1032(Ljava/util/EnumSet;)Lnet/minecraft/class_243;
      official a Lfrd;a(Ljava/util/EnumSet;)Lfrd;
    • getComponentAlongAxis

      public double getComponentAlongAxis(Direction.Axis axis)
      Returns the coordinate chosen by the given axis.
      Mappings:
      Namespace Name Mixin selector
      named getComponentAlongAxis Lnet/minecraft/util/math/Vec3d;getComponentAlongAxis(Lnet/minecraft/util/math/Direction$Axis;)D
      intermediary method_18043 Lnet/minecraft/class_243;method_18043(Lnet/minecraft/class_2350$class_2351;)D
      official a Lfrd;a(Ljf$a;)D
    • withAxis

      public Vec3d withAxis(Direction.Axis axis, double value)
      Mappings:
      Namespace Name Mixin selector
      named withAxis Lnet/minecraft/util/math/Vec3d;withAxis(Lnet/minecraft/util/math/Direction$Axis;D)Lnet/minecraft/util/math/Vec3d;
      intermediary method_38499 Lnet/minecraft/class_243;method_38499(Lnet/minecraft/class_2350$class_2351;D)Lnet/minecraft/class_243;
      official a Lfrd;a(Ljf$a;D)Lfrd;
    • offset

      public Vec3d offset(Direction direction, double value)
      Mappings:
      Namespace Name Mixin selector
      named offset Lnet/minecraft/util/math/Vec3d;offset(Lnet/minecraft/util/math/Direction;D)Lnet/minecraft/util/math/Vec3d;
      intermediary method_43206 Lnet/minecraft/class_243;method_43206(Lnet/minecraft/class_2350;D)Lnet/minecraft/class_243;
      official a Lfrd;a(Ljf;D)Lfrd;
    • getX

      public final double getX()
      Returns the X coordinate.
      Specified by:
      getX in interface Position
      Mappings:
      Namespace Name Mixin selector
      named getX Lnet/minecraft/util/math/Position;getX()D
      intermediary method_10216 Lnet/minecraft/class_2374;method_10216()D
      official a Ljt;a()D
    • getY

      public final double getY()
      Returns the Y coordinate.
      Specified by:
      getY in interface Position
      Mappings:
      Namespace Name Mixin selector
      named getY Lnet/minecraft/util/math/Position;getY()D
      intermediary method_10214 Lnet/minecraft/class_2374;method_10214()D
      official b Ljt;b()D
    • getZ

      public final double getZ()
      Returns the Z coordinate.
      Specified by:
      getZ in interface Position
      Mappings:
      Namespace Name Mixin selector
      named getZ Lnet/minecraft/util/math/Position;getZ()D
      intermediary method_10215 Lnet/minecraft/class_2374;method_10215()D
      official c Ljt;c()D
    • toVector3f

      public Vector3f toVector3f()
      Returns a JOML Vector3f representing this vector.
      Returns:
      a JOML Vector3f representing this vector
      Mappings:
      Namespace Name Mixin selector
      named toVector3f Lnet/minecraft/util/math/Vec3d;toVector3f()Lorg/joml/Vector3f;
      intermediary method_46409 Lnet/minecraft/class_243;method_46409()Lorg/joml/Vector3f;
      official m Lfrd;m()Lorg/joml/Vector3f;
    • projectOnto

      public Vec3d projectOnto(Vec3d vec)
      Mappings:
      Namespace Name Mixin selector
      named projectOnto Lnet/minecraft/util/math/Vec3d;projectOnto(Lnet/minecraft/util/math/Vec3d;)Lnet/minecraft/util/math/Vec3d;
      intermediary method_64316 Lnet/minecraft/class_243;method_64316(Lnet/minecraft/class_243;)Lnet/minecraft/class_243;
      official i Lfrd;i(Lfrd;)Lfrd;
    • transformLocalPos

      public static Vec3d transformLocalPos(Vec2f rotation, Vec3d vec)
      Mappings:
      Namespace Name Mixin selector
      named transformLocalPos Lnet/minecraft/util/math/Vec3d;transformLocalPos(Lnet/minecraft/util/math/Vec2f;Lnet/minecraft/util/math/Vec3d;)Lnet/minecraft/util/math/Vec3d;
      intermediary method_75275 Lnet/minecraft/class_243;method_75275(Lnet/minecraft/class_241;Lnet/minecraft/class_243;)Lnet/minecraft/class_243;
      official a Lfrd;a(Lfrc;Lfrd;)Lfrd;
    • transformLocalPos

      public Vec3d transformLocalPos(Vec3d vec)
      Mappings:
      Namespace Name Mixin selector
      named transformLocalPos Lnet/minecraft/util/math/Vec3d;transformLocalPos(Lnet/minecraft/util/math/Vec3d;)Lnet/minecraft/util/math/Vec3d;
      intermediary method_75277 Lnet/minecraft/class_243;method_75277(Lnet/minecraft/class_243;)Lnet/minecraft/class_243;
      official j Lfrd;j(Lfrd;)Lfrd;