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.
|
Vector2f |
ceil(Vector2f dest)
Compute for each component of this vector the smallest (closest to negative
infinity)
float value that is greater than or equal to that
component and is equal to a mathematical integer and store the result in
dest. |
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. |
boolean |
equals(float x,
float y)
Compare the vector components of
this vector with the given (x, y)
and return whether all of them are equal. |
boolean |
equals(Vector2fc v,
float delta)
Compare the vector components of
this vector with the given vector using the given delta
and return whether all of them are equal within a maximum difference of delta. |
Vector2f |
floor(Vector2f dest)
Compute for each component of this vector the largest (closest to positive
infinity)
float value that is less than or equal to that
component and is equal to a mathematical integer and store the result in
dest. |
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. |
float |
get(int component)
Get the value of the specified component of this vector.
|
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. |
boolean |
isFinite()
|
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 |
max(Vector2fc v,
Vector2f dest)
Set the components of
dest to be the component-wise maximum of this and the other vector. |
int |
maxComponent()
Determine the component with the biggest absolute value.
|
Vector2f |
min(Vector2fc v,
Vector2f dest)
Set the components of
dest to be the component-wise minimum of this and the other vector. |
int |
minComponent()
Determine the component with the smallest (towards zero) absolute value.
|
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(Matrix2dc mat,
Vector2f dest)
Multiply the given matrix with this Vector2f and store the result in
dest. |
Vector2f |
mul(Matrix2fc mat,
Vector2f dest)
Multiply the given matrix with this Vector2f 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 |
mulDirection(Matrix3x2fc mat,
Vector2f dest)
Multiply the given 3x2 matrix
mat with this and store the
result in dest. |
Vector2f |
mulPosition(Matrix3x2fc mat,
Vector2f dest)
Multiply the given 3x2 matrix
mat with this and store the
result in dest. |
Vector2f |
mulTranspose(Matrix2fc mat,
Vector2f dest)
Multiply the transpose of the given matrix with this Vector3f and store the result in
dest. |
Vector2f |
negate(Vector2f dest)
Negate this vector and store the result in
dest. |
Vector2f |
normalize(float length,
Vector2f dest)
Scale this vector to have the given length and store the result in
dest. |
Vector2f |
normalize(Vector2f dest)
Normalize this vector and store the result in
dest. |
Vector2f |
round(Vector2f dest)
Compute for each component of this vector the closest float that is equal to
a mathematical integer, with ties rounding to positive infinity 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)
(x, y) from this vector and store the result in 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 lengthSquared()
float length()
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 normalize(float length, Vector2f dest)
dest.length - the desired lengthdest - 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 mul(Matrix2fc mat, Vector2f dest)
dest.mat - the matrixdest - will hold the resultVector2f mul(Matrix2dc mat, Vector2f dest)
dest.mat - the matrixdest - will hold the resultVector2f mulTranspose(Matrix2fc mat, Vector2f dest)
dest.mat - the matrixdest - will hold the resultVector2f mulPosition(Matrix3x2fc mat, Vector2f dest)
mat with this and store the
result in dest.
This method assumes the z component of this to be 1.0.
mat - the matrix to multiply this vector bydest - will hold the resultVector2f mulDirection(Matrix3x2fc mat, Vector2f dest)
mat with this and store the
result in dest.
This method assumes the z component of this to be 0.0.
mat - the matrix to multiply this vector 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 resultVector2f fma(float 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 resultVector2f min(Vector2fc v, Vector2f dest)
dest to be the component-wise minimum of this and the other vector.v - the other vectordest - will hold the resultVector2f max(Vector2fc v, Vector2f dest)
dest to be the component-wise maximum of this and the other vector.v - the other vectordest - will hold the resultint maxComponent()
[0..1]int minComponent()
[0..1]float get(int component) throws IllegalArgumentException
component - the component, within [0..1]IllegalArgumentException - if component is not within [0..1]Vector2f floor(Vector2f dest)
float value that is less than or equal to that
component and is equal to a mathematical integer and store the result in
dest.dest - will hold the resultVector2f ceil(Vector2f dest)
float value that is greater than or equal to that
component and is equal to a mathematical integer and store the result in
dest.dest - will hold the resultVector2f round(Vector2f dest)
dest.dest - will hold the resultboolean isFinite()
NaN and not
infinity.true if all components are finite floating-point values;
false otherwiseboolean equals(Vector2fc v, float delta)
this vector with the given vector using the given delta
and return whether all of them are equal within a maximum difference of delta.
Please note that this method is not used by any data structure such as ArrayList HashSet or HashMap
and their operations, such as ArrayList.contains(Object) or HashSet.remove(Object), since those
data structures only use the Object.equals(Object) and Object.hashCode() methods.
v - the other vectordelta - the allowed maximum differencetrue whether all of the vector components are equal; false otherwiseboolean equals(float x,
float y)
this vector with the given (x, y)
and return whether all of them are equal.x - the x component to compare toy - the y component to compare totrue if all the vector components are equalCopyright © 2015–2019 JOML. All rights reserved.