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 frame frameIndex within mipmap layer at sprite relative coordinates.
    private int lerp​(double delta, int to, int from)
    Purely mathematical single-value linear interpolation.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • Interpolation

      private Interpolation​(Sprite.Info info, int mipmap)
  • 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 frame frameIndex within mipmap layer 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 interface AutoCloseable