public class Vector extends AbstractVector
Modifier and Type | Field and Description |
---|---|
float |
x
The x-component of the vector.
|
float |
y
The y-component of the vector.
|
Constructor and Description |
---|
Vector()
Creates a vector with zero x and y components.
|
Vector(float x,
float y)
Creates a vector with the specified x and y components.
|
Vector(XY other)
Creates a vector equal to
other . |
Modifier and Type | Method and Description |
---|---|
Vector |
addLocal(float x,
float y)
Adds a vector in-place to this one.
|
Vector |
addLocal(IVector other)
Adds a vector in-place to this one.
|
Vector |
addScaledLocal(IVector other,
float v)
Adds a scaled vector in-place to this one.
|
Vector |
crossLocal(IVector other)
Computes the cross product of this and the specified other vector, storing the result in
this vector.
|
Vector |
lerpLocal(IVector other,
float t)
Linearly interpolates between this and
other in-place by the supplied amount. |
Vector |
negateLocal()
Negates this vector in-place.
|
Vector |
normalizeLocal()
Normalizes this vector in-place.
|
Vector |
rotateLocal(float angle)
Rotates this vector in-place by the specified angle.
|
Vector |
scaleLocal(float v)
Scales this vector in place, uniformly by the specified magnitude.
|
Vector |
scaleLocal(IVector other)
Scales this vector's x and y components, in place, independently by the x and y components
of the supplied vector.
|
Vector |
set(float[] values)
Copies the elements of an array.
|
Vector |
set(float x,
float y)
Sets all of the elements of the vector.
|
Vector |
set(XY other)
Copies the elements of another vector.
|
Vector |
setAngle(float angle)
Sets this vector's angle, preserving its magnitude.
|
Vector |
setLength(float length)
Sets this vector's magnitude, preserving its angle.
|
Vector |
subtractLocal(float x,
float y)
Subtracts a vector in-place from this one.
|
Vector |
subtractLocal(IVector other)
Subtracts a vector in-place from this one.
|
float |
x()
The x coordinate.
|
float |
y()
The y coordinate.
|
add, add, add, add, addScaled, addScaled, angle, angleBetween, clone, cross, cross, distance, distanceSq, dot, equals, hashCode, isZero, length, lengthSq, lerp, lerp, negate, negate, normalize, normalize, rotate, rotate, rotateAndAdd, rotateScaleAndAdd, scale, scale, scale, scale, subtract, subtract, subtract, subtract, toString
public float x
public float y
public Vector(float x, float y)
public Vector(XY other)
other
.public Vector()
public Vector crossLocal(IVector other)
public Vector negateLocal()
public Vector normalizeLocal()
public Vector scaleLocal(float v)
public Vector scaleLocal(IVector other)
public Vector addLocal(IVector other)
public Vector subtractLocal(IVector other)
public Vector addLocal(float x, float y)
public Vector subtractLocal(float x, float y)
public Vector addScaledLocal(IVector other, float v)
public Vector rotateLocal(float angle)
public Vector lerpLocal(IVector other, float t)
other
in-place by the supplied amount.public Vector set(XY other)
public Vector set(float[] values)
public Vector set(float x, float y)
public Vector setAngle(float angle)
public Vector setLength(float length)
public float x()
XY
public float y()
XY
Copyright © 2017. All rights reserved.