Java com.badlogic.gdx.math Vector2 fields, constructors, methods, implement or subclass

Example usage for Java com.badlogic.gdx.math Vector2 fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for com.badlogic.gdx.math Vector2.

The text is from its open source code.

Subclass

com.badlogic.gdx.math.Vector2 has subclasses.
Click this link to see all its subclasses.

Field

Vector2X
Vector2Y
Vector2Zero

Constructor

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

Method

Vector2add(Vector2 v)
Vector2add(float x, float y)
Adds the given components to this vector
floatangle()
floatangle(Vector2 reference)
floatangleRad(Vector2 reference)
floatangleRad()
Vector2cpy()
floatcrs(Vector2 v)
Calculates the 2D cross product between this and the given vector.
floatdot(Vector2 v)
floatdst(Vector2 v)
floatdst(float x, float y)
floatdst2(Vector2 v)
floatdst2(float x, float y)
booleanepsilonEquals(Vector2 other, float epsilon)
booleanequals(Object obj)
booleanisUnit()
booleanisZero(final float margin)
booleanisZero()
floatlen()
floatlen2()
Vector2limit(float limit)
Vector2mul(Matrix3 mat)
Left-multiplies this vector by the given matrix
Vector2mulAdd(Vector2 vec, float scalar)
Vector2mulAdd(Vector2 vec, Vector2 mulVec)
Vector2nor()
Vector2rotate(float degrees)
Rotates the Vector2 by the given angle, counter-clockwise assuming the y-axis points up.
Vector2rotate90(int dir)
Rotates the Vector2 by 90 degrees in the specified direction, where >= 0 is counter-clockwise and < 0 is clockwise.
Vector2rotateRad(float radians)
Rotates the Vector2 by the given angle, counter-clockwise assuming the y-axis points up.
Vector2scl(float scalar)
Vector2scl(Vector2 v)
Vector2scl(float x, float y)
Multiplies this vector by a scalar
Vector2set(float x, float y)
Sets the components of this vector
Vector2set(Vector2 v)
Vector2setAngle(float degrees)
Sets the angle of the vector in degrees relative to the x-axis, towards the positive y-axis (typically counter-clockwise).
Vector2setAngleRad(float radians)
Sets the angle of the vector in radians relative to the x-axis, towards the positive y-axis (typically counter-clockwise).
Vector2setZero()
Vector2sub(Vector2 v)
Vector2sub(float x, float y)
Substracts the other vector from this vector.