Package net.minecraft.src
Class Vec3
java.lang.Object
net.minecraft.src.Vec3
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddVector(double par1, double par3, double par5) Adds the specified x,y,z vector components to this vector and returns the resulting vector.static Vec3createVectorHelper(double par0, double par2, double par4) Static method for creating a new Vec3D given the three x,y,z values.static Vec3createVectorHelper(Vec3 copyVector) crossProduct(Vec3 par1Vec3) Returns a new vector with the result of this vector x the specified vector.doubledistanceSquareFlat(Vec3 toVec) Only considers the x and z componentsdoubledistanceTo(Vec3 par1Vec3) Euclidean distance between this and the specified vector, returned as double.doubledotProduct(Vec3 par1Vec3) getIntermediateWithXValue(Vec3 par1Vec3, double par2) 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 par1Vec3, double par2) 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 par1Vec3, double par2) 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.doubleReturns the length of the vector.Normalizes the vector to a length of 1 (except if it is the zero vector)voidrotateAroundX(float par1) Rotates the vector around the x axis by the specified angle.voidrotateAroundY(float par1) Rotates the vector around the y axis by the specified angle.voidrotateAroundZ(float par1) Rotates the vector around the z axis by the specified angle.voidrotateAsBlockPosAroundJToFacing(int iFacing) Yaws the vector around the J axis as if it's a local coordinate internal to a block.voidrotateAsVectorAroundJToFacing(int iFacing) Yaws the vector around the origin of the J axis.voidscale(double dScale) setComponents(double par1, double par3, double par5) Sets the x,y,z components of the vector as specified.doublesquareDistanceTo(double par1, double par3, double par5) The square of the Euclidean distance between this and the vector of x,y,z components passed in.doublesquareDistanceTo(Vec3 par1Vec3) The square of the Euclidean distance between this and the specified vector.Returns a new vector with the result of the specified vector minus this.final Vec3subtractFrom(Vec3 vec) Alternate name for clarityvoidtiltAsBlockPosToFacingAlongJ(int iFacing) "Tilts" the vector towards the desired facing as if it's a local coordinate internal to a block.voidtiltAsVectorToFacingAlongJ(int iFacing) "Tilts" the vector towards the desired facing as if it's a local coordinate internal to a block.toString()
-
Field Details
-
fakePool
A global Vec3Pool that always creates new vectors instead of reusing them and is thread-safe. -
myVec3LocalPool
-
xCoord
public double xCoordX coordinate of Vec3D -
yCoord
public double yCoordY coordinate of Vec3D -
zCoord
public double zCoordZ coordinate of Vec3D
-
-
Constructor Details
-
Vec3
-
-
Method Details
-
createVectorHelper
Static method for creating a new Vec3D given the three x,y,z values. This is only called from the other static method which creates and places it in the list. -
setComponents
Sets the x,y,z components of the vector as specified. -
subtract
Returns a new vector with the result of the specified vector minus this. -
normalize
Normalizes the vector to a length of 1 (except if it is the zero vector) -
dotProduct
-
crossProduct
Returns a new vector with the result of this vector x the specified vector. -
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. -
squareDistanceTo
public double squareDistanceTo(double par1, double par3, double par5) The square of the Euclidean distance between this and the vector of x,y,z components passed in. -
lengthVector
public double lengthVector()Returns the length of the vector. -
getIntermediateWithXValue
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
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
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. -
toString
-
rotateAroundX
public void rotateAroundX(float par1) Rotates the vector around the x axis by the specified angle. -
rotateAroundY
public void rotateAroundY(float par1) Rotates the vector around the y axis by the specified angle. -
rotateAroundZ
public void rotateAroundZ(float par1) Rotates the vector around the z axis by the specified angle. -
createVectorHelper
-
rotateAsBlockPosAroundJToFacing
public void rotateAsBlockPosAroundJToFacing(int iFacing) Yaws the vector around the J axis as if it's a local coordinate internal to a block. Assumes that initial facing is along the negative K axis (facing 2) -
rotateAsVectorAroundJToFacing
public void rotateAsVectorAroundJToFacing(int iFacing) Yaws the vector around the origin of the J axis. Assumes that initial facing is along the negative K axis (facing 2) -
tiltAsBlockPosToFacingAlongJ
public void tiltAsBlockPosToFacingAlongJ(int iFacing) "Tilts" the vector towards the desired facing as if it's a local coordinate internal to a block. Takes the up vector and either yaws or rolls it towards the specified axis. -
tiltAsVectorToFacingAlongJ
public void tiltAsVectorToFacingAlongJ(int iFacing) "Tilts" the vector towards the desired facing as if it's a local coordinate internal to a block. Takes the up vector and either yaws or rolls it towards the specified axis. -
subtractFrom
Alternate name for clarity -
addVector
-
scale
public void scale(double dScale) -
distanceSquareFlat
Only considers the x and z components
-