Class Billboarding

java.lang.Object
com.github.darksoulq.abyssallib.world.particle.timeline.Billboarding

public class Billboarding extends Object
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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    face(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.
    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.

    Methods inherited from class Object

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

    • Billboarding

      public Billboarding()
  • Method Details

    • face

      public static Transformer face(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.

      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 starting Location of the particle effect.
      target - The Location the shape should be oriented towards.
      Returns:
      A Transformer that 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 Player as they move around the effect.

      Parameters:
      originSupplier - A Supplier providing the current origin Location.
      targetSupplier - A Supplier providing the current target Location.
      Returns:
      A dynamic Transformer that recalculates orientation every tick.