java.lang.Object
com.seibel.distanthorizons.coreapi.util.math.Vec3f

public class Vec3f extends Object
A (almost) exact copy of Minecraft's 1.16.5 implementation of a 3 element float vector.
  • Field Details

    • XNeg

      public static Vec3f XNeg
    • XPos

      public static Vec3f XPos
    • YNeg

      public static Vec3f YNeg
    • YPos

      public static Vec3f YPos
    • ZNeg

      public static Vec3f ZNeg
    • ZPos

      public static Vec3f ZPos
    • x

      public float x
    • y

      public float y
    • z

      public float z
  • Constructor Details

    • Vec3f

      public Vec3f()
    • Vec3f

      public Vec3f(float x, float y, float z)
    • Vec3f

      public Vec3f(float[] values)
  • Method Details

    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • mul

      public void mul(float scalar)
    • mul

      public void mul(float x, float y, float z)
    • clamp

      public void clamp(float min, float max)
    • set

      public void set(float x, float y, float z)
    • add

      public void add(float x, float y, float z)
    • add

      public void add(Vec3f vector)
    • subtract

      public void subtract(Vec3f vector)
    • dotProduct

      public float dotProduct(Vec3f vector)
    • normalize

      public boolean normalize()
      Returns true if normalization had to be done
    • crossProduct

      public void crossProduct(Vec3f vector)
    • copy

      public Vec3f copy()
    • toString

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

      public void set(float[] values)