Package net.minecraft.client.texture
Class Sprite.Interpolation
java.lang.Object
net.minecraft.client.texture.Sprite.Interpolation
- All Implemented Interfaces:
AutoCloseable
- Enclosing class:
- Sprite
@Environment(CLIENT) final class Sprite.Interpolation extends Object implements AutoCloseable
-
Field Summary
Fields Modifier and Type Field Description private NativeImage[]
images
-
Constructor Summary
Constructors Modifier Constructor Description private
Interpolation(Sprite.Info info, int mipmap)
-
Method Summary
Modifier and Type Method Description private void
apply()
Linearly interpolate between the current and next frame on all mip levels based on the tick position within the current frame, and upload the results to the currently bound texture to the frame slot at position (0,0).void
close()
private int
getPixelColor(int frameIndex, int layer, int x, int y)
Returns the pixel color at frameframeIndex
within mipmaplayer
at sprite relative coordinates.private int
lerp(double delta, int to, int from)
Purely mathematical single-value linear interpolation.
-
Field Details
-
images
-
-
Constructor Details
-
Interpolation
-
-
Method Details
-
apply
private void apply()Linearly interpolate between the current and next frame on all mip levels based on the tick position within the current frame, and upload the results to the currently bound texture to the frame slot at position (0,0). -
getPixelColor
private int getPixelColor(int frameIndex, int layer, int x, int y)Returns the pixel color at frameframeIndex
within mipmaplayer
at sprite relative coordinates. -
lerp
private int lerp(double delta, int to, int from)Purely mathematical single-value linear interpolation.lerp(0, a, b) == b
,lerp(1, a, b) == a
. -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-