public class Vec3d
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
double |
xCoord
X coordinate of Vec3D
|
double |
yCoord
Y coordinate of Vec3D
|
double |
zCoord
Z coordinate of Vec3D
|
static Vec3d |
ZERO |
Constructor and Description |
---|
Vec3d(double x,
double y,
double z) |
Vec3d(Vec3i vector) |
Modifier and Type | Method and Description |
---|---|
Vec3d |
add(Vec3d vec) |
Vec3d |
addVector(double x,
double y,
double z)
Adds the specified x,y,z vector components to this vector and returns the resulting vector.
|
Vec3d |
crossProduct(Vec3d vec)
Returns a new vector with the result of this vector x the specified vector.
|
double |
distanceTo(Vec3d vec)
Euclidean distance between this and the specified vector, returned as double.
|
double |
dotProduct(Vec3d vec) |
boolean |
equals(java.lang.Object p_equals_1_) |
static Vec3d |
fromPitchYaw(float p_189986_0_,
float p_189986_1_)
returns a Vec3d from given pitch and yaw degrees
|
static Vec3d |
fromPitchYawVector(Vec2f p_189984_0_)
returns a Vec3d from given pitch and yaw degrees as Vec2f
|
Vec3d |
getIntermediateWithXValue(Vec3d 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.
|
Vec3d |
getIntermediateWithYValue(Vec3d 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.
|
Vec3d |
getIntermediateWithZValue(Vec3d 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.
|
int |
hashCode() |
double |
lengthSquared() |
double |
lengthVector()
Returns the length of the vector.
|
Vec3d |
normalize()
Normalizes the vector to a length of 1 (except if it is the zero vector)
|
Vec3d |
rotatePitch(float pitch) |
Vec3d |
rotateYaw(float yaw) |
Vec3d |
scale(double p_186678_1_) |
double |
squareDistanceTo(double xIn,
double yIn,
double zIn) |
double |
squareDistanceTo(Vec3d vec)
The square of the Euclidean distance between this and the specified vector.
|
Vec3d |
subtract(double x,
double y,
double z) |
Vec3d |
subtract(Vec3d vec) |
Vec3d |
subtractReverse(Vec3d vec)
Returns a new vector with the result of the specified vector minus this.
|
java.lang.String |
toString() |
public static final Vec3d ZERO
public final double xCoord
public final double yCoord
public final double zCoord
public Vec3d(double x, double y, double z)
public Vec3d(Vec3i vector)
public Vec3d subtractReverse(Vec3d vec)
public Vec3d normalize()
public double dotProduct(Vec3d vec)
public Vec3d crossProduct(Vec3d vec)
public Vec3d subtract(double x, double y, double z)
public Vec3d addVector(double x, double y, double z)
public double distanceTo(Vec3d vec)
public double squareDistanceTo(Vec3d vec)
public double squareDistanceTo(double xIn, double yIn, double zIn)
public Vec3d scale(double p_186678_1_)
public double lengthVector()
public double lengthSquared()
public Vec3d getIntermediateWithXValue(Vec3d vec, double x)
public Vec3d getIntermediateWithYValue(Vec3d vec, double y)
public Vec3d getIntermediateWithZValue(Vec3d vec, double z)
public boolean equals(java.lang.Object p_equals_1_)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public Vec3d rotatePitch(float pitch)
public Vec3d rotateYaw(float yaw)
public static Vec3d fromPitchYawVector(Vec2f p_189984_0_)
public static Vec3d fromPitchYaw(float p_189986_0_, float p_189986_1_)