Record Class Vec3f
java.lang.Object
java.lang.Record
dev.latvian.mods.klib.math.Vec3f
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<Vec3f> static final com.mojang.serialization.Codec<Vec3f> static final com.mojang.serialization.Codec<Vec3f> static final Vec3f[]static final Vec3fstatic final Vec3fstatic final Vec3fstatic final Vec3fstatic final Vec3fstatic final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, Vec3f> static final Vec3fstatic final Vec3fstatic final Vec3f -
Constructor Summary
ConstructorsConstructorDescriptionVec3f(float x, float y, float z) Creates an instance of aVec3frecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisZero()floatlength()floatlengthSq()multiply(float x, float y, float z) static Vec3fof(double x, double y, double z) static Vec3fof(float v) static Vec3fof(float x, float y, float z) static Vec3fof(net.minecraft.world.phys.Vec3 v) static Vec3fof(org.joml.Vector3fc v) static Vec3fof(org.joml.Vector4fc v) @NotNull StringtoString()Returns a string representation of this record class.org.joml.Vector4ftoVec4f()withX(float x) withY(float y) withZ(float z) floatx()Returns the value of thexrecord component.floaty()Returns the value of theyrecord component.floatz()Returns the value of thezrecord component.
-
Field Details
-
ZERO
-
ONE
-
DOWN
-
UP
-
NORTH
-
SOUTH
-
WEST
-
EAST
-
DIRECTIONS
-
DIRECT_CODEC
-
CODEC
-
DIRECTION_CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, Vec3f> STREAM_CODEC -
DATA_TYPE
-
DIRECTION_DATA_TYPE
-
-
Constructor Details
-
Vec3f
public Vec3f(float x, float y, float z) Creates an instance of aVec3frecord class.- Parameters:
x- the value for thexrecord componenty- the value for theyrecord componentz- the value for thezrecord component
-
-
Method Details
-
of
-
of
-
of
-
of
-
of
-
of
-
lengthSq
public float lengthSq() -
length
public float length() -
isZero
public boolean isZero() -
normalize
-
multiply
-
toVec4f
public org.joml.Vector4f toVec4f() -
toRotation
-
withX
-
withY
-
withZ
-
lerp
-
toString
-
hashCode
-
equals
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 thecomparemethod from their corresponding wrapper classes. -
x
public float x()Returns the value of thexrecord component.- Returns:
- the value of the
xrecord component
-
y
public float y()Returns the value of theyrecord component.- Returns:
- the value of the
yrecord component
-
z
public float z()Returns the value of thezrecord component.- Returns:
- the value of the
zrecord component
-