Class Trail
java.lang.Object
net.ixdarklord.coolcatcanvas.api.client.vfx.Trail
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 -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(double x, double y, double z) Adds the newest position, dropping the oldest once the trail is full.voidadd(net.minecraft.world.phys.Vec3 position) voidclear()doublecoordinate(int point, int axis) A coordinate (0 x, 1 y, 2 z) of a point, 0 being the oldest.voidshrink()Drops the oldest point: called every tick after the thing stopped, it lets the trail catch up and vanish.intsize()
-
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.
-