Record Class BezierInterpolation
java.lang.Object
java.lang.Record
dev.latvian.mods.klib.interpolation.BezierInterpolation
- All Implemented Interfaces:
Interpolation
public record BezierInterpolation(org.joml.Vector2fc a, org.joml.Vector2fc b)
extends Record
implements Interpolation
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<BezierInterpolation> static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, BezierInterpolation> static final InterpolationType<BezierInterpolation> Fields inherited from interface dev.latvian.mods.klib.interpolation.Interpolation
CODEC, DATA_TYPE, DIRECT_CODEC, UNIT_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionBezierInterpolation(org.joml.Vector2fc a, org.joml.Vector2fc b) Creates an instance of aBezierInterpolationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionorg.joml.Vector2fca()Returns the value of thearecord component.org.joml.Vector2fcb()Returns the value of thebrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.doubleinterpolate(double t) floatinterpolate(float t) booleanisLinear()@NotNull StringtoString()Returns a string representation of this record class.type()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.latvian.mods.klib.interpolation.Interpolation
composite, flipX, flipY, interpolate, interpolate, interpolate, interpolate, interpolateClamped, interpolateClamped, interpolateMirrored, interpolateMirrored, inverse, join
-
Field Details
-
MAP_CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf,BezierInterpolation> STREAM_CODEC -
TYPE
-
-
Constructor Details
-
BezierInterpolation
public BezierInterpolation(org.joml.Vector2fc a, org.joml.Vector2fc b) Creates an instance of aBezierInterpolationrecord class.- Parameters:
a- the value for thearecord componentb- the value for thebrecord component
-
-
Method Details
-
type
- Specified by:
typein interfaceInterpolation
-
interpolate
public double interpolate(double t) - Specified by:
interpolatein interfaceInterpolation
-
interpolate
public float interpolate(float t) - Specified by:
interpolatein interfaceInterpolation
-
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. -
isLinear
public boolean isLinear()- Specified by:
isLinearin interfaceInterpolation
-
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. -
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 withObjects::equals(Object,Object). -
a
public org.joml.Vector2fc a()Returns the value of thearecord component.- Returns:
- the value of the
arecord component
-
b
public org.joml.Vector2fc b()Returns the value of thebrecord component.- Returns:
- the value of the
brecord component
-