PocketMine-MP 5.15.1 git-be6754494fdbbb9dd57c058ba0e33a4a78c4581f
pocketmine\math\Facing Class Reference
+ Collaboration diagram for pocketmine\math\Facing:

Static Public Member Functions

static axis (int $direction)
 
static isPositive (int $direction)
 
static opposite (int $direction)
 
static rotate (int $direction, int $axis, bool $clockwise)
 
static rotateX (int $direction, bool $clockwise)
 
static rotateY (int $direction, bool $clockwise)
 
static rotateZ (int $direction, bool $clockwise)
 
static toString (int $facing)
 
static validate (int $facing)
 

Public Attributes

const ALL
 
const DOWN = Axis::Y << 1
 
const EAST = (Axis::X << 1) | self::FLAG_AXIS_POSITIVE
 
const FLAG_AXIS_POSITIVE = 1
 
const HORIZONTAL
 
const NORTH = Axis::Z << 1
 
const OFFSET
 
const SOUTH = (Axis::Z << 1) | self::FLAG_AXIS_POSITIVE
 
const UP = (Axis::Y << 1) | self::FLAG_AXIS_POSITIVE
 
const WEST = Axis::X << 1
 

Detailed Description

Definition at line 28 of file Facing.php.

Member Function Documentation

◆ axis()

static pocketmine\math\Facing::axis ( int  $direction)
static

Returns the axis of the given direction.

Definition at line 92 of file Facing.php.

Referenced by pocketmine\block\Bell\recalculateCollisionBoxes().

+ Here is the caller graph for this function:

◆ isPositive()

static pocketmine\math\Facing::isPositive ( int  $direction)
static

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

Definition at line 99 of file Facing.php.

◆ opposite()

static pocketmine\math\Facing::opposite ( int  $direction)
static

Returns the opposite Facing of the specified one.

Parameters
int$direction0-5 one of the Facing::* constants

Definition at line 108 of file Facing.php.

Referenced by pocketmine\block\EndRod\place(), pocketmine\block\Fence\readStateFromWorld(), and pocketmine\block\Thin\readStateFromWorld().

+ Here is the caller graph for this function:

◆ rotate()

static pocketmine\math\Facing::rotate ( int  $direction,
int  $axis,
bool  $clockwise 
)
static

Rotates the given direction around the axis.

Exceptions

InvalidArgumentException if not possible to rotate $direction around $axis

Definition at line 117 of file Facing.php.

◆ rotateX()

static pocketmine\math\Facing::rotateX ( int  $direction,
bool  $clockwise 
)
static
Exceptions

InvalidArgumentException

Definition at line 146 of file Facing.php.

◆ rotateY()

static pocketmine\math\Facing::rotateY ( int  $direction,
bool  $clockwise 
)
static
Exceptions

InvalidArgumentException

Definition at line 132 of file Facing.php.

◆ rotateZ()

static pocketmine\math\Facing::rotateZ ( int  $direction,
bool  $clockwise 
)
static
Exceptions

InvalidArgumentException

Definition at line 139 of file Facing.php.

◆ toString()

static pocketmine\math\Facing::toString ( int  $facing)
static

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

Definition at line 164 of file Facing.php.

◆ validate()

static pocketmine\math\Facing::validate ( int  $facing)
static

Validates the given integer as a Facing direction.

Exceptions

InvalidArgumentException if the argument is not a valid Facing constant

Definition at line 155 of file Facing.php.

Member Data Documentation

◆ ALL

const pocketmine\math\Facing::ALL
Initial value:
= [
self::DOWN,
self::UP,
self::NORTH,
self::SOUTH,
self::WEST,
self::EAST
]

Definition at line 43 of file Facing.php.

◆ DOWN

const pocketmine\math\Facing::DOWN = Axis::Y << 1

Definition at line 36 of file Facing.php.

◆ EAST

const pocketmine\math\Facing::EAST = (Axis::X << 1) | self::FLAG_AXIS_POSITIVE

Definition at line 41 of file Facing.php.

◆ FLAG_AXIS_POSITIVE

const pocketmine\math\Facing::FLAG_AXIS_POSITIVE = 1

Definition at line 33 of file Facing.php.

◆ HORIZONTAL

const pocketmine\math\Facing::HORIZONTAL
Initial value:
= [
self::NORTH,
self::SOUTH,
self::WEST,
self::EAST
]

Definition at line 52 of file Facing.php.

◆ NORTH

const pocketmine\math\Facing::NORTH = Axis::Z << 1

Definition at line 38 of file Facing.php.

◆ OFFSET

const pocketmine\math\Facing::OFFSET
Initial value:
= [
self::DOWN => [ 0, -1, 0],
self::UP => [ 0, +1, 0],
self::NORTH => [ 0, 0, -1],
self::SOUTH => [ 0, 0, +1],
self::WEST => [-1, 0, 0],
self::EAST => [+1, 0, 0]
]

Definition at line 59 of file Facing.php.

◆ SOUTH

const pocketmine\math\Facing::SOUTH = (Axis::Z << 1) | self::FLAG_AXIS_POSITIVE

Definition at line 39 of file Facing.php.

◆ UP

const pocketmine\math\Facing::UP = (Axis::Y << 1) | self::FLAG_AXIS_POSITIVE

Definition at line 37 of file Facing.php.

◆ WEST

const pocketmine\math\Facing::WEST = Axis::X << 1

Definition at line 40 of file Facing.php.


The documentation for this class was generated from the following file: