Class Vector2i

java.lang.Object
org.spongepowered.math.vector.Vector2i
All Implemented Interfaces:
Serializable, Comparable<Vector2i>, Vectori

@Immutable public final class Vector2i extends Object implements Vectori, Comparable<Vector2i>, Serializable
See Also:
  • Field Details

    • ZERO

      public static final Vector2i ZERO
    • UNIT_X

      public static final Vector2i UNIT_X
    • UNIT_Y

      public static final Vector2i UNIT_Y
    • ONE

      public static final Vector2i ONE
  • Constructor Details

    • Vector2i

      public Vector2i(Vector3i v)
    • Vector2i

      public Vector2i(Vector4i v)
    • Vector2i

      public Vector2i(VectorNi v)
    • Vector2i

      public Vector2i(double x, double y)
    • Vector2i

      public Vector2i(int x, int y)
  • Method Details

    • x

      public int x()
    • withX

      public Vector2i withX(int x)
    • withX

      public Vector2i withX(double x)
    • y

      public int y()
    • withY

      public Vector2i withY(int y)
    • withY

      public Vector2i withY(double y)
    • add

      public Vector2i add(Vector2i v)
    • add

      public Vector2i add(double x, double y)
    • add

      public Vector2i add(int x, int y)
    • sub

      public Vector2i sub(Vector2i v)
    • sub

      public Vector2i sub(double x, double y)
    • sub

      public Vector2i sub(int x, int y)
    • mul

      public Vector2i mul(double a)
    • mul

      public Vector2i mul(int a)
      Specified by:
      mul in interface Vectori
    • mul

      public Vector2i mul(Vector2i v)
    • mul

      public Vector2i mul(double x, double y)
    • mul

      public Vector2i mul(int x, int y)
    • div

      public Vector2i div(double a)
    • div

      public Vector2i div(int a)
      Specified by:
      div in interface Vectori
    • div

      public Vector2i div(Vector2i v)
    • div

      public Vector2i div(double x, double y)
    • div

      public Vector2i div(int x, int y)
    • dot

      public int dot(Vector2i v)
    • dot

      public int dot(double x, double y)
    • dot

      public int dot(int x, int y)
    • project

      public Vector2i project(Vector2i v)
    • project

      public Vector2i project(double x, double y)
    • project

      public Vector2i project(int x, int y)
    • pow

      public Vector2i pow(double pow)
    • pow

      public Vector2i pow(int power)
      Specified by:
      pow in interface Vectori
    • abs

      public Vector2i abs()
      Specified by:
      abs in interface Vectori
    • negate

      public Vector2i negate()
      Specified by:
      negate in interface Vectori
    • min

      public Vector2i min(Vector2i v)
    • min

      public Vector2i min(double x, double y)
    • min

      public Vector2i min(int x, int y)
    • max

      public Vector2i max(Vector2i v)
    • max

      public Vector2i max(double x, double y)
    • max

      public Vector2i max(int x, int y)
    • distanceSquared

      public int distanceSquared(Vector2i v)
    • distanceSquared

      public int distanceSquared(double x, double y)
    • distanceSquared

      public int distanceSquared(int x, int y)
    • distance

      public float distance(Vector2i v)
    • distance

      public float distance(double x, double y)
    • distance

      public float distance(int x, int y)
    • lengthSquared

      public int lengthSquared()
      Specified by:
      lengthSquared in interface Vectori
    • length

      public float length()
      Specified by:
      length in interface Vectori
    • minAxis

      public int minAxis()
      Return the axis with the minimal value.
      Specified by:
      minAxis in interface Vectori
      Returns:
      int axis with minimal value
    • maxAxis

      public int maxAxis()
      Return the axis with the maximum value.
      Specified by:
      maxAxis in interface Vectori
      Returns:
      int axis with maximum value
    • toVector3

      public Vector3i toVector3()
    • toVector3

      public Vector3i toVector3(double z)
    • toVector3

      public Vector3i toVector3(int z)
    • toVector4

      public Vector4i toVector4()
    • toVector4

      public Vector4i toVector4(double z, double w)
    • toVector4

      public Vector4i toVector4(int z, int w)
    • toVectorN

      public VectorNi toVectorN()
    • toArray

      public int[] toArray()
      Specified by:
      toArray in interface Vectori
    • toInt

      public Vector2i toInt()
      Specified by:
      toInt in interface Vectori
    • toLong

      public Vector2l toLong()
      Specified by:
      toLong in interface Vectori
    • toFloat

      public Vector2f toFloat()
      Specified by:
      toFloat in interface Vectori
    • toDouble

      public Vector2d toDouble()
      Specified by:
      toDouble in interface Vectori
    • compareTo

      public int compareTo(Vector2i v)
      Specified by:
      compareTo in interface Comparable<Vector2i>
    • equals

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

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

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

      public static Vector2i from(int n)
    • from

      public static Vector2i from(int x, int y)