public class MutableVec3
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
|
| Constructor and Description |
|---|
MutableVec3(double x,
double y,
double z) |
| Modifier and Type | Method and Description |
|---|---|
MutableVec3 |
add(MutableVec3 vec) |
MutableVec3 |
addVector(double x,
double y,
double z)
Adds the specified x,y,z vector components to this vector and returns the resulting vector.
|
MutableVec3 |
crossProduct(MutableVec3 vec)
Returns a new vector with the result of this vector x the specified vector.
|
double |
distanceTo(MutableVec3 vec)
Euclidean distance between this and the specified vector, returned as double.
|
double |
dotProduct(MutableVec3 vec) |
MutableVec3 |
getIntermediateWithXValue(MutableVec3 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.
|
MutableVec3 |
getIntermediateWithYValue(MutableVec3 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.
|
MutableVec3 |
getIntermediateWithZValue(MutableVec3 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.
|
double |
lengthVector()
Returns the length of the vector.
|
MutableVec3 |
normalize()
Normalizes the vector to a length of 1 (except if it is the zero vector)
|
MutableVec3 |
rotatePitch(float pitch) |
MutableVec3 |
rotateYaw(float yaw) |
MutableVec3 |
set(double x,
double y,
double z) |
MutableVec3 |
set(MutableVec3 v) |
double |
squareDistanceTo(MutableVec3 vec)
The square of the Euclidean distance between this and the specified vector.
|
MutableVec3 |
subtract(double x,
double y,
double z) |
MutableVec3 |
subtract(MutableVec3 vec) |
MutableVec3 |
subtractReverse(MutableVec3 vec)
Returns this vector for chaining with the result of the specified vector minus this.
|
java.lang.String |
toString() |
public double xCoord
public double yCoord
public double zCoord
public MutableVec3 subtractReverse(MutableVec3 vec)
public MutableVec3 normalize()
public MutableVec3 set(MutableVec3 v)
public MutableVec3 set(double x, double y, double z)
public double dotProduct(MutableVec3 vec)
public MutableVec3 crossProduct(MutableVec3 vec)
public MutableVec3 subtract(MutableVec3 vec)
public MutableVec3 subtract(double x, double y, double z)
public MutableVec3 add(MutableVec3 vec)
public MutableVec3 addVector(double x, double y, double z)
public double distanceTo(MutableVec3 vec)
public double squareDistanceTo(MutableVec3 vec)
public double lengthVector()
public MutableVec3 getIntermediateWithXValue(MutableVec3 vec, double x)
public MutableVec3 getIntermediateWithYValue(MutableVec3 vec, double y)
public MutableVec3 getIntermediateWithZValue(MutableVec3 vec, double z)
public java.lang.String toString()
toString in class java.lang.Objectpublic MutableVec3 rotatePitch(float pitch)
public MutableVec3 rotateYaw(float yaw)