Class Rotation

java.lang.Object
hm.zelha.particlesfx.util.Rotation

public class Rotation extends Object
  • Constructor Details

    • Rotation

      public Rotation(double pitch, double yaw, double roll)
    • Rotation

      public Rotation()
  • Method Details

    • clone

      public Rotation clone()
      Overrides:
      clone in class Object
    • inherit

      public Rotation inherit(Rotation rotation)
      Parameters:
      rotation - object for this rotation class to copy data from
      Returns:
      this object
    • inherit

      public Rotation inherit(Shape shape)
      Parameters:
      shape - object for this rotation class to copy data from
      Returns:
      this object
    • apply

      public org.bukkit.util.Vector apply(org.bukkit.util.Vector v)
      Parameters:
      v - vector for this rotation to be applied to
      Returns:
      the given vector
    • applyPitch

      public void applyPitch(org.bukkit.util.Vector v)
      Parameters:
      v - vector for this rotation's pitch to be applied to
    • applyYaw

      public void applyYaw(org.bukkit.util.Vector v)
      Parameters:
      v - vector for this rotation's yaw to be applied to
    • applyRoll

      public void applyRoll(org.bukkit.util.Vector v)
      Parameters:
      v - vector for this rotation's roll to be applied to
    • add

      public void add(double pitch, double yaw, double roll)
    • addAxis

      public void addAxis(double pitch, double yaw, double roll)
      adds the given pitch, yaw, and roll to this rotation's axis, which will be applied before this rotation in apply(Vector)
      Parameters:
      pitch - how much to add to pitch
      yaw - how much to add to yaw
      roll - how much to add to roll
    • setRotationOrder

      public void setRotationOrder(Rotation.Axis first, Rotation.Axis second, Rotation.Axis third)
      Changes the order that rotations are applied. Default is pitch, yaw, then roll.
      Parameters:
      first - first axis to be applied
      second - second axis to be applied
      third - third axis to be applied
    • set

      public void set(double pitch, double yaw, double roll)
    • setPitch

      public void setPitch(double pitch)
    • setYaw

      public void setYaw(double yaw)
    • setRoll

      public void setRoll(double roll)
    • setAxis

      public void setAxis(double pitch, double yaw, double roll)
      sets this rotation's axis to the given pitch, yaw, and roll, which will be applied before this rotation in apply(Vector)
      Parameters:
      pitch - pitch to set
      yaw - yaw to set
      roll - roll to set
    • setAxisPitch

      public void setAxisPitch(double pitch)
      sets this rotation's axis to the given pitch, which will be applied before this rotation in apply(Vector)
      Parameters:
      pitch - pitch to set
    • setAxisYaw

      public void setAxisYaw(double yaw)
      sets this rotation's axis to the given yaw, which will be applied before this rotation in apply(Vector)
      Parameters:
      yaw - yaw to set
    • setAxisRoll

      public void setAxisRoll(double roll)
      sets this rotation's axis to the given roll, which will be applied before this rotation in apply(Vector)
      Parameters:
      roll - roll to set
    • getRotationOrder

      public Rotation.Axis[] getRotationOrder()
      Returns:
      an array of axes where [0] is the first rotation applied, [1] is the second, and [2] is the third.
    • getPitch

      public double getPitch()
    • getYaw

      public double getYaw()
    • getRoll

      public double getRoll()
    • getAxisPitch

      public double getAxisPitch()
      Returns:
      the pitch of this rotation's axis, which will be applied before this rotation in apply(Vector)
    • getAxisYaw

      public double getAxisYaw()
      Returns:
      the yaw of this rotation's axis, which will be applied before this rotation in apply(Vector)
    • getAxisRoll

      public double getAxisRoll()
      Returns:
      the roll of this rotation's axis, which will be applied before this rotation in apply(Vector)