public class MutableVector3d
extends java.lang.Object
implements net.minecraft.dispenser.IPosition
Constructor and Description |
---|
MutableVector3d(double xIn,
double yIn,
double zIn) |
MutableVector3d(net.minecraft.util.math.vector.Vector3d vec) |
MutableVector3d(net.minecraft.util.math.vector.Vector3f vec) |
Modifier and Type | Method and Description |
---|---|
MutableVector3d |
add(double x,
double y,
double z)
Adds the specified x,y,z vector components to this vector and returns the resulting vector.
|
MutableVector3d |
add(MutableVector3d vec) |
MutableVector3d |
align(java.util.EnumSet<net.minecraft.util.Direction.Axis> axes) |
static MutableVector3d |
copy(net.minecraft.util.math.vector.Vector3i toCopy)
Copies the coordinates of an int vector exactly.
|
static MutableVector3d |
copyCentered(net.minecraft.util.math.vector.Vector3i toCopy)
Copies the coordinates of an Int vector and centers them.
|
static MutableVector3d |
copyCenteredHorizontally(net.minecraft.util.math.vector.Vector3i toCopy)
Copies the coordinates of an int vector and centers them horizontally (x and z)
|
static MutableVector3d |
copyCenteredWithVerticalOffset(net.minecraft.util.math.vector.Vector3i toCopy,
double verticalOffset)
Copies the coordinates of an int vector and centers them horizontally and applies a vertical offset.
|
MutableVector3d |
crossProduct(MutableVector3d vec)
Returns a new vector with the result of this vector x the specified vector.
|
double |
distanceTo(MutableVector3d vec)
Euclidean distance between this and the specified vector, returned as double.
|
double |
dotProduct(MutableVector3d vec) |
boolean |
equals(java.lang.Object p_equals_1_) |
static MutableVector3d |
fromPitchYaw(float pitch,
float yaw)
returns a Vec3d from given pitch and yaw degrees
|
static MutableVector3d |
fromPitchYaw(net.minecraft.util.math.vector.Vector2f vec)
returns a Vec3d from given pitch and yaw degrees as Vec2f
|
double |
getCoordinate(net.minecraft.util.Direction.Axis axis) |
int |
hashCode() |
MutableVector3d |
inverse() |
boolean |
isWithinDistanceOf(net.minecraft.dispenser.IPosition pos,
double distance)
Checks if a position is within a certain distance of the coordinates.
|
double |
length()
Returns the length of the vector.
|
double |
lengthSquared() |
static MutableVector3d |
max() |
static MutableVector3d |
min() |
MutableVector3d |
mul(double factorX,
double factorY,
double factorZ) |
MutableVector3d |
mul(MutableVector3d vec) |
MutableVector3d |
normalize()
Normalizes the vector to a length of 1 (except if it is the zero vector)
|
MutableVector3d |
rotatePitch(float pitch) |
MutableVector3d |
rotateRoll(float roll) |
MutableVector3d |
rotateYaw(float yaw) |
MutableVector3d |
scale(double factor) |
double |
squareDistanceTo(double xIn,
double yIn,
double zIn) |
double |
squareDistanceTo(MutableVector3d vec)
The square of the Euclidean distance between this and the specified vector.
|
MutableVector3d |
subtract(double x,
double y,
double z) |
MutableVector3d |
subtract(MutableVector3d vec) |
MutableVector3d |
subtractReverse(MutableVector3d vec)
Returns a new vector with the result of the specified vector minus this.
|
net.minecraft.util.math.vector.Vector3d |
toImmutable() |
java.lang.String |
toString() |
static MutableVector3d |
unpack(int packed) |
double |
x() |
double |
y() |
double |
z() |
static MutableVector3d |
zero() |
public MutableVector3d(double xIn, double yIn, double zIn)
public MutableVector3d(net.minecraft.util.math.vector.Vector3f vec)
public MutableVector3d(net.minecraft.util.math.vector.Vector3d vec)
public static MutableVector3d zero()
public static MutableVector3d min()
public static MutableVector3d max()
public static MutableVector3d unpack(int packed)
public static MutableVector3d copyCentered(net.minecraft.util.math.vector.Vector3i toCopy)
public static MutableVector3d copy(net.minecraft.util.math.vector.Vector3i toCopy)
public static MutableVector3d copyCenteredHorizontally(net.minecraft.util.math.vector.Vector3i toCopy)
public static MutableVector3d copyCenteredWithVerticalOffset(net.minecraft.util.math.vector.Vector3i toCopy, double verticalOffset)
public MutableVector3d subtractReverse(MutableVector3d vec)
public MutableVector3d normalize()
public double dotProduct(MutableVector3d vec)
public MutableVector3d crossProduct(MutableVector3d vec)
public MutableVector3d subtract(MutableVector3d vec)
public MutableVector3d subtract(double x, double y, double z)
public MutableVector3d add(MutableVector3d vec)
public MutableVector3d add(double x, double y, double z)
public boolean isWithinDistanceOf(net.minecraft.dispenser.IPosition pos, double distance)
public double distanceTo(MutableVector3d vec)
public double squareDistanceTo(MutableVector3d vec)
public double squareDistanceTo(double xIn, double yIn, double zIn)
public MutableVector3d scale(double factor)
public MutableVector3d inverse()
public MutableVector3d mul(MutableVector3d vec)
public MutableVector3d mul(double factorX, double factorY, double factorZ)
public double length()
public double lengthSquared()
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 MutableVector3d rotatePitch(float pitch)
public MutableVector3d rotateYaw(float yaw)
public MutableVector3d rotateRoll(float roll)
public static MutableVector3d fromPitchYaw(net.minecraft.util.math.vector.Vector2f vec)
public static MutableVector3d fromPitchYaw(float pitch, float yaw)
public MutableVector3d align(java.util.EnumSet<net.minecraft.util.Direction.Axis> axes)
public double getCoordinate(net.minecraft.util.Direction.Axis axis)
public double x()
x
in interface net.minecraft.dispenser.IPosition
public double y()
y
in interface net.minecraft.dispenser.IPosition
public double z()
z
in interface net.minecraft.dispenser.IPosition
public final net.minecraft.util.math.vector.Vector3d toImmutable()