Class CoverModel

java.lang.Object
net.ixdarklord.folios.internal.client.handheld.CoverModel

public final class CoverModel extends Object
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final record 
    A band round the spine: from y0 to y1 up it (0 at the foot, 16 at the head), standing out off it (in x's units), its face from that part of texture (0 to 1), tinted as a face's "tintindex" says.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final float
    How much of a book's opening its latch takes, unlatching before its cover swings.
  • Method Summary

    Modifier and Type
    Method
    Description
    The bands round the spine.
    static void
     
    void
    draw(com.mojang.blaze3d.vertex.PoseStack pose, net.minecraft.client.renderer.SubmitNodeCollector collector, int light, boolean left, float width, float top, float bottom, float outside, int cover, int accent, float open, @Nullable org.joml.Matrix3f relight)
    Draws it on a board's outside.
    static @Nullable CoverModel
    get(net.minecraft.resources.Identifier id)
    The model with that id, read the first time it is asked for; null when there is none or it can't be read.
    static float
    swing(float open)
    How far the cover has swung open, 0 to 1, when the book is open that far (the latch goes first).

    Methods inherited from class Object

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

    • LATCH

      public static final float LATCH
      How much of a book's opening its latch takes, unlatching before its cover swings.
      See Also:
  • Method Details

    • swing

      public static float swing(float open)
      How far the cover has swung open, 0 to 1, when the book is open that far (the latch goes first).
    • bands

      public List<CoverModel.Band> bands()
      The bands round the spine.
    • clear

      public static void clear()
    • get

      public static @Nullable CoverModel get(net.minecraft.resources.Identifier id)
      The model with that id, read the first time it is asked for; null when there is none or it can't be read.
    • draw

      public void draw(com.mojang.blaze3d.vertex.PoseStack pose, net.minecraft.client.renderer.SubmitNodeCollector collector, int light, boolean left, float width, float top, float bottom, float outside, int cover, int accent, float open, @Nullable org.joml.Matrix3f relight)
      Draws it on a board's outside. The pose is the book's (page pixels: x right from the spine, y down, z towards the reader); outside is the z of the board's outer face, the board width across and top to bottom tall; left mirrors it for the left board. open is how far the book is open, 0 shut to 1, for the boxes shown only shut or only open.