Class Vector3f
java.lang.Object
com.github.retrooper.packetevents.util.Vector3f
3D float Vector.
This vector can represent coordinates, angles, or anything you want.
You can use this to represent an array if you really want.
- Since:
- 1.8
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionadd
(float x, float y, float z) crossProduct
(Vector3f other) float
boolean
Is the object we are comparing to equal to us? It must be of type Vector3d or Vector3i and all values must be equal to the values in this class.float
getX()
float
getY()
float
getZ()
int
hashCode()
multiply
(float value) multiply
(float x, float y, float z) subtract
(float x, float y, float z) toString()
withX
(float x) withY
(float y) withZ
(float z) static Vector3f
zero()
-
Field Details
-
x
public final float xX (coordinate/angle/whatever you wish) -
y
public final float yY (coordinate/angle/whatever you wish) -
z
public final float zZ (coordinate/angle/whatever you wish)
-
-
Constructor Details
-
Vector3f
public Vector3f()Default constructor setting all coordinates/angles/values to their default values (=0). -
Vector3f
public Vector3f(float x, float y, float z) Constructor allowing you to set the values.- Parameters:
x
- Xy
- Yz
- Z
-
Vector3f
public Vector3f(float[] array) Constructor allowing you to specify an array. X will be set to the first index of an array(if it exists, otherwise 0). Y will be set to the second index of an array(if it exists, otherwise 0). Z will be set to the third index of an array(if it exists, otherwise 0).- Parameters:
array
- Array.
-
-
Method Details
-
getX
public float getX() -
getY
public float getY() -
getZ
public float getZ() -
equals
Is the object we are comparing to equal to us? It must be of type Vector3d or Vector3i and all values must be equal to the values in this class. -
hashCode
public int hashCode() -
add
-
add
-
offset
-
subtract
-
subtract
-
multiply
-
multiply
-
multiply
-
crossProduct
-
dot
-
with
-
withX
-
withY
-
withZ
-
toString
-
zero
-