public class Vector4f extends Object implements Externalizable, Vector4fc
| Modifier and Type | Field and Description |
|---|---|
float |
w
The w component of the vector.
|
float |
x
The x component of the vector.
|
float |
y
The y component of the vector.
|
float |
z
The z component of the vector.
|
| Constructor and Description |
|---|
Vector4f()
Create a new
Vector4f of (0, 0, 0, 1). |
Vector4f(ByteBuffer buffer)
Create a new
Vector4f and read this vector from the supplied ByteBuffer
at the current buffer position. |
Vector4f(float d)
Create a new
Vector4f and initialize all four components with the given value. |
Vector4f(FloatBuffer buffer)
Create a new
Vector4f and read this vector from the supplied FloatBuffer
at the current buffer position. |
Vector4f(float x,
float y,
float z,
float w)
Create a new
Vector4f with the given component values. |
Vector4f(int index,
ByteBuffer buffer)
Create a new
Vector4f and read this vector from the supplied ByteBuffer
starting at the specified absolute buffer position/index. |
Vector4f(int index,
FloatBuffer buffer)
Create a new
Vector4f and read this vector from the supplied FloatBuffer
starting at the specified absolute buffer position/index. |
Vector4f(Vector2fc v,
float z,
float w)
|
Vector4f(Vector2ic v,
float z,
float w)
|
Vector4f(Vector3fc v,
float w)
|
Vector4f(Vector3ic v,
float w)
|
Vector4f(Vector4fc v)
Create a new
Vector4f with the same values as v. |
Vector4f(Vector4ic v)
Create a new
Vector4f with the same values as v. |
| Modifier and Type | Method and Description |
|---|---|
Vector4f |
add(float x,
float y,
float z,
float w)
Increment the components of this vector by the given values.
|
Vector4f |
add(float x,
float y,
float z,
float w,
Vector4f dest)
Increment the components of this vector by the given values and store the result in
dest. |
Vector4f |
add(Vector4fc v)
Add the supplied vector to this one.
|
Vector4f |
add(Vector4fc v,
Vector4f dest)
Add the supplied vector to this one and store the result in
dest. |
float |
angle(Vector4fc v)
Return the angle between this vector and the supplied vector.
|
float |
angleCos(Vector4fc v)
Return the cosine of the angle between this vector and the supplied vector.
|
Vector4f |
ceil()
Set each component of this vector to the smallest (closest to negative
infinity)
float value that is greater than or equal to that
component and is equal to a mathematical integer. |
Vector4f |
ceil(Vector4f 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,
float z,
float w)
Return the distance between
this vector and (x, y, z, w). |
static float |
distance(float x1,
float y1,
float z1,
float w1,
float x2,
float y2,
float z2,
float w2)
Return the distance between
(x1, y1, z1, w1) and (x2, y2, z2, w2). |
float |
distance(Vector4fc v)
Return the distance between this Vector and
v. |
float |
distanceSquared(float x,
float y,
float z,
float w)
Return the square of the distance between
this vector and
(x, y, z, w). |
static float |
distanceSquared(float x1,
float y1,
float z1,
float w1,
float x2,
float y2,
float z2,
float w2)
Return the squared distance between
(x1, y1, z1, w1) and (x2, y2, z2, w2). |
float |
distanceSquared(Vector4fc v)
Return the square of the distance between this vector and
v. |
Vector4f |
div(float scalar)
Divide all components of this
Vector4f by the given scalar
value. |
Vector4f |
div(float x,
float y,
float z,
float w)
Divide the components of this Vector4f by the given scalar values and store the result in
this. |
Vector4f |
div(float x,
float y,
float z,
float w,
Vector4f dest)
Divide the components of this Vector4f by the given scalar values and store the result in
dest. |
Vector4f |
div(float scalar,
Vector4f dest)
Divide all components of this
Vector4f by the given scalar
value and store the result in dest. |
Vector4f |
div(Vector4fc v)
Divide this Vector4f component-wise by another Vector4f.
|
Vector4f |
div(Vector4fc v,
Vector4f dest)
Divide this Vector4f component-wise by another Vector4f and store the result in
dest. |
float |
dot(float x,
float y,
float z,
float w)
Compute the dot product (inner product) of this vector and
(x, y, z, w). |
float |
dot(Vector4fc v)
Compute the dot product (inner product) of this vector and
v
. |
boolean |
equals(float x,
float y,
float z,
float w)
Compare the vector components of
this vector with the given (x, y, z, w)
and return whether all of them are equal. |
boolean |
equals(Object obj) |
boolean |
equals(Vector4fc 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. |
Vector4f |
floor()
Set each component of this vector to the largest (closest to positive
infinity)
float value that is less than or equal to that
component and is equal to a mathematical integer. |
Vector4f |
floor(Vector4f 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. |
Vector4f |
fma(float a,
Vector4fc b)
Add the component-wise multiplication of
a * b to this vector. |
Vector4f |
fma(float a,
Vector4fc b,
Vector4f dest)
Add the component-wise multiplication of
a * b to this vector
and store the result in dest. |
Vector4f |
fma(Vector4fc a,
Vector4fc b)
Add the component-wise multiplication of
a * b to this vector. |
Vector4f |
fma(Vector4fc a,
Vector4fc b,
Vector4f 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. |
int |
hashCode() |
Vector4f |
hermite(Vector4fc t0,
Vector4fc v1,
Vector4fc t1,
float t,
Vector4f dest)
Compute a hermite interpolation between
this vector and its
associated tangent t0 and the given vector v
with its tangent t1 and store the result in
dest. |
boolean |
isFinite()
|
float |
length()
Return the length of this vector.
|
static float |
length(float x,
float y,
float z,
float w)
Get the length of a 4-dimensional single-precision vector.
|
float |
lengthSquared()
Return the length squared of this vector.
|
static float |
lengthSquared(float x,
float y,
float z,
float w)
Get the length squared of a 4-dimensional single-precision vector.
|
static float |
lengthSquared(int x,
int y,
int z,
int w) |
Vector4f |
lerp(Vector4fc other,
float t)
Linearly interpolate
this and other using the given interpolation factor t
and store the result in this. |
Vector4f |
lerp(Vector4fc other,
float t,
Vector4f dest)
Linearly interpolate
this and other using the given interpolation factor t
and store the result in dest. |
Vector4f |
max(Vector4fc v)
Set the components of this vector to be the component-wise maximum of this and the other vector.
|
Vector4f |
max(Vector4fc v,
Vector4f 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.
|
Vector4f |
min(Vector4fc v)
Set the components of this vector to be the component-wise minimum of this and the other vector.
|
Vector4f |
min(Vector4fc v,
Vector4f 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.
|
Vector4f |
mul(float scalar)
Multiply all components of this
Vector4f by the given scalar
value. |
Vector4f |
mul(float x,
float y,
float z,
float w)
Multiply the components of this Vector4f by the given scalar values and store the result in
this. |
Vector4f |
mul(float x,
float y,
float z,
float w,
Vector4f dest)
Multiply the components of this Vector4f by the given scalar values and store the result in
dest. |
Vector4f |
mul(float scalar,
Vector4f dest)
Multiply all components of this
Vector4f by the given scalar
value and store the result in dest. |
Vector4f |
mul(Matrix4fc mat)
Multiply the given matrix mat with this Vector4f and store the result in
this. |
Vector4f |
mul(Matrix4fc mat,
Vector4f dest)
Multiply the given matrix mat with this Vector4f and store the result in
dest. |
Vector4f |
mul(Matrix4x3fc mat)
Multiply the given matrix mat with this Vector4f and store the result in
this. |
Vector4f |
mul(Matrix4x3fc mat,
Vector4f dest)
Multiply the given matrix mat with this Vector4f and store the result in
dest. |
Vector4f |
mul(Vector4fc v)
Multiply this Vector4f component-wise by another Vector4f.
|
Vector4f |
mul(Vector4fc v,
Vector4f dest)
Multiply this Vector4f component-wise by another Vector4f and store the result in
dest. |
Vector4f |
mulAffine(Matrix4fc mat,
Vector4f dest)
Multiply the given affine matrix mat with this Vector4f and store the result in
dest. |
Vector4f |
mulProject(Matrix4fc mat)
Multiply the given matrix
mat with this Vector4f, perform perspective division. |
Vector4f |
mulProject(Matrix4fc mat,
Vector4f dest)
Multiply the given matrix
mat with this Vector4f, perform perspective division
and store the result in dest. |
Vector4f |
negate()
Negate this vector.
|
Vector4f |
negate(Vector4f dest)
Negate this vector and store the result in
dest. |
Vector4f |
normalize()
Normalizes this vector.
|
Vector4f |
normalize(float length)
Scale this vector to have the given length.
|
Vector4f |
normalize(float length,
Vector4f dest)
Scale this vector to have the given length and store the result in
dest. |
Vector4f |
normalize(Vector4f dest)
Normalizes this vector and store the result in
dest. |
Vector4f |
normalize3()
Normalize this vector by computing only the norm of
(x, y, z). |
Vector4f |
normalize3(Vector4f dest) |
void |
readExternal(ObjectInput in) |
Vector4f |
rotate(Quaternionfc quat)
Rotate this vector by the given quaternion
quat and store the result in this. |
Vector4f |
rotate(Quaternionfc quat,
Vector4f dest)
Rotate this vector by the given quaternion
quat and store the result in dest. |
Vector4f |
rotateAbout(float angle,
float x,
float y,
float z)
Rotate this vector the specified radians around the given rotation axis.
|
Vector4f |
rotateAxis(float angle,
float aX,
float aY,
float aZ,
Vector4f dest)
Rotate this vector the specified radians around the given rotation axis and store the result
into
dest. |
Vector4f |
rotateX(float angle)
Rotate this vector the specified radians around the X axis.
|
Vector4f |
rotateX(float angle,
Vector4f dest)
Rotate this vector the specified radians around the X axis and store the result
into
dest. |
Vector4f |
rotateY(float angle)
Rotate this vector the specified radians around the Y axis.
|
Vector4f |
rotateY(float angle,
Vector4f dest)
Rotate this vector the specified radians around the Y axis and store the result
into
dest. |
Vector4f |
rotateZ(float angle)
Rotate this vector the specified radians around the Z axis.
|
Vector4f |
rotateZ(float angle,
Vector4f dest)
Rotate this vector the specified radians around the Z axis and store the result
into
dest. |
Vector4f |
round()
Set each component of this vector to the closest float that is equal to
a mathematical integer, with ties rounding to positive infinity.
|
Vector4f |
round(Vector4f 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. |
Vector4f |
set(ByteBuffer buffer)
Read this vector from the supplied
ByteBuffer at the current
buffer position. |
Vector4f |
set(float d)
Set the x, y, z, and w components to the supplied value.
|
Vector4f |
set(FloatBuffer buffer)
Read this vector from the supplied
FloatBuffer at the current
buffer position. |
Vector4f |
set(float x,
float y,
float z,
float w)
Set the x, y, z, and w components to the supplied values.
|
Vector4f |
set(int index,
ByteBuffer buffer)
Read this vector from the supplied
ByteBuffer starting at the specified
absolute buffer position/index. |
Vector4f |
set(int index,
FloatBuffer buffer)
Read this vector from the supplied
FloatBuffer starting at the specified
absolute buffer position/index. |
Vector4f |
set(Vector2fc v,
float z,
float w)
Sets the first two components of this to the components of given
v
and last two components to the given z, and w. |
Vector4f |
set(Vector2ic v,
float z,
float w)
Sets the first two components of this to the components of given
v
and last two components to the given z, and w. |
Vector4f |
set(Vector3fc v,
float w)
Set the first three components of this to the components of
v and the last component to w. |
Vector4f |
set(Vector3ic v,
float w)
Set the first three components of this to the components of
v and the last component to w. |
Vector4f |
set(Vector4dc v)
Set this
Vector4f to the values of the given v. |
Vector4f |
set(Vector4fc v)
Set this
Vector4f to the values of the given v. |
Vector4f |
set(Vector4ic v)
Set this
Vector4f to the values of the given v. |
Vector4f |
setComponent(int component,
float value)
Set the value of the specified component of this vector.
|
Vector4f |
smoothStep(Vector4fc v,
float t,
Vector4f dest)
Compute a smooth-step (i.e.
|
Vector4f |
sub(float x,
float y,
float z,
float w)
Subtract
(x, y, z, w) from this. |
Vector4f |
sub(float x,
float y,
float z,
float w,
Vector4f dest)
Subtract
(x, y, z, w) from this and store the result in dest. |
Vector4f |
sub(Vector4fc v)
Subtract the supplied vector from this one.
|
Vector4f |
sub(Vector4fc v,
Vector4f dest)
Subtract the supplied vector from this one and store the result in
dest. |
String |
toString()
Return a string representation of this vector.
|
String |
toString(NumberFormat formatter)
Return a string representation of this vector by formatting the vector components with the given
NumberFormat. |
float |
w() |
void |
writeExternal(ObjectOutput out) |
float |
x() |
float |
y() |
float |
z() |
Vector4f |
zero()
Set all components to zero.
|
public float x
public float y
public float z
public float w
public Vector4f()
Vector4f of (0, 0, 0, 1).public Vector4f(Vector4fc v)
Vector4f with the same values as v.v - the Vector4fc to copy the values frompublic Vector4f(Vector4ic v)
Vector4f with the same values as v.v - the Vector4ic to copy the values frompublic Vector4f(Vector2fc v, float z, float w)
v - the Vector2fcz - the z componentw - the w componentpublic Vector4f(Vector2ic v, float z, float w)
v - the Vector2icz - the z componentw - the w componentpublic Vector4f(float d)
Vector4f and initialize all four components with the given value.d - the value of all four componentspublic Vector4f(float x,
float y,
float z,
float w)
Vector4f with the given component values.x - the x componenty - the y componentz - the z componentw - the w componentpublic Vector4f(ByteBuffer buffer)
Vector4f and read this vector from the supplied 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 read, use Vector4f(int, ByteBuffer), taking
the absolute position as parameter.
buffer - values will be read in x, y, z, w orderVector4f(int, ByteBuffer)public Vector4f(int index,
ByteBuffer buffer)
Vector4f and read this vector from the supplied 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 - values will be read in x, y, z, w orderpublic Vector4f(FloatBuffer buffer)
Vector4f and read this vector from the supplied 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 read, use Vector4f(int, FloatBuffer), taking
the absolute position as parameter.
buffer - values will be read in x, y, z, w orderVector4f(int, FloatBuffer)public Vector4f(int index,
FloatBuffer buffer)
Vector4f and read this vector from the supplied 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 - values will be read in x, y, z, w orderpublic Vector4f set(Vector4fc v)
Vector4f to the values of the given v.v - the vector whose values will be copied into thispublic Vector4f set(Vector4ic v)
Vector4f to the values of the given v.v - the vector whose values will be copied into thispublic Vector4f set(Vector4dc v)
Vector4f to the values of the given v.
Note that due to the given vector v storing the components in double-precision,
there is the possibility to lose precision.
v - the vector whose values will be copied into thispublic Vector4f set(Vector3fc v, float w)
v and the last component to w.v - the Vector3fc to copyw - the w componentpublic Vector4f set(Vector3ic v, float w)
v and the last component to w.v - the Vector3ic to copyw - the w componentpublic Vector4f set(Vector2fc v, float z, float w)
v
and last two components to the given z, and w.v - the Vector2fcz - the z componentw - the w componentpublic Vector4f set(Vector2ic v, float z, float w)
v
and last two components to the given z, and w.v - the Vector2icz - the z componentw - the w componentpublic Vector4f set(float d)
d - the value of all four componentspublic Vector4f set(float x, float y, float z, float w)
x - the x componenty - the y componentz - the z componentw - the w componentpublic Vector4f set(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 read, use set(int, ByteBuffer), taking
the absolute position as parameter.
buffer - values will be read in x, y, z, w orderset(int, ByteBuffer)public Vector4f set(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 - values will be read in x, y, z, w orderpublic Vector4f set(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 read, use set(int, FloatBuffer), taking
the absolute position as parameter.
buffer - values will be read in x, y, z, w orderset(int, FloatBuffer)public Vector4f set(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 - values will be read in x, y, z, w orderpublic Vector4f setComponent(int component, float value) throws IllegalArgumentException
component - the component whose value to set, within [0..3]value - the value to setIllegalArgumentException - if component is not within [0..3]public FloatBuffer get(FloatBuffer buffer)
Vector4fcFloatBuffer 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 Vector4fc.get(int, FloatBuffer), taking
the absolute position as parameter.
get in interface Vector4fcbuffer - will receive the values of this vector in x, y, z, w orderVector4fc.get(int, FloatBuffer)public FloatBuffer get(int index, FloatBuffer buffer)
Vector4fcFloatBuffer starting at the specified
absolute buffer position/index.
This method will not increment the position of the given FloatBuffer.
public ByteBuffer get(ByteBuffer buffer)
Vector4fcByteBuffer 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 Vector4fc.get(int, ByteBuffer), taking
the absolute position as parameter.
get in interface Vector4fcbuffer - will receive the values of this vector in x, y, z, w orderVector4fc.get(int, ByteBuffer)public ByteBuffer get(int index, ByteBuffer buffer)
Vector4fcByteBuffer starting at the specified
absolute buffer position/index.
This method will not increment the position of the given ByteBuffer.
public Vector4f sub(Vector4fc v)
v - the vector to subtractpublic Vector4f sub(float x, float y, float z, float w)
(x, y, z, w) from this.x - the x component to subtracty - the y component to subtractz - the z component to subtractw - the w component to subtractpublic Vector4f sub(Vector4fc v, Vector4f dest)
Vector4fcdest.public Vector4f sub(float x, float y, float z, float w, Vector4f dest)
Vector4fc(x, y, z, w) from this and store the result in dest.public Vector4f add(Vector4fc v)
v - the vector to addpublic Vector4f add(Vector4fc v, Vector4f dest)
Vector4fcdest.public Vector4f add(float x, float y, float z, float w)
x - the x component to addy - the y component to addz - the z component to addw - the w component to addpublic Vector4f add(float x, float y, float z, float w, Vector4f dest)
Vector4fcdest.public Vector4f fma(Vector4fc a, Vector4fc b)
a * b to this vector.a - the first multiplicandb - the second multiplicandpublic Vector4f fma(float a, Vector4fc b)
a * b to this vector.a - the first multiplicandb - the second multiplicandpublic Vector4f fma(Vector4fc a, Vector4fc b, Vector4f dest)
Vector4fca * b to this vector
and store the result in dest.public Vector4f fma(float a, Vector4fc b, Vector4f dest)
Vector4fca * b to this vector
and store the result in dest.public Vector4f mul(Vector4fc v)
v - the other vectorpublic Vector4f mul(Vector4fc v, Vector4f dest)
Vector4fcdest.public Vector4f div(Vector4fc v)
v - the vector to divide bypublic Vector4f div(Vector4fc v, Vector4f dest)
Vector4fcdest.public Vector4f mul(Matrix4fc mat)
this.mat - the matrix to multiply the vector withpublic Vector4f mul(Matrix4fc mat, Vector4f dest)
Vector4fcdest.public Vector4f mulAffine(Matrix4fc mat, Vector4f dest)
Vector4fcdest.public Vector4f mul(Matrix4x3fc mat)
this.mat - the matrix to multiply the vector withpublic Vector4f mul(Matrix4x3fc mat, Vector4f dest)
Vector4fcdest.public Vector4f mulProject(Matrix4fc mat, Vector4f dest)
Vector4fcmat with this Vector4f, perform perspective division
and store the result in dest.mulProject in interface Vector4fcmat - the matrix to multiply this vector bydest - will hold the resultpublic Vector4f mulProject(Matrix4fc mat)
mat with this Vector4f, perform perspective division.mat - the matrix to multiply this vector bypublic Vector4f mul(float scalar)
Vector4f by the given scalar
value.scalar - the scalar to multiply bypublic Vector4f mul(float scalar, Vector4f dest)
Vector4fcVector4f by the given scalar
value and store the result in dest.public Vector4f mul(float x, float y, float z, float w)
this.x - the x component to multiply byy - the y component to multiply byz - the z component to multiply byw - the w component to multiply bypublic Vector4f mul(float x, float y, float z, float w, Vector4f dest)
Vector4fcdest.public Vector4f div(float scalar)
Vector4f by the given scalar
value.scalar - the scalar to divide bypublic Vector4f div(float scalar, Vector4f dest)
Vector4fcVector4f by the given scalar
value and store the result in dest.public Vector4f div(float x, float y, float z, float w)
this.x - the x component to divide byy - the y component to divide byz - the z component to divide byw - the w component to divide bypublic Vector4f div(float x, float y, float z, float w, Vector4f dest)
Vector4fcdest.public Vector4f rotate(Quaternionfc quat)
quat and store the result in this.quat - the quaternion to rotate this vectorQuaternionf.transform(Vector4f)public Vector4f rotate(Quaternionfc quat, Vector4f dest)
Vector4fcquat and store the result in dest.rotate in interface Vector4fcquat - the quaternion to rotate this vectordest - will hold the resultQuaternionf.transform(Vector4f)public Vector4f rotateAbout(float angle, float x, float y, float z)
angle - the angle in radiansx - the x component of the rotation axisy - the y component of the rotation axisz - the z component of the rotation axispublic Vector4f rotateAxis(float angle, float aX, float aY, float aZ, Vector4f dest)
Vector4fcdest.rotateAxis in interface Vector4fcangle - the angle in radiansaX - the x component of the rotation axisaY - the y component of the rotation axisaZ - the z component of the rotation axisdest - will hold the resultpublic Vector4f rotateX(float angle)
angle - the angle in radianspublic Vector4f rotateX(float angle, Vector4f dest)
Vector4fcdest.public Vector4f rotateY(float angle)
angle - the angle in radianspublic Vector4f rotateY(float angle, Vector4f dest)
Vector4fcdest.public Vector4f rotateZ(float angle)
angle - the angle in radianspublic Vector4f rotateZ(float angle, Vector4f dest)
Vector4fcdest.public float lengthSquared()
Vector4fclengthSquared in interface Vector4fcpublic static float lengthSquared(float x,
float y,
float z,
float w)
x - The vector's x componenty - The vector's y componentz - The vector's z componentw - The vector's w componentpublic static float lengthSquared(int x,
int y,
int z,
int w)
public float length()
Vector4fcpublic static float length(float x,
float y,
float z,
float w)
x - The vector's x componenty - The vector's y componentz - The vector's z componentw - The vector's w componentpublic Vector4f normalize()
public Vector4f normalize(Vector4f dest)
Vector4fcdest.public Vector4f normalize(float length)
length - the desired lengthpublic Vector4f normalize(float length, Vector4f dest)
Vector4fcdest.public Vector4f normalize3()
(x, y, z).public float distance(Vector4fc v)
Vector4fcv.public float distance(float x,
float y,
float z,
float w)
Vector4fcthis vector and (x, y, z, w).public float distanceSquared(Vector4fc v)
Vector4fcv.distanceSquared in interface Vector4fcv - the other vectorpublic float distanceSquared(float x,
float y,
float z,
float w)
Vector4fcthis vector and
(x, y, z, w).distanceSquared in interface Vector4fcx - the x component of the other vectory - the y component of the other vectorz - the z component of the other vectorw - the w component of the other vectorpublic static float distance(float x1,
float y1,
float z1,
float w1,
float x2,
float y2,
float z2,
float w2)
(x1, y1, z1, w1) and (x2, y2, z2, w2).x1 - the x component of the first vectory1 - the y component of the first vectorz1 - the z component of the first vectorw1 - the w component of the first vectorx2 - the x component of the second vectory2 - the y component of the second vectorz2 - the z component of the second vectorw2 - the 2 component of the second vectorpublic static float distanceSquared(float x1,
float y1,
float z1,
float w1,
float x2,
float y2,
float z2,
float w2)
(x1, y1, z1, w1) and (x2, y2, z2, w2).x1 - the x component of the first vectory1 - the y component of the first vectorz1 - the z component of the first vectorw1 - the w component of the first vectorx2 - the x component of the second vectory2 - the y component of the second vectorz2 - the z component of the second vectorw2 - the w component of the second vectorpublic float dot(Vector4fc v)
Vector4fcv
.public float dot(float x,
float y,
float z,
float w)
Vector4fc(x, y, z, w).public float angleCos(Vector4fc v)
Vector4fcMath.cos(angle(v)).angleCos in interface Vector4fcv - the other vectorVector4fc.angle(Vector4fc)public float angle(Vector4fc v)
Vector4fcangle in interface Vector4fcv - the other vectorVector4fc.angleCos(Vector4fc)public Vector4f zero()
public Vector4f negate()
public Vector4f negate(Vector4f dest)
Vector4fcdest.public String toString()
This method creates a new DecimalFormat on every invocation with the format string "0.000E0;-".
public String toString(NumberFormat formatter)
NumberFormat.formatter - the NumberFormat used to format the vector components withpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionpublic Vector4f min(Vector4fc v)
v - the other vectorpublic Vector4f min(Vector4fc v, Vector4f dest)
Vector4fcdest to be the component-wise minimum of this and the other vector.public Vector4f max(Vector4fc v)
v - the other vectorpublic Vector4f max(Vector4fc v, Vector4f dest)
Vector4fcdest to be the component-wise maximum of this and the other vector.public boolean equals(Vector4fc v, float delta)
Vector4fcthis 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.
public boolean equals(float x,
float y,
float z,
float w)
Vector4fcthis vector with the given (x, y, z, w)
and return whether all of them are equal.public Vector4f smoothStep(Vector4fc v, float t, Vector4f dest)
Vector4fcthis vector and the given vector v and
store the result in dest.smoothStep in interface Vector4fcv - the other vectort - the interpolation factor, within [0..1]dest - will hold the resultpublic Vector4f hermite(Vector4fc t0, Vector4fc v1, Vector4fc t1, float t, Vector4f dest)
Vector4fcthis vector and its
associated tangent t0 and the given vector v
with its tangent t1 and store the result in
dest.public Vector4f lerp(Vector4fc other, float t)
this and other using the given interpolation factor t
and store the result in this.
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.0public Vector4f lerp(Vector4fc other, float t, Vector4f dest)
Vector4fcthis 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.
public float get(int component)
throws IllegalArgumentException
Vector4fcget in interface Vector4fccomponent - the component, within [0..3]IllegalArgumentException - if component is not within [0..3]public int maxComponent()
Vector4fcmaxComponent in interface Vector4fc[0..3]public int minComponent()
Vector4fcminComponent in interface Vector4fc[0..3]public Vector4f floor()
float value that is less than or equal to that
component and is equal to a mathematical integer.public Vector4f floor(Vector4f dest)
Vector4fcfloat value that is less than or equal to that
component and is equal to a mathematical integer and store the result in
dest.public Vector4f ceil()
float value that is greater than or equal to that
component and is equal to a mathematical integer.public Vector4f ceil(Vector4f dest)
Vector4fcfloat value that is greater than or equal to that
component and is equal to a mathematical integer and store the result in
dest.public Vector4f round()
public Vector4f round(Vector4f dest)
Vector4fcdest.public boolean isFinite()
Vector4fcCopyright © 2015–2019 JOML. All rights reserved.