| Modifier and Type | Field and Description |
|---|---|
| public static final Vector4 | |
| private static final long | |
| public float | w
the w-component of this vector |
| public static final Vector4 | |
| public float | x
the x-component of this vector |
| public static final Vector4 | |
| public float | y
the y-component of this vector |
| public static final Vector4 | |
| public float | z
the z-component of this vector |
| public static final Vector4 | |
| public static final Vector4 |
| Access | Constructor and Description |
|---|---|
| public | |
| public | Vector4(float
The x-component x, float The y-component y, float The z-component z, float The w-component * w)Creates a vector with the given components |
| public | |
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Vector4 | add(final Vector4 vector)
Implements com. Adds the given vector to this vector |
| public Vector4 | Returns: This vector for chaining.Added to the x-component x, float Added to the y-component y, float Added to the z-component z, float Added to the w-component w)Adds the given components to this vector |
| public Vector4 | Returns: This vector for chainingThe value values)Implements com. Adds the given value to all four components of the vector. |
| public Vector4 | clamp(float min, float max)
Implements com. Clamps this vector's length to given min and max values |
| public Vector4 | |
| public static float | dot(float x1, float y1, float z1, float w1, float x2, float y2, float z2, float w2)
Returns: The dot product between the two vectors |
| public float | |
| public float | Returns: The dot productThe x-component of the other vector x, float The y-component of the other vector y, float The z-component of the other vector z, float The w-component of the other vector w)Returns the dot product between this and the given vector (given as 4 components). |
| public static float | dst(final float x1, final float y1, final float z1, final float w1, final float x2, final float y2, final float z2, final float w2)
Returns: The Euclidean distance between the two specified vectors |
| public float | |
| public float | |
| public static float | dst2(final float x1, final float y1, final float z1, final float w1, final float x2, final float y2, final float z2, final float w2)
Returns: the squared distance between the given points |
| public float | dst2(Vector4 point)
Implements com. This method is faster than |
| public float | Returns: The squared distanceThe x-component of the other point x, float The y-component of the other point y, float The z-component of the other point z, float The w-component of the other point w)Returns the squared distance between this point and the given point |
| public boolean | epsilonEquals(final Vector4 other, float epsilon)
Implements com. Compares this vector with the other vector, using the supplied epsilon for fuzzy equality testing. |
| public boolean | Returns: whether the vectors are the same.x component of the other vector to compare x, float y component of the other vector to compare y, float z component of the other vector to compare z, float w component of the other vector to compare w, float how much error to tolerate and still consider two floats equal epsilon)Compares this vector with the other vector, using the supplied epsilon for fuzzy equality testing. |
| public boolean | Returns: true if the vectors are equal, otherwise falseother vector to compare other)Compares this vector with the other vector using |
| public boolean | Returns: true if the vectors are equal, otherwise falsex component of the other vector to compare x, float y component of the other vector to compare y, float z component of the other vector to compare z, float w component of the other vector to compare w)Compares this vector with the other vector using |
| public boolean | equals(Object obj)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public Vector4 | Returns: this vector, set with the value from v, for chainingthe string. v)Sets this |
| public int | |
| public boolean | |
| public boolean | |
| public boolean | |
| public Vector4 | interpolate(Vector4 target, float alpha, Interpolation interpolator)
Implements com. Interpolates between this vector and the given target vector by alpha (within range [0,1]) using the given Interpolation method. |
| public boolean | isCollinear(Vector4 other, float epsilon)
Implements com. Returns: true if this vector is collinear with the other vector ( |
| public boolean | isCollinear(Vector4 other)
Implements com. Returns: true if this vector is collinear with the other vector ( |
| public boolean | isCollinearOpposite(Vector4 other, float epsilon)
Implements com. Returns: true if this vector is collinear with the other vector ( |
| public boolean | isCollinearOpposite(Vector4 other)
Implements com. Returns: true if this vector is collinear with the other vector ( |
| public boolean | isOnLine(Vector4 other, float epsilon)
Implements com. Returns: true if this vector is in line with the other vector (either in the same or the opposite direction) |
| public boolean | isOnLine(Vector4 other)
Implements com. Returns: true if this vector is in line with the other vector (either in the same or the opposite direction) |
| public boolean | |
| public boolean | isPerpendicular(Vector4 vector, float epsilon)
Implements com.
|
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public static float | |
| public float | |
| public static float | |
| public float | len2()
Implements com. This method is faster than |
| public Vector4 | lerp(final Vector4 target, float alpha)
Implements com. Linearly interpolates between this vector and the target vector by alpha which is in the range [0,1]. |
| public Vector4 | limit(float limit)
Implements com. Limits the length of this vector, based on the desired maximum length. |
| public Vector4 | limit2(float limit2)
Implements com. Limits the length of this vector, based on the desired maximum length squared. |
| public Vector4 | mulAdd(Vector4 vec, float scalar)
Implements com. First scale a supplied vector, then add it to this vector. |
| public Vector4 | mulAdd(Vector4 vec, Vector4 mulVec)
Implements com. First scale a supplied vector, then add it to this vector. |
| public Vector4 | |
| public Vector4 | Returns: This vector for chainingEach component will be multiplied by this float scalar)Implements com. Multiplies each component of this vector by the given scalar |
| public Vector4 | Returns: This vector for chainingAnother Vector4 that will be used to scale this other)Implements com. Multiplies each component of this vector by the corresponding component in other |
| public Vector4 | Returns: This vector for chainingMultiplied with the X value vx, float Multiplied with the Y value vy, float Multiplied with the Z value vz, float Multiplied with the W value vw)Scales this vector by the given values |
| public Vector4 | Returns: this vector for chainingThe x-component x, float The y-component y, float The z-component z, float The w-component w)Sets the vector to the given components |
| public Vector4 | set(final Vector4 vector)
Implements com. Sets this vector from the given vector |
| public Vector4 | Returns: this vector for chainingThe array values)Implements com. Sets the components from the array. |
| public Vector4 | |
| public Vector4 | |
| public Vector4 | setLength(float len)
Implements com. Sets the length of this vector. |
| public Vector4 | setLength2(float len2)
Implements com. Sets the length of this vector, based on the square of the desired length. |
| public Vector4 | setToRandomDirection()
Implements com. Sets this vector to the unit vector with a random direction |
| public Vector4 | |
| public Vector4 | sub(final Vector4 a_vec)
Implements com. Subtracts the given vector from this vector. |
| public Vector4 | Returns: This vector for chainingSubtracted from the x-component x, float Subtracted from the y-component y, float Subtracted from the z-component z, float Subtracted from the w-component w)Subtracts the given components from this vector. |
| public Vector4 | Returns: This vector for chainingThe value value)Implements com. Subtracts the given value from all components of this vector |
| public String | Returns: a string representation of this object.Overrides java. Converts this |
| One | back to summary |
|---|---|
| public static final Vector4 One | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| w | back to summary |
|---|---|
| public float w the w-component of this vector | |
| W | back to summary |
|---|---|
| public static final Vector4 W | |
| x | back to summary |
|---|---|
| public float x the x-component of this vector | |
| X | back to summary |
|---|---|
| public static final Vector4 X | |
| y | back to summary |
|---|---|
| public float y the y-component of this vector | |
| Y | back to summary |
|---|---|
| public static final Vector4 Y | |
| z | back to summary |
|---|---|
| public float z the z-component of this vector | |
| Z | back to summary |
|---|---|
| public static final Vector4 Z | |
| Zero | back to summary |
|---|---|
| public static final Vector4 Zero | |
| Vector4 | back to summary |
|---|---|
| public Vector4() Constructs a vector at (0,0,0,0) | |
| Vector4 | back to summary |
|---|---|
| public Vector4(float x, float y, float z, float w) Creates a vector with the given components
| |
| Vector4 | back to summary |
|---|---|
| public Vector4(final Vector4 vector) Creates a vector from the given Vector4
| |
| Vector4 | back to summary |
|---|---|
| public Vector4(final float[] values) Creates a vector from the given array. The array must have at least 4 elements.
| |
| Vector4 | back to summary |
|---|---|
| public Vector4(final Vector2 vector, float z, float w) Creates a vector from the given Vector2 and z- and w-components
| |
| Vector4 | back to summary |
|---|---|
| public Vector4(final Vector3 vector, float w) Creates a vector from the given Vector3 and w-component
| |
| add | back to summary |
|---|---|
| public Vector4 add(final Vector4 vector) Implements com. Doc from com. Adds the given vector to this vector
| |
| add | back to summary |
|---|---|
| public Vector4 add(float x, float y, float z, float w) Adds the given components to this vector
| |
| add | back to summary |
|---|---|
| public Vector4 add(float values) Implements com. Adds the given value to all four components of the vector.
| |
| clamp | back to summary |
|---|---|
| public Vector4 clamp(float min, float max) Implements com. Doc from com. Clamps this vector's length to given min and max values
| |
| cpy | back to summary |
|---|---|
| public Vector4 cpy() Implements com.
| |
| dot | back to summary |
|---|---|
public static float dot(float x1, float y1, float z1, float w1, float x2, float y2, float z2, float w2)
| |
| dot | back to summary |
|---|---|
| public float dot(final Vector4 vector) Implements com.
| |
| dot | back to summary |
|---|---|
| public float dot(float x, float y, float z, float w) Returns the dot product between this and the given vector (given as 4 components).
| |
| dst | back to summary |
|---|---|
public static float dst(final float x1, final float y1, final float z1, final float w1, final float x2, final float y2, final float z2, final float w2)
| |
| dst | back to summary |
|---|---|
| public float dst(final Vector4 vector) Implements com.
| |
| dst | back to summary |
|---|---|
public float dst(float x, float y, float z, float w)
| |
| dst2 | back to summary |
|---|---|
public static float dst2(final float x1, final float y1, final float z1, final float w1, final float x2, final float y2, final float z2, final float w2)
| |
| dst2 | back to summary |
|---|---|
| public float dst2(Vector4 point) Implements com. Doc from com. This method is faster than
| |
| dst2 | back to summary |
|---|---|
| public float dst2(float x, float y, float z, float w) Returns the squared distance between this point and the given point
| |
| epsilonEquals | back to summary |
|---|---|
| public boolean epsilonEquals(final Vector4 other, float epsilon) Implements com. Doc from com. Compares this vector with the other vector, using the supplied epsilon for fuzzy equality testing.
| |
| epsilonEquals | back to summary |
|---|---|
| public boolean epsilonEquals(float x, float y, float z, float w, float epsilon) Compares this vector with the other vector, using the supplied epsilon for fuzzy equality testing.
| |
| epsilonEquals | back to summary |
|---|---|
| public boolean epsilonEquals(final Vector4 other) Compares this vector with the other vector using
| |
| epsilonEquals | back to summary |
|---|---|
| public boolean epsilonEquals(float x, float y, float z, float w) Compares this vector with the other vector using
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| fromString | back to summary |
|---|---|
| public Vector4 fromString(String v) Sets this | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| hasOppositeDirection | back to summary |
|---|---|
| public boolean hasOppositeDirection(Vector4 vector) Implements com.
| |
| hasSameDirection | back to summary |
|---|---|
| public boolean hasSameDirection(Vector4 vector) Implements com.
| |
| idt | back to summary |
|---|---|
| public boolean idt(final Vector4 vector) Returns true if this vector and the vector parameter have identical components.
| |
| interpolate | back to summary |
|---|---|
| public Vector4 interpolate(Vector4 target, float alpha, Interpolation interpolator) Implements com. Doc from com. Interpolates between this vector and the given target vector by alpha (within range [0,1]) using the given Interpolation method. the result is stored in this vector.
| |
| isCollinear | back to summary |
|---|---|
| public boolean isCollinear(Vector4 other, float epsilon) Implements com.
| |
| isCollinear | back to summary |
|---|---|
| public boolean isCollinear(Vector4 other) Implements com.
| |
| isCollinearOpposite | back to summary |
|---|---|
| public boolean isCollinearOpposite(Vector4 other, float epsilon) Implements com.
| |
| isCollinearOpposite | back to summary |
|---|---|
| public boolean isCollinearOpposite(Vector4 other) Implements com.
| |
| isOnLine | back to summary |
|---|---|
| public boolean isOnLine(Vector4 other, float epsilon) Implements com.
| |
| isOnLine | back to summary |
|---|---|
| public boolean isOnLine(Vector4 other) Implements com.
| |
| isPerpendicular | back to summary |
|---|---|
| public boolean isPerpendicular(Vector4 vector) Implements com.
| |
| isPerpendicular | back to summary |
|---|---|
| public boolean isPerpendicular(Vector4 vector, float epsilon) Implements com.
| |
| isUnit | back to summary |
|---|---|
| public boolean isUnit() Implements com.
| |
| isUnit | back to summary |
|---|---|
| public boolean isUnit(final float margin) Implements com.
| |
| isZero | back to summary |
|---|---|
| public boolean isZero() Implements com.
| |
| isZero | back to summary |
|---|---|
| public boolean isZero(final float margin) Implements com.
| |
| len | back to summary |
|---|---|
public static float len(final float x, final float y, final float z, float w)
| |
| len | back to summary |
|---|---|
| public float len() Implements com.
| |
| len2 | back to summary |
|---|---|
public static float len2(final float x, final float y, final float z, float w)
| |
| len2 | back to summary |
|---|---|
| public float len2() Implements com. Doc from com. This method is faster than
| |
| lerp | back to summary |
|---|---|
| public Vector4 lerp(final Vector4 target, float alpha) Implements com. Doc from com. Linearly interpolates between this vector and the target vector by alpha which is in the range [0,1]. The result is stored in this vector.
| |
| limit | back to summary |
|---|---|
| public Vector4 limit(float limit) Implements com. Doc from com. Limits the length of this vector, based on the desired maximum length.
| |
| limit2 | back to summary |
|---|---|
| public Vector4 limit2(float limit2) Implements com. Doc from com. Limits the length of this vector, based on the desired maximum length squared. This method is slightly faster than limit().
| |
| mulAdd | back to summary |
|---|---|
| public Vector4 mulAdd(Vector4 vec, float scalar) Implements com. Doc from com. First scale a supplied vector, then add it to this vector.
| |
| mulAdd | back to summary |
|---|---|
| public Vector4 mulAdd(Vector4 vec, Vector4 mulVec) Implements com. Doc from com. First scale a supplied vector, then add it to this vector.
| |
| nor | back to summary |
|---|---|
| public Vector4 nor() Implements com. Doc from com. Normalizes this vector. Does nothing if it is zero.
| |
| scl | back to summary |
|---|---|
| public Vector4 scl(float scalar) Implements com. Multiplies each component of this vector by the given scalar | |
| scl | back to summary |
|---|---|
| public Vector4 scl(final Vector4 other) Implements com. Multiplies each component of this vector by the corresponding component in other | |
| scl | back to summary |
|---|---|
| public Vector4 scl(float vx, float vy, float vz, float vw) Scales this vector by the given values
| |
| set | back to summary |
|---|---|
| public Vector4 set(float x, float y, float z, float w) Sets the vector to the given components
| |
| set | back to summary |
|---|---|
| public Vector4 set(final Vector4 vector) Implements com. Doc from com. Sets this vector from the given vector
| |
| set | back to summary |
|---|---|
| public Vector4 set(final float[] values) Implements com. Sets the components from the array. The array must have at least 4 elements
| |
| set | back to summary |
|---|---|
| public Vector4 set(final Vector2 vector, float z, float w) Sets the components to the given Vector2, z-component and w-component | |
| set | back to summary |
|---|---|
| public Vector4 set(final Vector3 vector, float w) Sets the components of the given vector3 and w-component | |
| setLength | back to summary |
|---|---|
| public Vector4 setLength(float len) Implements com. Doc from com. Sets the length of this vector. Does nothing if this vector is zero.
| |
| setLength2 | back to summary |
|---|---|
| public Vector4 setLength2(float len2) Implements com. Doc from com. Sets the length of this vector, based on the square of the desired length. Does nothing if this vector is zero. This method is slightly faster than setLength().
| |
| setToRandomDirection | back to summary |
|---|---|
| public Vector4 setToRandomDirection() Implements com. Doc from com. Sets this vector to the unit vector with a random direction
| |
| setZero | back to summary |
|---|---|
| public Vector4 setZero() Implements com. Doc from com. Sets the components of this vector to 0
| |
| sub | back to summary |
|---|---|
| public Vector4 sub(final Vector4 a_vec) Implements com. Doc from com. Subtracts the given vector from this vector.
| |
| sub | back to summary |
|---|---|
| public Vector4 sub(float x, float y, float z, float w) Subtracts the given components from this vector.
| |
| sub | back to summary |
|---|---|
| public Vector4 sub(float value) Implements com. Subtracts the given value from all components of this vector
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Converts this | |