Record Class Vec3f

java.lang.Object
java.lang.Record
dev.latvian.mods.klib.math.Vec3f

public record Vec3f(float x, float y, float z) extends Record
  • Field Details

    • ZERO

      public static final Vec3f ZERO
    • ONE

      public static final Vec3f ONE
    • DOWN

      public static final Vec3f DOWN
    • UP

      public static final Vec3f UP
    • NORTH

      public static final Vec3f NORTH
    • SOUTH

      public static final Vec3f SOUTH
    • WEST

      public static final Vec3f WEST
    • EAST

      public static final Vec3f EAST
    • DIRECTIONS

      public static final Vec3f[] DIRECTIONS
    • DIRECT_CODEC

      public static final com.mojang.serialization.Codec<Vec3f> DIRECT_CODEC
    • CODEC

      public static final com.mojang.serialization.Codec<Vec3f> CODEC
    • DIRECTION_CODEC

      public static final com.mojang.serialization.Codec<Vec3f> DIRECTION_CODEC
    • STREAM_CODEC

      public static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, Vec3f> STREAM_CODEC
  • Constructor Details

    • Vec3f

      public Vec3f(float x, float y, float z)
      Creates an instance of a Vec3f record class.
      Parameters:
      x - the value for the x record component
      y - the value for the y record component
      z - the value for the z record component
  • Method Details

    • of

      public static Vec3f of(float x, float y, float z)
    • of

      public static Vec3f of(double x, double y, double z)
    • of

      public static Vec3f of(net.minecraft.world.phys.Vec3 v)
    • of

      public static Vec3f of(org.joml.Vector3fc v)
    • of

      public static Vec3f of(org.joml.Vector4fc v)
    • of

      public static Vec3f of(float v)
    • lengthSq

      public float lengthSq()
    • length

      public float length()
    • isZero

      public boolean isZero()
    • normalize

      public Vec3f normalize()
    • multiply

      public Vec3f multiply(float x, float y, float z)
    • toVec4f

      public org.joml.Vector4f toVec4f()
    • toRotation

      public Rotation toRotation()
    • withX

      public Vec3f withX(float x)
    • withY

      public Vec3f withY(float y)
    • withZ

      public Vec3f withZ(float z)
    • lerp

      public Vec3f lerp(float delta, Vec3f other)
    • toString

      @NotNull public @NotNull String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • x

      public float x()
      Returns the value of the x record component.
      Returns:
      the value of the x record component
    • y

      public float y()
      Returns the value of the y record component.
      Returns:
      the value of the y record component
    • z

      public float z()
      Returns the value of the z record component.
      Returns:
      the value of the z record component