Example usage for Java com.badlogic.gdx.math Vector2 fields, constructors, methods, implement or subclass
The text is from its open source code.
Vector2(float x, float y) Constructs a vector with the given components | |
Vector2() Constructs a new vector at (0,0) | |
Vector2(Vector2 v) Constructs a vector from the given vector |
Vector2 | add(Vector2 v) |
Vector2 | add(float x, float y) Adds the given components to this vector |
float | angle() |
float | angle(Vector2 reference) |
float | angleRad(Vector2 reference) |
float | angleRad() |
Vector2 | cpy() |
float | crs(Vector2 v) Calculates the 2D cross product between this and the given vector. |
float | dot(Vector2 v) |
float | dst(Vector2 v) |
float | dst(float x, float y) |
float | dst2(Vector2 v) |
float | dst2(float x, float y) |
boolean | epsilonEquals(Vector2 other, float epsilon) |
boolean | equals(Object obj) |
boolean | isUnit() |
boolean | isZero(final float margin) |
boolean | isZero() |
float | len() |
float | len2() |
Vector2 | limit(float limit) |
Vector2 | mul(Matrix3 mat) Left-multiplies this vector by the given matrix |
Vector2 | mulAdd(Vector2 vec, float scalar) |
Vector2 | mulAdd(Vector2 vec, Vector2 mulVec) |
Vector2 | nor() |
Vector2 | rotate(float degrees) Rotates the Vector2 by the given angle, counter-clockwise assuming the y-axis points up. |
Vector2 | rotate90(int dir) Rotates the Vector2 by 90 degrees in the specified direction, where >= 0 is counter-clockwise and < 0 is clockwise. |
Vector2 | rotateRad(float radians) Rotates the Vector2 by the given angle, counter-clockwise assuming the y-axis points up. |
Vector2 | scl(float scalar) |
Vector2 | scl(Vector2 v) |
Vector2 | scl(float x, float y) Multiplies this vector by a scalar |
Vector2 | set(float x, float y) Sets the components of this vector |
Vector2 | set(Vector2 v) |
Vector2 | setAngle(float degrees) Sets the angle of the vector in degrees relative to the x-axis, towards the positive y-axis (typically counter-clockwise). |
Vector2 | setAngleRad(float radians) Sets the angle of the vector in radians relative to the x-axis, towards the positive y-axis (typically counter-clockwise). |
Vector2 | setZero() |
Vector2 | sub(Vector2 v) |
Vector2 | sub(float x, float y) Substracts the other vector from this vector. |