Class Billboarding
java.lang.Object
com.github.darksoulq.abyssallib.world.particle.timeline.Billboarding
A utility class for creating billboarding and orientation
Transformers.
Billboarding allows particle shapes (which are typically generated on a flat plane) to be rotated so that they "face" a specific target, such as a player's camera or a specific world coordinate.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Transformerface(org.bukkit.Location origin, org.bukkit.Location target) Creates a static transformer that rotates a shape's local "up" (0, 1, 0) to face a specific target location.static TransformerfaceDynamic(Supplier<org.bukkit.Location> originSupplier, Supplier<org.bukkit.Location> targetSupplier) Creates a dynamic transformer that continuously re-orients a shape to face a moving target.
-
Constructor Details
-
Billboarding
public Billboarding()
-
-
Method Details
-
face
Creates a static transformer that rotates a shape's local "up" (0, 1, 0) to face a specific target location.The rotation is calculated once when this method is called and remains constant regardless of subsequent movements of the origin or target.
- Parameters:
origin- The startingLocationof the particle effect.target- TheLocationthe shape should be oriented towards.- Returns:
- A
Transformerthat applies the static rotation.
-
faceDynamic
public static Transformer faceDynamic(Supplier<org.bukkit.Location> originSupplier, Supplier<org.bukkit.Location> targetSupplier) Creates a dynamic transformer that continuously re-orients a shape to face a moving target.This is ideal for effects that must always face a specific
Playeras they move around the effect.- Parameters:
originSupplier- ASupplierproviding the current originLocation.targetSupplier- ASupplierproviding the current targetLocation.- Returns:
- A dynamic
Transformerthat recalculates orientation every tick.
-