public enum Direction extends java.lang.Enum<Direction> implements IStringSerializable
Modifier and Type | Class and Description |
---|---|
static class |
Direction.Axis |
static class |
Direction.AxisDirection |
static class |
Direction.Plane |
Modifier and Type | Field and Description |
---|---|
private Direction.Axis |
axis |
private Direction.AxisDirection |
axisDirection |
private static Direction[] |
BY_HORIZONTAL_INDEX |
private static Direction[] |
BY_INDEX |
private static it.unimi.dsi.fastutil.longs.Long2ObjectMap<Direction> |
BY_LONG |
private Vec3i |
directionVec |
private int |
horizontalIndex |
private int |
index |
private java.lang.String |
name |
private static java.util.Map<java.lang.String,Direction> |
NAME_LOOKUP |
private int |
opposite |
private static Direction[] |
VALUES |
Modifier and Type | Method and Description |
---|---|
static Direction |
byHorizontalIndex(int horizontalIndexIn) |
static Direction |
byIndex(int index) |
static Direction |
byLong(int x,
int y,
int z) |
static Direction |
byName(java.lang.String name) |
private static Direction[] |
compose(Direction first,
Direction second,
Direction third) |
static Direction |
fromAngle(double angle) |
Direction.Axis |
getAxis() |
Direction.AxisDirection |
getAxisDirection() |
Vec3i |
getDirectionVec() |
static Direction[] |
getFacingDirections(Entity entityIn) |
static Direction |
getFacingFromAxis(Direction.AxisDirection axisDirectionIn,
Direction.Axis axisIn) |
static Direction |
getFacingFromAxisDirection(Direction.Axis axisIn,
Direction.AxisDirection axisDirectionIn) |
static Direction |
getFacingFromVector(double x,
double y,
double z) |
static Direction |
getFacingFromVector(float x,
float y,
float z) |
float |
getHorizontalAngle() |
int |
getHorizontalIndex() |
int |
getIndex() |
java.lang.String |
getName() |
java.lang.String |
getName2() |
Direction |
getOpposite() |
Quaternion |
getRotation() |
int |
getXOffset() |
int |
getYOffset() |
int |
getZOffset() |
static Direction |
random(java.util.Random rand) |
static Direction |
rotateFace(Matrix4f matrixIn,
Direction directionIn) |
Direction |
rotateY() |
Direction |
rotateYCCW() |
java.lang.String |
toString() |
Vector3f |
toVector3f() |
static Direction |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Direction[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Direction DOWN
public static final Direction UP
public static final Direction NORTH
public static final Direction SOUTH
public static final Direction WEST
public static final Direction EAST
private final int index
private final int opposite
private final int horizontalIndex
private final java.lang.String name
private final Direction.Axis axis
private final Direction.AxisDirection axisDirection
private final Vec3i directionVec
private static final Direction[] VALUES
private static final java.util.Map<java.lang.String,Direction> NAME_LOOKUP
private static final Direction[] BY_INDEX
private static final Direction[] BY_HORIZONTAL_INDEX
private static final it.unimi.dsi.fastutil.longs.Long2ObjectMap<Direction> BY_LONG
public static Direction[] values()
for (Direction c : Direction.values()) System.out.println(c);
public static Direction valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic Quaternion getRotation()
public int getIndex()
public int getHorizontalIndex()
public Direction.AxisDirection getAxisDirection()
public Direction getOpposite()
public Direction rotateY()
public Direction rotateYCCW()
public int getXOffset()
public int getYOffset()
public int getZOffset()
public Vector3f toVector3f()
public java.lang.String getName2()
public Direction.Axis getAxis()
@Nullable public static Direction byName(@Nullable java.lang.String name)
public static Direction byIndex(int index)
public static Direction byHorizontalIndex(int horizontalIndexIn)
@Nullable public static Direction byLong(int x, int y, int z)
public static Direction fromAngle(double angle)
public static Direction getFacingFromAxisDirection(Direction.Axis axisIn, Direction.AxisDirection axisDirectionIn)
public float getHorizontalAngle()
public static Direction random(java.util.Random rand)
public static Direction getFacingFromVector(double x, double y, double z)
public static Direction getFacingFromVector(float x, float y, float z)
public java.lang.String toString()
toString
in class java.lang.Enum<Direction>
public java.lang.String getName()
getName
in interface IStringSerializable
public static Direction getFacingFromAxis(Direction.AxisDirection axisDirectionIn, Direction.Axis axisIn)
public Vec3i getDirectionVec()