public enum Axis extends Enum<Axis> implements Cycleable<Axis>
Modifier and Type | Method and Description |
---|---|
Axis |
cycleNext()
Gets the "next"
Cycleable instance to be considered
for cycling. |
static Axis |
getClosest(com.flowpowered.math.vector.Vector3d vector)
Gets the closest horizontal direction from the given vector.
|
double |
getComponent(com.flowpowered.math.vector.Vector3d vector3d)
Gets the component of the vector denoted by this axis.
|
AxisDirection |
getDirection(com.flowpowered.math.vector.Vector3d vector3d)
Gets the direction of the vector's component denoted by this axis.
|
boolean |
isVectorAlongAxis(com.flowpowered.math.vector.Vector3d vector)
Returns whether the given vector is along this axis.
|
com.flowpowered.math.vector.Vector3d |
toVector3d()
Gets the Vector3d backing this axis.
|
com.flowpowered.math.vector.Vector3d |
toVector3dWithDirection(AxisDirection axisDirection)
Gets the Vector3d with the given
AxisDirection . |
static Axis |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Axis[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Axis X
public static final Axis Y
public static final Axis Z
public static Axis[] values()
for (Axis c : Axis.values()) System.out.println(c);
public static Axis valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static Axis getClosest(com.flowpowered.math.vector.Vector3d vector)
X
. If the vector has
the same length in a horizontal and vertical direction, a horizontal axis
will be returned. If the vector has the same length in x and in z
direction X
will be returned.vector
- The vector to convert to a axispublic boolean isVectorAlongAxis(com.flowpowered.math.vector.Vector3d vector)
vector
- The vector to testpublic double getComponent(com.flowpowered.math.vector.Vector3d vector3d)
vector3d
- The vectorpublic AxisDirection getDirection(com.flowpowered.math.vector.Vector3d vector3d)
vector3d
- The vectorpublic com.flowpowered.math.vector.Vector3d toVector3d()
public com.flowpowered.math.vector.Vector3d toVector3dWithDirection(AxisDirection axisDirection)
AxisDirection
.axisDirection
- The direction along the axis.