Package org.spongepowered.api.util
Enum Class Axis
- All Implemented Interfaces:
- Serializable,- Comparable<Axis>,- Constable,- Cycleable<Axis>
Represents a three dimensional cartesian axis.
- 
Nested Class SummaryNested classes/interfaces inherited from class java.lang.EnumEnum.EnumDesc<E extends Enum<E>>
- 
Enum Constant SummaryEnum Constants
- 
Method SummaryModifier and TypeMethodDescriptionstatic AxisGets the closest horizontal direction from the given vector.doubleGets the component of the vector denoted by this axis.Gets the "next"Cycleableinstance to be considered for cycling.Gets the direction of the vector's component denoted by this axis.booleanisVectorAlongAxis(Vector3d vector) Returns whether the given vector is along this axis.Gets the Vector3d backing this axis.toVector3dWithDirection(AxisDirection axisDirection) Gets the Vector3d with the givenAxisDirection.static AxisReturns the enum constant of this class with the specified name.static Axis[]values()Returns an array containing the constants of this enum class, in the order they are declared.
- 
Enum Constant Details- 
X
- 
Y
- 
Z
 
- 
- 
Method Details- 
valuesReturns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
 
- 
valueOfReturns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
- name- the name of the enum constant to be returned.
- Returns:
- the enum constant with the specified name
- Throws:
- IllegalArgumentException- if this enum class has no constant with the specified name
- NullPointerException- if the argument is null
 
- 
closestGets the closest horizontal direction from the given vector. If the vector is the 0-Vector, this method returnsX. 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 directionXwill be returned.- Parameters:
- vector- The vector to convert to a axis
- Returns:
- The closest axis.
 
- 
isVectorAlongAxisReturns whether the given vector is along this axis.- Parameters:
- vector- The vector to test
- Returns:
- True if it is along this axis
 
- 
componentGets the component of the vector denoted by this axis.- Parameters:
- vector3d- The vector
- Returns:
- The value of the component
 
- 
directionGets the direction of the vector's component denoted by this axis.- Parameters:
- vector3d- The vector
- Returns:
- The direction of the component
 
- 
toVector3dGets the Vector3d backing this axis.- Returns:
- the Vector3d
 
- 
toVector3dWithDirectionGets the Vector3d with the givenAxisDirection.- Parameters:
- axisDirection- The direction along the axis.
- Returns:
- the Vector3d
 
- 
cycleNextDescription copied from interface:CycleableGets the "next"Cycleableinstance to be considered for cycling.
 
-