Class Vec3

java.lang.Object
ua.mcchickenstudio.opencreative.utils.millennium.vectors.Vec3

public final class Vec3 extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final double
    X coordinate of Vec3D
    final double
    Y coordinate of Vec3D
    final double
    Z coordinate of Vec3D
  • Constructor Summary

    Constructors
    Constructor
    Description
    Vec3(double x, double y, double z)
     
    Vec3(org.bukkit.util.Vector vector)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    add(Vec3 vec)
     
    addVector(double x, double y, double z)
    Adds the specified x,y,z vector components to this vector and returns the resulting vector.
    double
    Euclidean distance between this and the specified vector, returned as double.
    Returns a new vector with x value equal to the second parameter, along the line between this vector and the passed in vector, or null if not possible.
    Returns a new vector with y value equal to the second parameter, along the line between this vector and the passed in vector, or null if not possible.
    Returns a new vector with z value equal to the second parameter, along the line between this vector and the passed in vector, or null if not possible.
    multiply(double m)
     
    Normalizes the vector to a length of 1 (except if it is the zero vector)
    double
     
    double
    The square of the Euclidean distance between this and the specified vector.
    subtract(double x, double y, double z)
     
     
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • xCoord

      public final double xCoord
      X coordinate of Vec3D
    • yCoord

      public final double yCoord
      Y coordinate of Vec3D
    • zCoord

      public final double zCoord
      Z coordinate of Vec3D
  • Constructor Details

    • Vec3

      public Vec3(double x, double y, double z)
    • Vec3

      public Vec3(org.bukkit.util.Vector vector)
  • Method Details

    • normalize

      public Vec3 normalize()
      Normalizes the vector to a length of 1 (except if it is the zero vector)
    • subtract

      public Vec3 subtract(Vec3 vec)
    • subtract

      public Vec3 subtract(double x, double y, double z)
    • add

      public Vec3 add(Vec3 vec)
    • addVector

      public Vec3 addVector(double x, double y, double z)
      Adds the specified x,y,z vector components to this vector and returns the resulting vector. Does not change this vector.
    • distanceTo

      public double distanceTo(Vec3 vec)
      Euclidean distance between this and the specified vector, returned as double.
    • squareDistanceTo

      public double squareDistanceTo(Vec3 vec)
      The square of the Euclidean distance between this and the specified vector.
    • getIntermediateWithXValue

      public Vec3 getIntermediateWithXValue(Vec3 vec, double x)
      Returns a new vector with x value equal to the second parameter, along the line between this vector and the passed in vector, or null if not possible.
    • getIntermediateWithYValue

      public Vec3 getIntermediateWithYValue(Vec3 vec, double y)
      Returns a new vector with y value equal to the second parameter, along the line between this vector and the passed in vector, or null if not possible.
    • getIntermediateWithZValue

      public Vec3 getIntermediateWithZValue(Vec3 vec, double z)
      Returns a new vector with z value equal to the second parameter, along the line between this vector and the passed in vector, or null if not possible.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • multiply

      public Vec3 multiply(double m)
    • speed

      public double speed()