public interface Vector2ic
| Modifier and Type | Method and Description |
|---|---|
Vector2i |
add(int x,
int y,
Vector2i dest)
Increment the components of this vector by the given values and store the
result in
dest. |
Vector2i |
add(Vector2ic v,
Vector2i dest)
Add the supplied vector to this one and store the result in
dest. |
double |
distance(int x,
int y)
Return the distance between
this vector and (x, y). |
double |
distance(Vector2ic v)
Return the distance between this Vector and
v. |
long |
distanceSquared(int x,
int y)
Return the square of the distance between
this vector and
(x, y). |
long |
distanceSquared(Vector2ic v)
Return the square of the distance between this vector and
v. |
boolean |
equals(int x,
int y)
Compare the vector components of
this vector with the given (x, y)
and return whether all of them are equal. |
ByteBuffer |
get(ByteBuffer buffer)
Store this vector into the supplied
ByteBuffer at the current
buffer position. |
int |
get(int component)
Get the value of the specified component of this vector.
|
IntBuffer |
get(IntBuffer buffer)
|
ByteBuffer |
get(int index,
ByteBuffer buffer)
Store this vector into the supplied
ByteBuffer starting at the
specified absolute buffer position/index. |
IntBuffer |
get(int index,
IntBuffer buffer)
Store this vector into the supplied
IntBuffer starting at the
specified absolute buffer position/index. |
long |
gridDistance(int x,
int y)
Return the grid distance in between (aka 1-Norm, Minkowski or Manhattan distance)
(x, y). |
long |
gridDistance(Vector2ic v)
Return the grid distance in between (aka 1-Norm, Minkowski or Manhattan distance)
(x, y). |
double |
length()
Return the length of this vector.
|
long |
lengthSquared()
Return the length squared of this vector.
|
Vector2i |
max(Vector2ic v,
Vector2i 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.
|
Vector2i |
min(Vector2ic v,
Vector2i 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.
|
Vector2i |
mul(int x,
int y,
Vector2i dest)
Multiply the components of this vector by the given values and store the
result in
dest. |
Vector2i |
mul(int scalar,
Vector2i dest)
Multiply all components of this
Vector2ic by the given scalar
value and store the result in dest. |
Vector2i |
mul(Vector2ic v,
Vector2i dest)
Multiply the supplied vector by this one and store the result in
dest. |
Vector2i |
negate(Vector2i dest)
Negate this vector and store the result in
dest. |
Vector2i |
sub(int x,
int y,
Vector2i dest)
Decrement the components of this vector by the given values and store the
result in
dest. |
Vector2i |
sub(Vector2ic v,
Vector2i dest)
Subtract the supplied vector from this one and store the result in
dest. |
int |
x() |
int |
y() |
int x()
int 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 orderIntBuffer get(IntBuffer buffer)
IntBuffer at the current
buffer position.
This method will not increment the position of the given IntBuffer.
In order to specify the offset into the IntBuffer at which the vector is
stored, use get(int, IntBuffer), taking the absolute position as
parameter.
buffer - will receive the values of this vector in x, y orderget(int, IntBuffer)IntBuffer get(int index, IntBuffer buffer)
IntBuffer starting at the
specified absolute buffer position/index.
This method will not increment the position of the given IntBuffer.
index - the absolute position into the IntBufferbuffer - will receive the values of this vector in x, y orderVector2i sub(Vector2ic v, Vector2i dest)
dest.v - the vector to subtractdest - will hold the resultVector2i sub(int x, int y, Vector2i dest)
dest.x - the x component to subtracty - the y component to subtractdest - will hold the resultlong lengthSquared()
double length()
double distance(Vector2ic v)
v.v - the other vectordouble distance(int x,
int y)
this vector and (x, y).x - the x component of the other vectory - the y component of the other vectorlong distanceSquared(Vector2ic v)
v.v - the other vectorlong distanceSquared(int x,
int y)
this vector and
(x, y).x - the x component of the other vectory - the y component of the other vectorlong gridDistance(Vector2ic v)
(x, y).v - the other vectorlong gridDistance(int x,
int y)
(x, y).x - the x component of the other vectory - the y component of the other vectorVector2i add(Vector2ic v, Vector2i dest)
dest.v - the vector to adddest - will hold the resultVector2i add(int x, int y, Vector2i dest)
dest.x - the x component to addy - the y component to adddest - will hold the resultVector2i mul(int scalar, Vector2i dest)
Vector2ic by the given scalar
value and store the result in dest.scalar - the scalar to multiply this vector bydest - will hold the resultVector2i mul(Vector2ic v, Vector2i dest)
dest.v - the vector to multiplydest - will hold the resultVector2i mul(int x, int y, Vector2i dest)
dest.x - the x component to multiplyy - the y component to multiplydest - will hold the resultVector2i negate(Vector2i dest)
dest.dest - will hold the resultVector2i min(Vector2ic v, Vector2i dest)
dest to be the component-wise minimum of this and the other vector.v - the other vectordest - will hold the resultVector2i max(Vector2ic v, Vector2i 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]int get(int component) throws IllegalArgumentException
component - the component, within [0..1]IllegalArgumentException - if component is not within [0..1]boolean equals(int x,
int 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.