Class Vector2

java.lang.Object
zombie.iso.Vector2
All Implemented Interfaces:
Cloneable

public final class Vector2 extends Object implements Cloneable
  • Field Details

    • x

      public float x
    • y

      public float y
  • Constructor Details

    • Vector2

      public Vector2()
    • Vector2

      public Vector2(Vector2 other)
    • Vector2

      public Vector2(float x, float y)
  • Method Details

    • fromLengthDirection

      public static Vector2 fromLengthDirection(float length, float direction)
    • dot

      public static float dot(float x, float y, float tx, float ty)
    • addScaled

      public static Vector2 addScaled(Vector2 a, Vector2 b, float scale, Vector2 result)
    • rotate

      public void rotate(float radians)
    • add

      public Vector2 add(Vector2 other)
    • aimAt

      public Vector2 aimAt(Vector2 other)
    • angleTo

      public float angleTo(Vector2 other)
    • angleBetween

      public float angleBetween(Vector2 other)
    • clone

      public Vector2 clone()
    • distanceTo

      public float distanceTo(Vector2 other)
    • dot

      public float dot(Vector2 other)
    • dot

      public float dot(float otherX, float otherY)
    • equals

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

      public float getDirection()
    • getDirection

      public static float getDirection(float x, float y)
    • getDirectionNeg

      @Deprecated public float getDirectionNeg()
      Deprecated.
    • setDirection

      public Vector2 setDirection(float directionRadians)
    • getLength

      public float getLength()
    • getLengthSquared

      public float getLengthSquared()
    • setLength

      public Vector2 setLength(float length)
    • setMaxLength

      public float setMaxLength(float maxLength)
    • normalize

      public float normalize()
    • set

      public Vector2 set(Vector2 other)
    • set

      public Vector2 set(float x, float y)
    • setLengthAndDirection

      public Vector2 setLengthAndDirection(float direction, float length)
    • mul

      public Vector2 mul(float m)
    • toString

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

      public float getX()
    • setX

      public void setX(float x)
    • getY

      public float getY()
    • setY

      public void setY(float y)
    • floorX

      public int floorX()
    • floorY

      public int floorY()
    • tangent

      public void tangent()
    • scale

      public void scale(float scale)
    • scale

      public static Vector2 scale(Vector2 val, float scale)
    • moveTowards

      public static Vector2 moveTowards(Vector2 currentVector, Vector2 targetVector, float maxDistanceDelta)