|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.pzgui.math.Vector2i
public class Vector2i
A 2-element vector that is represented by integers x,y coordinates.
| Field Summary | |
|---|---|
int |
x
|
int |
y
|
| Constructor Summary | |
|---|---|
Vector2i()
Constructs and initializes a Vector3 to (0,0,0). |
|
Vector2i(int[] v)
Constructs and initializes a Vector2 from the array of length 3. |
|
Vector2i(int x,
int y)
Constructs and initializes a Vector2 from the specified xy coordinates. |
|
Vector2i(Vector2i v1)
Constructs and initializes a Vector2 from the specified Vector3. |
|
Vector2i(Vector2i from,
Vector2i to)
Constructs and initializes a Vector2 from one point to another |
|
| Method Summary | |
|---|---|
Vector2i |
add(Vector2i v)
adds v to this vector |
static Vector2i |
add(Vector2i v1,
Vector2i v2)
adds v to this vector |
void |
clamp(int xMax,
int yMax)
clamps the values to the specified ranges (minimum value = 0) |
Vector2i |
clone()
|
int |
getX()
|
int |
getY()
|
float |
length()
Returns the length of this vector. |
static Vector2i |
makeUnit(Vector2i v)
adds v to this vector |
Vector2i |
multiply(int s)
multiplies this by vec and returns this |
static Vector2i |
multiply(Vector2i v1,
int s)
returns the product of a vector and a scalar |
void |
set(int x,
int y)
sets the components of this vector |
void |
set(Vector2i pos)
|
void |
setX(int x)
|
void |
setY(int y)
|
Vector2i |
subtract(Vector2i v)
subtracts v from this vector |
static Vector2i |
subtract(Vector2i v1,
Vector2i v2)
adds v to this vector |
java.lang.String |
toString()
|
java.lang.String |
toStringPlain()
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public int x
public int y
| Constructor Detail |
|---|
public Vector2i(int x,
int y)
x - the x coordinatey - the y coordinatepublic Vector2i(int[] v)
v - the array of length 2 containing xyz in orderpublic Vector2i(Vector2i v1)
v1 - the Vector2 containing the initialization x y data
public Vector2i(Vector2i from,
Vector2i to)
public Vector2i()
| Method Detail |
|---|
public int getX()
public int getY()
public void set(Vector2i pos)
public void setX(int x)
public void setY(int y)
public void set(int x,
int y)
public void clamp(int xMax,
int yMax)
public final float length()
public Vector2i add(Vector2i v)
public Vector2i subtract(Vector2i v)
public Vector2i multiply(int s)
public static Vector2i multiply(Vector2i v1,
int s)
public static Vector2i add(Vector2i v1,
Vector2i v2)
public static Vector2i subtract(Vector2i v1,
Vector2i v2)
public static Vector2i makeUnit(Vector2i v)
public Vector2i clone()
clone in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toStringPlain()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||