Class Trail

java.lang.Object
net.ixdarklord.coolcatcanvas.api.client.vfx.Trail

public final class Trail extends Object
The path something moved along over its last few ticks, drawn as a ribbon with VfxDraw.trail(Trail, Curve, int, int). Whoever owns the moving thing keeps one and feeds it the thing's position every tick:
Trail trail = new Trail(12);
// every client tick
trail.add(bolt.position());
// every frame, in a VfxRenderer
frame.draw(STREAK).trail(trail, Curve.of(0.3F, 0.0F), 0xFFFFE9A0, 0x00FF7A2A);
  • Constructor Summary

    Constructors
    Constructor
    Description
    Trail(int length)
    A trail that remembers this many ticks of movement.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(double x, double y, double z)
    Adds the newest position, dropping the oldest once the trail is full.
    void
    add(net.minecraft.world.phys.Vec3 position)
     
    void
     
    double
    coordinate(int point, int axis)
    A coordinate (0 x, 1 y, 2 z) of a point, 0 being the oldest.
    void
    Drops the oldest point: called every tick after the thing stopped, it lets the trail catch up and vanish.
    int
     

    Methods inherited from class Object

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

    • Trail

      public Trail(int length)
      A trail that remembers this many ticks of movement.
  • Method Details

    • add

      public void add(double x, double y, double z)
      Adds the newest position, dropping the oldest once the trail is full.
    • add

      public void add(net.minecraft.world.phys.Vec3 position)
    • shrink

      public void shrink()
      Drops the oldest point: called every tick after the thing stopped, it lets the trail catch up and vanish.
    • clear

      public void clear()
    • size

      public int size()
    • coordinate

      public double coordinate(int point, int axis)
      A coordinate (0 x, 1 y, 2 z) of a point, 0 being the oldest.