Class Pose3d

java.lang.Object
dev.ryanhcode.sable.companion.math.Pose3d
All Implemented Interfaces:
Pose3dc

public final class Pose3d extends Object implements Pose3dc
A read-write 3D pose, consisting of a position, rotation, and scale.
Since:
1.0.0
  • Field Details

    • CODEC

      public static com.mojang.serialization.Codec<Pose3d> CODEC
  • Constructor Details

    • Pose3d

      public Pose3d(org.joml.Vector3d position, org.joml.Quaterniond orientation, org.joml.Vector3d rotationPoint, org.joml.Vector3d scale)
      Constructs a new pose with the given position, orientation, and scale.
      Parameters:
      position - the global position of the pose
      orientation - the global orientation of the pose
      scale - the global scale of the pose
    • Pose3d

      public Pose3d()
      Constructs a new pose with the identity position, orientation, and scale.
    • Pose3d

      public Pose3d(Pose3dc pose)
      Constructs a new pose, copying the values from the given pose.
  • Method Details

    • set

      @Contract(value="_->this", mutates="this") public Pose3d set(Pose3dc pose)
      Copies all values from the given pose into this pose.
      Parameters:
      pose - the pose to copy
      Returns:
      this
    • lerp

      @Contract(value="_,_->this", mutates="this") public Pose3d lerp(Pose3dc pose, double frac)
      Lerps this pose towards the given pose by the given amount.
      Parameters:
      pose - the pose to lerp towards
      frac - the amount to lerp by, 0.0 to 1.0
      Returns:
      this
    • position

      public org.joml.Vector3d position()
      Specified by:
      position in interface Pose3dc
      Returns:
      the global position of this pose.
    • orientation

      public org.joml.Quaterniond orientation()
      Specified by:
      orientation in interface Pose3dc
      Returns:
      the global orientation of this pose.
    • rotationPoint

      public org.joml.Vector3d rotationPoint()
      Specified by:
      rotationPoint in interface Pose3dc
      Returns:
      the rotation point of this pose.
    • scale

      public org.joml.Vector3d scale()
      Specified by:
      scale in interface Pose3dc
      Returns:
      the global scale of this pose.
    • toString

      public String toString()
      Overrides:
      toString in class Object