public interface Vector2fc
Modifier and Type | Method and Description |
---|---|
Vector2f |
add(float x,
float y,
Vector2f dest)
Increment the components of this vector by the given values and store the result in
dest . |
Vector2f |
add(Vector2fc v,
Vector2f dest)
Add the supplied vector to this one and store the result in
dest . |
float |
angle(Vector2fc v)
Return the angle between this vector and the supplied vector.
|
float |
distance(float x,
float y)
Return the distance between
this vector and (x, y). |
float |
distance(Vector2fc v)
Return the distance between this and
v . |
float |
distanceSquared(float x,
float y)
Return the distance squared between
this vector and (x, y). |
float |
distanceSquared(Vector2fc v)
Return the distance squared between this and
v . |
float |
dot(Vector2fc v)
Return the dot product of this vector and
v . |
Vector2f |
fma(float a,
Vector2fc b,
Vector2f dest)
Add the component-wise multiplication of
a * b to this vector
and store the result in dest . |
Vector2f |
fma(Vector2fc a,
Vector2fc b,
Vector2f dest)
Add the component-wise multiplication of
a * b to this vector
and store the result in dest . |
ByteBuffer |
get(ByteBuffer buffer)
Store this vector into the supplied
ByteBuffer at the current
buffer position . |
FloatBuffer |
get(FloatBuffer buffer)
Store this vector into the supplied
FloatBuffer at the current
buffer position . |
ByteBuffer |
get(int index,
ByteBuffer buffer)
Store this vector into the supplied
ByteBuffer starting at the specified
absolute buffer position/index. |
FloatBuffer |
get(int index,
FloatBuffer buffer)
Store this vector into the supplied
FloatBuffer starting at the specified
absolute buffer position/index. |
float |
length()
Return the length of this vector.
|
float |
lengthSquared()
Return the length squared of this vector.
|
Vector2f |
lerp(Vector2fc other,
float t,
Vector2f dest)
Linearly interpolate
this and other using the given interpolation factor t
and store the result in dest . |
Vector2f |
mul(float x,
float y,
Vector2f dest)
Multiply the components of this Vector2f by the given scalar values and store the result in
dest . |
Vector2f |
mul(float scalar,
Vector2f dest)
Multiply the components of this vector by the given scalar and store the result in
dest . |
Vector2f |
mul(Vector2fc v,
Vector2f dest)
Multiply this Vector2f component-wise by another Vector2f and store the result in
dest . |
Vector2f |
negate(Vector2f dest)
Negate this vector and store the result in
dest . |
Vector2f |
normalize(Vector2f dest)
Normalize this vector and store the result in
dest . |
Vector2f |
sub(float x,
float y,
Vector2f dest)
Subtract (x, y) from this vector and store the result in
dest . |
Vector2f |
sub(Vector2fc v,
Vector2f dest)
Subtract
v from this vector and store the result in dest . |
float |
x() |
float |
y() |
float x()
float y()
ByteBuffer get(ByteBuffer buffer)
ByteBuffer
at the current
buffer position
.
This method will not increment the position of the given ByteBuffer.
In order to specify the offset into the ByteBuffer at which
the vector is stored, use get(int, ByteBuffer)
, taking
the absolute position as parameter.
buffer
- will receive the values of this vector in x, y orderget(int, ByteBuffer)
ByteBuffer get(int index, ByteBuffer buffer)
ByteBuffer
starting at the specified
absolute buffer position/index.
This method will not increment the position of the given ByteBuffer.
index
- the absolute position into the ByteBufferbuffer
- will receive the values of this vector in x, y orderFloatBuffer get(FloatBuffer buffer)
FloatBuffer
at the current
buffer position
.
This method will not increment the position of the given FloatBuffer.
In order to specify the offset into the FloatBuffer at which
the vector is stored, use get(int, FloatBuffer)
, taking
the absolute position as parameter.
buffer
- will receive the values of this vector in x, y orderget(int, FloatBuffer)
FloatBuffer get(int index, FloatBuffer buffer)
FloatBuffer
starting at the specified
absolute buffer position/index.
This method will not increment the position of the given FloatBuffer.
index
- the absolute position into the FloatBufferbuffer
- will receive the values of this vector in x, y orderVector2f sub(Vector2fc v, Vector2f dest)
v
from this
vector and store the result in dest
.v
- the vector to subtractdest
- will hold the resultVector2f sub(float x, float y, Vector2f dest)
dest
.x
- the x component to subtracty
- the y component to subtractdest
- will hold the resultfloat dot(Vector2fc v)
v
.v
- the other vectorfloat angle(Vector2fc v)
v
- the other vectorfloat length()
float lengthSquared()
float distance(Vector2fc v)
v
.v
- the other vectorfloat distanceSquared(Vector2fc v)
v
.v
- the other vectorfloat distance(float x, float y)
this
vector and (x, y).x
- the x component of the other vectory
- the y component of the other vectorfloat distanceSquared(float x, float y)
this
vector and (x, y).x
- the x component of the other vectory
- the y component of the other vectorVector2f normalize(Vector2f dest)
dest
.dest
- will hold the resultVector2f add(Vector2fc v, Vector2f dest)
dest
.v
- the vector to adddest
- will hold the resultVector2f add(float x, float y, Vector2f dest)
dest
.x
- the x component to addy
- the y component to adddest
- will hold the resultVector2f negate(Vector2f dest)
dest
.dest
- will hold the resultVector2f mul(float scalar, Vector2f dest)
dest
.scalar
- the value to multiply this vector's components bydest
- will hold the resultVector2f mul(float x, float y, Vector2f dest)
dest
.x
- the x component to multiply this vector byy
- the y component to multiply this vector bydest
- will hold the resultVector2f mul(Vector2fc v, Vector2f dest)
dest
.v
- the vector to multiply bydest
- will hold the resultVector2f lerp(Vector2fc other, float t, Vector2f dest)
this
and other
using the given interpolation factor t
and store the result in dest
.
If t
is 0.0 then the result is this
. If the interpolation factor is 1.0
then the result is other
.
other
- the other vectort
- the interpolation factor between 0.0 and 1.0dest
- will hold the resultVector2f fma(Vector2fc a, Vector2fc b, Vector2f dest)
a * b
to this vector
and store the result in dest
.a
- the first multiplicandb
- the second multiplicanddest
- will hold the resultCopyright © 2015–2016 JOML. All rights reserved.