Modifier and Type | Method and Description |
---|---|
T |
add(T v)
Adds the given vector to this vector
|
T |
clamp(float min,
float max)
Clamps this vector's length to given value
|
T |
cpy() |
float |
dot(T v) |
float |
dst(T v) |
float |
dst2(T v)
This is much faster to calculate than
dst(Vector)
It avoids a calculating square root, so it is mostly useful for comparisons |
float |
len() |
float |
len2() |
T |
lerp(T target,
float alpha)
Linearly interpolates between this vector and the target vector by alpha which is in the range [0,1].
|
T |
limit(float limit)
Limits this vector's length to given value
|
T |
nor()
Normalizes this vector.
|
T |
scl(float scalar)
Scales this vector by a scalar
|
T |
scl(T v)
Scales this vector by another vector
|
T |
set(T v)
Sets this vector from the given vector
|
T |
sub(T v)
Substracts the given vector from this vector.
|
T cpy()
float len()
float len2()
T limit(float limit)
T clamp(float min, float max)
min
- Min lengthmax
- Max lengthT set(T v)
v
- The vectorT sub(T v)
v
- The vectorT nor()
T add(T v)
v
- The vectorfloat dot(T v)
v
- The other vectorT scl(float scalar)
scalar
- The scalarfloat dst(T v)
v
- The other vectorfloat dst2(T v)
dst(Vector)
It avoids a calculating square root, so it is mostly useful for comparisonsv
- The other vector