Documentation

Facing
in package

Table of Contents

ALL  = [self::DOWN, self::UP, self::NORTH, self::SOUTH, self::WEST, self::EAST]
DOWN  = \pocketmine\math\Axis::Y << 1
EAST  = \pocketmine\math\Axis::X << 1 | self::FLAG_AXIS_POSITIVE
FLAG_AXIS_POSITIVE  = 1
HORIZONTAL  = [self::NORTH, self::SOUTH, self::WEST, self::EAST]
NORTH  = \pocketmine\math\Axis::Z << 1
SOUTH  = \pocketmine\math\Axis::Z << 1 | self::FLAG_AXIS_POSITIVE
UP  = \pocketmine\math\Axis::Y << 1 | self::FLAG_AXIS_POSITIVE
WEST  = \pocketmine\math\Axis::X << 1
CLOCKWISE  = [\pocketmine\math\Axis::Y => [self::NORTH => self::EAST, self::EAST => self::SOUTH, self::SOUTH => self::WEST, self::WEST => self::NORTH], \pocketmine\math\Axis::Z => [self::UP => self::EAST, self::EAST => self::DOWN, self::DOWN => self::WEST, self::WEST => self::UP], \pocketmine\math\Axis::X => [self::UP => self::NORTH, self::NORTH => self::DOWN, self::DOWN => self::SOUTH, self::SOUTH => self::UP]]
axis()  : int
Returns the axis of the given direction.
isPositive()  : bool
Returns whether the direction is facing the positive of its axis.
opposite()  : int
Returns the opposite Facing of the specified one.
rotate()  : int
Rotates the given direction around the axis.
rotateX()  : int
rotateY()  : int
rotateZ()  : int
toString()  : string
Returns a human-readable string representation of the given Facing direction.
validate()  : void
Validates the given integer as a Facing direction.
__construct()  : mixed

Constants

ALL

public mixed ALL = [self::DOWN, self::UP, self::NORTH, self::SOUTH, self::WEST, self::EAST]

DOWN

public mixed DOWN = \pocketmine\math\Axis::Y << 1

EAST

public mixed EAST = \pocketmine\math\Axis::X << 1 | self::FLAG_AXIS_POSITIVE

FLAG_AXIS_POSITIVE

public mixed FLAG_AXIS_POSITIVE = 1

HORIZONTAL

public mixed HORIZONTAL = [self::NORTH, self::SOUTH, self::WEST, self::EAST]

NORTH

public mixed NORTH = \pocketmine\math\Axis::Z << 1

SOUTH

public mixed SOUTH = \pocketmine\math\Axis::Z << 1 | self::FLAG_AXIS_POSITIVE

UP

public mixed UP = \pocketmine\math\Axis::Y << 1 | self::FLAG_AXIS_POSITIVE

WEST

public mixed WEST = \pocketmine\math\Axis::X << 1

CLOCKWISE

private mixed CLOCKWISE = [\pocketmine\math\Axis::Y => [self::NORTH => self::EAST, self::EAST => self::SOUTH, self::SOUTH => self::WEST, self::WEST => self::NORTH], \pocketmine\math\Axis::Z => [self::UP => self::EAST, self::EAST => self::DOWN, self::DOWN => self::WEST, self::WEST => self::UP], \pocketmine\math\Axis::X => [self::UP => self::NORTH, self::NORTH => self::DOWN, self::DOWN => self::SOUTH, self::SOUTH => self::UP]]

Methods

axis()

Returns the axis of the given direction.

public static axis(int $direction) : int
Parameters
$direction : int
Return values
int

isPositive()

Returns whether the direction is facing the positive of its axis.

public static isPositive(int $direction) : bool
Parameters
$direction : int
Return values
bool

opposite()

Returns the opposite Facing of the specified one.

public static opposite(int $direction) : int
Parameters
$direction : int

0-5 one of the Facing::* constants

Return values
int

rotate()

Rotates the given direction around the axis.

public static rotate(int $direction, int $axis, bool $clockwise) : int
Parameters
$direction : int
$axis : int
$clockwise : bool
Tags
throws
InvalidArgumentException

if not possible to rotate $direction around $axis

Return values
int

rotateX()

public static rotateX(int $direction, bool $clockwise) : int
Parameters
$direction : int
$clockwise : bool
Tags
throws
InvalidArgumentException
Return values
int

rotateY()

public static rotateY(int $direction, bool $clockwise) : int
Parameters
$direction : int
$clockwise : bool
Tags
throws
InvalidArgumentException
Return values
int

rotateZ()

public static rotateZ(int $direction, bool $clockwise) : int
Parameters
$direction : int
$clockwise : bool
Tags
throws
InvalidArgumentException
Return values
int

toString()

Returns a human-readable string representation of the given Facing direction.

public static toString(int $facing) : string
Parameters
$facing : int
Return values
string

validate()

Validates the given integer as a Facing direction.

public static validate(int $facing) : void
Parameters
$facing : int
Tags
throws
InvalidArgumentException

if the argument is not a valid Facing constant

Return values
void

__construct()

private __construct() : mixed
Return values
mixed

Search results