public class Vec3 extends Object
Modifier and Type | Field and Description |
---|---|
static Vec3Pool |
fakePool
A global Vec3Pool that always creates new vectors instead of reusing them and is thread-safe.
|
Vec3Pool |
myVec3LocalPool |
double |
xCoord
X coordinate of Vec3D
|
double |
yCoord
Y coordinate of Vec3D
|
double |
zCoord
Z coordinate of Vec3D
|
Modifier and Type | Method and Description |
---|---|
Vec3 |
addVector(double par1,
double par3,
double par5)
Adds the specified x,y,z vector components to this vector and returns the resulting vector.
|
static Vec3 |
createVectorHelper(double par0,
double par2,
double par4)
Static method for creating a new Vec3D given the three x,y,z values.
|
Vec3 |
crossProduct(Vec3 par1Vec3) |
double |
distanceTo(Vec3 par1Vec3)
Euclidean distance between this and the specified vector, returned as double.
|
double |
dotProduct(Vec3 par1Vec3) |
Vec3 |
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.
|
Vec3 |
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.
|
Vec3 |
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.
|
double |
lengthVector()
Returns the length of the vector.
|
Vec3 |
normalize()
Normalizes the vector to a length of 1 (except if it is the zero vector)
|
void |
rotateAroundX(float par1)
Rotates the vector around the x axis by the specified angle.
|
void |
rotateAroundY(float par1)
Rotates the vector around the y axis by the specified angle.
|
void |
rotateAroundZ(float par1) |
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.
|
double |
squareDistanceTo(Vec3 par1Vec3)
The square of the Euclidean distance between this and the specified vector.
|
Vec3 |
subtract(Vec3 par1Vec3) |
String |
toString() |
public static final Vec3Pool fakePool
public final Vec3Pool myVec3LocalPool
public double xCoord
public double yCoord
public double zCoord
public static Vec3 createVectorHelper(double par0, double par2, double par4)
public Vec3 normalize()
public double dotProduct(Vec3 par1Vec3)
public Vec3 addVector(double par1, double par3, double par5)
public double distanceTo(Vec3 par1Vec3)
public double squareDistanceTo(Vec3 par1Vec3)
public double squareDistanceTo(double par1, double par3, double par5)
public double lengthVector()
public Vec3 getIntermediateWithXValue(Vec3 par1Vec3, double par2)
public Vec3 getIntermediateWithYValue(Vec3 par1Vec3, double par2)
public Vec3 getIntermediateWithZValue(Vec3 par1Vec3, double par2)
public void rotateAroundX(float par1)
public void rotateAroundY(float par1)
public void rotateAroundZ(float par1)