|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectVector2
public class Vector2
This class contains methods to handle Vector2
objects.
Field Summary | |
---|---|
float |
x
|
float |
y
|
Constructor Summary | |
---|---|
Vector2()
Constructor to create a Vector2 . |
|
Vector2(float x,
float y)
Constructor to create a Vector2 . |
|
Vector2(Vector2 v)
Method to copy a Vector2 object. |
|
Vector2(Vector4 v)
Method to copy a the first 2 components of a Vector4 object
to a Vector2 object. |
Method Summary | |
---|---|
Vector2 |
add(Vector2 v)
Method to add a Vector2 to an existing Vector2 . |
static Vector2 |
add(Vector2 v1,
Vector2 v2)
Static method to add two Vector2 . |
float |
getLength()
Method that returns the length of current Vector2 . |
static Vector2 |
getShortest(Vector2 v1,
Vector2 v2)
Returns the shortest of the two supplied vectors. |
Vector2 |
normalize()
Method to normalize the current Vector2 . |
static float |
pixel2World(int pixel,
Camera c)
Method to convert a image coordinate (1D) to image coordinates. |
static Vector2 |
project(Vector4 p,
Camera c)
Method to project a Vector4 onto an imageplane |
Vector2 |
sub(Vector2 v)
Method to subtract a Vector2 from an current
Vector2 . |
static Vector2 |
sub(Vector2 v1,
Vector2 v2)
Static method to subtract a Vector2 from another |
static int |
world2Pixel(float world,
Camera c)
Method to convert a world position (1D) to image coordinates. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public float x
public float y
Constructor Detail |
---|
public Vector2()
Vector2
.
public Vector2(float x, float y)
Vector2
.
x
- the x value.y
- the y value.public Vector2(Vector2 v)
Vector2
object.
v
- the Vector2
that should be copied.public Vector2(Vector4 v)
Vector4
object
to a Vector2
object.
v
- the Vector4
of which the first 2 component shall be
copied.Method Detail |
---|
public static Vector2 add(Vector2 v1, Vector2 v2)
Vector2
.
v1
- a Vector2
.v2
- a Vector2
.
Vector2
.public Vector2 add(Vector2 v)
Vector2
to an existing Vector2
.
v
- a Vector2
.
Vector2
.public static Vector2 sub(Vector2 v1, Vector2 v2)
Vector2
from another
v1
- a Vector2
v2
- a Vector2
to subtract
Vector2
public Vector2 sub(Vector2 v)
Vector2
from an current
Vector2
.
v
- a Vector2
that should be subtracted.
Vector2
.public float getLength()
Vector2
.
public Vector2 normalize()
Vector2
.
Vector2
.public static Vector2 project(Vector4 p, Camera c)
Vector4
onto an imageplane
c
- the Camera containing the imageplanep
- the Vector4
to project
Vector2
public static int world2Pixel(float world, Camera c)
c
- the camera containing the image coordinates.world
- the point in the world.
public static float pixel2World(int pixel, Camera c)
c
- the camera containing the image coordinates.pixel
- the point in the image (1D).
public static Vector2 getShortest(Vector2 v1, Vector2 v2)
v1
- the first vector.v2
- the second vector.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |