Class SmoothTransitionMode

java.lang.Object
io.github.ennuil.libzoomer.api.transitions.SmoothTransitionMode
All Implemented Interfaces:
TransitionMode

public class SmoothTransitionMode extends Object implements TransitionMode
An implementation of Ok Zoomer's smooth transitions (and Vanilla's spyglass zoom) as a transition mode
  • Constructor Summary

    Constructors
    Constructor
    Description
    Initializes an instance of the smooth transition mode with the smooth multiplier being 0.5F
    SmoothTransitionMode(float smoothMultiplier)
    Initializes an instance of the smooth transition mode with the specified smooth multiplier
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    applyZoom(double fov, float tickDelta)
    Applies the zoom to the FOV.
    boolean
    Gets the active state of the transition mode.
    net.minecraft.util.Identifier
    Gets the identifier of the transition mode.
    double
    Gets the internal multiplier.
    void
    tick(boolean active, double divisor)
    The tick method.

    Methods inherited from class java.lang.Object

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

    • SmoothTransitionMode

      public SmoothTransitionMode(float smoothMultiplier)
      Initializes an instance of the smooth transition mode with the specified smooth multiplier
      Parameters:
      smoothMultiplier - the smooth multiplier, used internally by the smooth transition
    • SmoothTransitionMode

      public SmoothTransitionMode()
      Initializes an instance of the smooth transition mode with the smooth multiplier being 0.5F
  • Method Details

    • getIdentifier

      public net.minecraft.util.Identifier getIdentifier()
      Description copied from interface: TransitionMode
      Gets the identifier of the transition mode.
      Specified by:
      getIdentifier in interface TransitionMode
      Returns:
      the transition mode's identifier
    • getActive

      public boolean getActive()
      Description copied from interface: TransitionMode
      Gets the active state of the transition mode.
      Specified by:
      getActive in interface TransitionMode
      Returns:
      the transition mode's active state
    • applyZoom

      public double applyZoom(double fov, float tickDelta)
      Description copied from interface: TransitionMode
      Applies the zoom to the FOV.
      Specified by:
      applyZoom in interface TransitionMode
      Parameters:
      fov - the original FOV
      tickDelta - the current tick delta
      Returns:
      the zoomed FOV
    • tick

      public void tick(boolean active, double divisor)
      Description copied from interface: TransitionMode
      The tick method. Used in order to keep the internal variables accurate.
      Specified by:
      tick in interface TransitionMode
      Parameters:
      active - the zoom state
      divisor - the zoom divisor
    • getInternalMultiplier

      public double getInternalMultiplier()
      Description copied from interface: TransitionMode
      Gets the internal multiplier. Used for purposes other than zooming the FOV.
      Specified by:
      getInternalMultiplier in interface TransitionMode
      Returns:
      the internal multiplier