Interface Vec2<T,V2 extends Vec2<T,V2>>

Type Parameters:
T - - the object this a vector of
V2 - - the object to return for this-returning methods
All Known Subinterfaces:
Vec3<T,V2,V3>, Vec4<T,V2,V3,V4>
All Known Implementing Classes:
Float2, Float3, Float4, Int2, Int3, Int4, Obj2, Obj3, Obj4

public interface Vec2<T,V2 extends Vec2<T,V2>>
Utility class for vectors of any object. NOT INTENDED FOR USE AS GENERIC OBJECT VECTOR, USE Obj2
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    _createNew(T x, T y)
    This is an internal method. override in Vec2 subclasses, but DO NOT CALL YOURSELF.
    default T[]
    Create & return an array with all the components of the vector.
    x()
    Returns the x component of this vector.
    default V2
    xy()
    Swizzle method.
    y()
    Returns the y component of this vector.
    default V2
    yx()
    Swizzle method.
  • Method Details

    • x

      T x()
      Returns the x component of this vector.
      Returns:
      the x component of this vector.
    • y

      T y()
      Returns the y component of this vector.
      Returns:
      the y component of this vector.
    • _createNew

      V2 _createNew(T x, T y)
      This is an internal method. override in Vec2 subclasses, but DO NOT CALL YOURSELF.
      Parameters:
      x - the x component.
      y - the y component.
      Returns:
      new <thisType>(x, y);
    • yx

      default V2 yx()
      Swizzle method.
      Returns:
      the yx swizzle of this vector.
    • xy

      default V2 xy()
      Swizzle method.
      Returns:
      the xy swizzle of this vector.
    • asArray

      default T[] asArray()
      Create & return an array with all the components of the vector.
      Returns:
      an array with all the components of the vector.