Package zombie.iso
Class Vector2
java.lang.Object
zombie.iso.Vector2
- All Implemented Interfaces:
java.lang.Cloneable
public class Vector2
extends java.lang.Object
implements java.lang.Cloneable
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description Vector2
add(Vector2 other)
Vector2
addToThis(Vector2 other)
Vector2
aimAt(Vector2 other)
float
angleTo(Vector2 other)
Vector2
clone()
float
distanceTo(Vector2 other)
static float
dot(float x, float y, float tx, float ty)
float
dot(Vector2 other)
boolean
equals(java.lang.Object other)
static Vector2
fromAwtPoint(java.awt.Point p)
static Vector2
fromLengthDirection(float length, float direction)
float
getDirection()
float
getLength()
float
getX()
float
getY()
void
normalize()
void
rotate(float rad)
Vector2
set(float x, float y)
Vector2
set(Vector2 other)
Vector2
setDirection(float direction)
Vector2
setLength(float length)
Vector2
setLengthAndDirection(float direction, float length)
void
setX(float x)
void
setY(float y)
void
tangent()
java.awt.Dimension
toAwtDimension()
java.awt.Point
toAwtPoint()
java.lang.String
toString()
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
x
public float x -
y
public float y
-
-
Constructor Details
-
Vector2
public Vector2() -
Vector2
-
Vector2
public Vector2(float x, float y)
-
-
Method Details
-
rotate
public void rotate(float rad) -
fromAwtPoint
-
fromLengthDirection
-
add
-
addToThis
-
aimAt
-
angleTo
-
clone
- Overrides:
clone
in classjava.lang.Object
-
distanceTo
-
dot
-
dot
public static float dot(float x, float y, float tx, float ty) -
equals
public boolean equals(java.lang.Object other)- Overrides:
equals
in classjava.lang.Object
-
getDirection
public float getDirection() -
getLength
public float getLength() -
normalize
public void normalize() -
set
-
set
-
setDirection
-
setLength
-
setLengthAndDirection
-
toAwtDimension
public java.awt.Dimension toAwtDimension() -
toAwtPoint
public java.awt.Point toAwtPoint() -
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
getX
public float getX() -
setX
public void setX(float x) -
getY
public float getY() -
setY
public void setY(float y) -
tangent
public void tangent()
-