Class Vec3
java.lang.Object
ua.mcchickenstudio.opencreative.utils.millennium.vectors.Vec3
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddVector(double x, double y, double z) Adds the specified x,y,z vector components to this vector and returns the resulting vector.doubledistanceTo(Vec3 vec) Euclidean distance between this and the specified vector, returned as double.getIntermediateWithXValue(Vec3 vec, double x) Returns a new vector with x value equal to the second parameter, along the line between this vector and the passed in vector, or null if not possible.getIntermediateWithYValue(Vec3 vec, double y) Returns a new vector with y value equal to the second parameter, along the line between this vector and the passed in vector, or null if not possible.getIntermediateWithZValue(Vec3 vec, double z) Returns a new vector with z value equal to the second parameter, along the line between this vector and the passed in vector, or null if not possible.multiply(double m) Normalizes the vector to a length of 1 (except if it is the zero vector)doublespeed()doublesquareDistanceTo(Vec3 vec) The square of the Euclidean distance between this and the specified vector.subtract(double x, double y, double z) toString()
-
Field Details
-
xCoord
public final double xCoordX coordinate of Vec3D -
yCoord
public final double yCoordY coordinate of Vec3D -
zCoord
public final double zCoordZ coordinate of Vec3D
-
-
Constructor Details
-
Vec3
public Vec3(double x, double y, double z) -
Vec3
public Vec3(org.bukkit.util.Vector vector)
-
-
Method Details
-
normalize
Normalizes the vector to a length of 1 (except if it is the zero vector) -
subtract
-
subtract
-
add
-
addVector
Adds the specified x,y,z vector components to this vector and returns the resulting vector. Does not change this vector. -
distanceTo
Euclidean distance between this and the specified vector, returned as double. -
squareDistanceTo
The square of the Euclidean distance between this and the specified vector. -
getIntermediateWithXValue
-
getIntermediateWithYValue
-
getIntermediateWithZValue
-
toString
-
multiply
-
speed
public double speed()
-