Interface Vector2fc
 All Known Implementing Classes:
Vector2f
 Author:
 Kai Burjack

Method Summary
Modifier and TypeMethodDescriptionCompute the absolute of each of this vector's components and store the result intodest
.Increment the components of this vector by the given values and store the result indest
.Add the supplied vector to this one and store the result indest
.float
Return the angle between this vector and the supplied vector.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 indest
.float
distance(float x, float y)
Return the distance betweenthis
vector and(x, y)
.float
Return the distance between this andv
.float
distanceSquared(float x, float y)
Return the distance squared betweenthis
vector and(x, y)
.float
Return the distance squared between this andv
.Divide the components of this Vector2f by the given scalar values and store the result indest
.Divide all components of thisVector2f
by the given scalar value and store the result indest
.Divide this Vector2f componentwise by another Vector2fc and store the result indest
.float
Return the dot product of this vector andv
.boolean
equals(float x, float y)
Compare the vector components ofthis
vector with the given(x, y)
and return whether all of them are equal.boolean
Compare the vector components ofthis
vector with the given vector using the givendelta
and return whether all of them are equal within a maximum difference ofdelta
.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 indest
.Add the componentwise multiplication ofa * b
to this vector and store the result indest
.Add the componentwise multiplication ofa * b
to this vector and store the result indest
.float
get(int component)
Get the value of the specified component of this vector.get(int index, ByteBuffer buffer)
Store this vector into the suppliedByteBuffer
starting at the specified absolute buffer position/index.get(int index, FloatBuffer buffer)
Store this vector into the suppliedFloatBuffer
starting at the specified absolute buffer position/index.get(ByteBuffer buffer)
Store this vector into the suppliedByteBuffer
at the current bufferposition
.get(FloatBuffer buffer)
Store this vector into the suppliedFloatBuffer
at the current bufferposition
.Set the components of the given vectordest
to those ofthis
vector.Set the components of the given vectordest
to those ofthis
vector.getToAddress(long address)
Store this vector at the given offheap memory address.boolean
isFinite()
float
length()
Return the length of this vector.float
Return the length squared of this vector.Linearly interpolatethis
andother
using the given interpolation factort
and store the result indest
.Set the components ofdest
to be the componentwise maximum of this and the other vector.int
Determine the component with the biggest absolute value.Set the components ofdest
to be the componentwise minimum of this and the other vector.int
Determine the component with the smallest (towards zero) absolute value.Multiply the components of this Vector2f by the given scalar values and store the result indest
.Multiply the components of this vector by the given scalar and store the result indest
.Multiply the given matrix with this Vector2f and store the result indest
.Multiply the given matrix with this Vector2f and store the result indest
.Multiply this Vector2f componentwise by another Vector2f and store the result indest
.mulDirection(Matrix3x2fc mat, Vector2f dest)
Multiply the given 3x2 matrixmat
withthis
and store the result indest
.mulPosition(Matrix3x2fc mat, Vector2f dest)
Multiply the given 3x2 matrixmat
withthis
and store the result indest
.mulTranspose(Matrix2fc mat, Vector2f dest)
Multiply the transpose of the given matrix with this Vector3f and store the result indest
.Negate this vector and store the result indest
.Scale this vector to have the given length and store the result indest
.Normalize this vector and store the result indest
.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 indest
.Subtract(x, y)
from this vector and store the result indest
.Subtractv
fromthis
vector and store the result indest
.float
x()
float
y()

Method Details

x
float x() Returns:
 the value of the x component

y
float y() Returns:
 the value of the y component

get
Store this vector into the suppliedByteBuffer
at the current bufferposition
.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. Parameters:
buffer
 will receive the values of this vector inx, y
order Returns:
 the passed in buffer
 See Also:
get(int, ByteBuffer)

get
Store this vector into the suppliedByteBuffer
starting at the specified absolute buffer position/index.This method will not increment the position of the given ByteBuffer.
 Parameters:
index
 the absolute position into the ByteBufferbuffer
 will receive the values of this vector inx, y
order Returns:
 the passed in buffer

get
Store this vector into the suppliedFloatBuffer
at the current bufferposition
.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. Parameters:
buffer
 will receive the values of this vector inx, y
order Returns:
 the passed in buffer
 See Also:
get(int, FloatBuffer)

get
Store this vector into the suppliedFloatBuffer
starting at the specified absolute buffer position/index.This method will not increment the position of the given FloatBuffer.
 Parameters:
index
 the absolute position into the FloatBufferbuffer
 will receive the values of this vector inx, y
order Returns:
 the passed in buffer

getToAddress
Store this vector at the given offheap memory address.This method will throw an
UnsupportedOperationException
when JOML is used with `Djoml.nounsafe`.This method is unsafe as it can result in a crash of the JVM process when the specified address range does not belong to this process.
 Parameters:
address
 the offheap address where to store this vector Returns:
 this

sub
Subtractv
fromthis
vector and store the result indest
. Parameters:
v
 the vector to subtractdest
 will hold the result Returns:
 dest

sub
Subtract(x, y)
from this vector and store the result indest
. Parameters:
x
 the x component to subtracty
 the y component to subtractdest
 will hold the result Returns:
 dest

dot
Return the dot product of this vector andv
. Parameters:
v
 the other vector Returns:
 the dot product

angle
Return the angle between this vector and the supplied vector. Parameters:
v
 the other vector Returns:
 the angle, in radians

lengthSquared
float lengthSquared()Return the length squared of this vector. Returns:
 the length squared

length
float length()Return the length of this vector. Returns:
 the length

distance
Return the distance between this andv
. Parameters:
v
 the other vector Returns:
 the distance

distanceSquared
Return the distance squared between this andv
. Parameters:
v
 the other vector Returns:
 the distance squared

distance
float distance(float x, float y)Return the distance betweenthis
vector and(x, y)
. Parameters:
x
 the x component of the other vectory
 the y component of the other vector Returns:
 the euclidean distance

distanceSquared
float distanceSquared(float x, float y)Return the distance squared betweenthis
vector and(x, y)
. Parameters:
x
 the x component of the other vectory
 the y component of the other vector Returns:
 the euclidean distance squared

normalize
Normalize this vector and store the result indest
. Parameters:
dest
 will hold the result Returns:
 dest

normalize
Scale this vector to have the given length and store the result indest
. Parameters:
length
 the desired lengthdest
 will hold the result Returns:
 dest

add
Add the supplied vector to this one and store the result indest
. Parameters:
v
 the vector to adddest
 will hold the result Returns:
 dest

add
Increment the components of this vector by the given values and store the result indest
. Parameters:
x
 the x component to addy
 the y component to adddest
 will hold the result Returns:
 dest

negate
Negate this vector and store the result indest
. Parameters:
dest
 will hold the result Returns:
 dest

mul
Multiply the components of this vector by the given scalar and store the result indest
. Parameters:
scalar
 the value to multiply this vector's components bydest
 will hold the result Returns:
 dest

mul
Multiply the components of this Vector2f by the given scalar values and store the result indest
. Parameters:
x
 the x component to multiply this vector byy
 the y component to multiply this vector bydest
 will hold the result Returns:
 dest

mul
Multiply this Vector2f componentwise by another Vector2f and store the result indest
. Parameters:
v
 the vector to multiply bydest
 will hold the result Returns:
 dest

div
Divide all components of thisVector2f
by the given scalar value and store the result indest
. Parameters:
scalar
 the scalar to divide bydest
 will hold the result Returns:
 dest

div
Divide this Vector2f componentwise by another Vector2fc and store the result indest
. Parameters:
v
 the vector to divide bydest
 will hold the result Returns:
 dest

div
Divide the components of this Vector2f by the given scalar values and store the result indest
. Parameters:
x
 the x component to divide this vector byy
 the y component to divide this vector bydest
 will hold the result Returns:
 dest

mul
Multiply the given matrix with this Vector2f and store the result indest
. Parameters:
mat
 the matrixdest
 will hold the result Returns:
 dest

mul
Multiply the given matrix with this Vector2f and store the result indest
. Parameters:
mat
 the matrixdest
 will hold the result Returns:
 dest

mulTranspose
Multiply the transpose of the given matrix with this Vector3f and store the result indest
. Parameters:
mat
 the matrixdest
 will hold the result Returns:
 dest

mulPosition
Multiply the given 3x2 matrixmat
withthis
and store the result indest
.This method assumes the
z
component ofthis
to be1.0
. Parameters:
mat
 the matrix to multiply this vector bydest
 will hold the result Returns:
 dest

mulDirection
Multiply the given 3x2 matrixmat
withthis
and store the result indest
.This method assumes the
z
component ofthis
to be0.0
. Parameters:
mat
 the matrix to multiply this vector bydest
 will hold the result Returns:
 dest

lerp
Linearly interpolatethis
andother
using the given interpolation factort
and store the result indest
.If
t
is0.0
then the result isthis
. If the interpolation factor is1.0
then the result isother
. Parameters:
other
 the other vectort
 the interpolation factor between 0.0 and 1.0dest
 will hold the result Returns:
 dest

fma
Add the componentwise multiplication ofa * b
to this vector and store the result indest
. Parameters:
a
 the first multiplicandb
 the second multiplicanddest
 will hold the result Returns:
 dest

fma
Add the componentwise multiplication ofa * b
to this vector and store the result indest
. Parameters:
a
 the first multiplicandb
 the second multiplicanddest
 will hold the result Returns:
 dest

min
Set the components ofdest
to be the componentwise minimum of this and the other vector. Parameters:
v
 the other vectordest
 will hold the result Returns:
 dest

max
Set the components ofdest
to be the componentwise maximum of this and the other vector. Parameters:
v
 the other vectordest
 will hold the result Returns:
 dest

maxComponent
int maxComponent()Determine the component with the biggest absolute value. Returns:
 the component index, within
[0..1]

minComponent
int minComponent()Determine the component with the smallest (towards zero) absolute value. Returns:
 the component index, within
[0..1]

get
Get the value of the specified component of this vector. Parameters:
component
 the component, within[0..1]
 Returns:
 the value
 Throws:
IllegalArgumentException
 ifcomponent
is not within[0..1]

get
 Parameters:
mode
 theRoundingMode
to usedest
 will hold the result Returns:
 dest

get
Set the components of the given vectordest
to those ofthis
vector. Parameters:
dest
 will hold the result Returns:
 dest

get
Set the components of the given vectordest
to those ofthis
vector. Parameters:
dest
 will hold the result Returns:
 dest

floor
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 indest
. Parameters:
dest
 will hold the result Returns:
 dest

ceil
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 indest
. Parameters:
dest
 will hold the result Returns:
 dest

round
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 indest
. Parameters:
dest
 will hold the result Returns:
 dest

isFinite
boolean isFinite()Determine whether all components are finite floatingpoint values, that is, they are notNaN
and notinfinity
. Returns:
true
if all components are finite floatingpoint values;false
otherwise

absolute
Compute the absolute of each of this vector's components and store the result intodest
. Parameters:
dest
 will hold the result Returns:
 dest

equals
Compare the vector components ofthis
vector with the given vector using the givendelta
and return whether all of them are equal within a maximum difference ofdelta
.Please note that this method is not used by any data structure such as
ArrayList
HashSet
orHashMap
and their operations, such asArrayList.contains(Object)
orHashSet.remove(Object)
, since those data structures only use theObject.equals(Object)
andObject.hashCode()
methods. Parameters:
v
 the other vectordelta
 the allowed maximum difference Returns:
true
whether all of the vector components are equal;false
otherwise

equals
boolean equals(float x, float y)Compare the vector components ofthis
vector with the given(x, y)
and return whether all of them are equal. Parameters:
x
 the x component to compare toy
 the y component to compare to Returns:
true
if all the vector components are equal
