|
| | __construct ($x=0, $y=0, $z=0, $yaw=0.0, $pitch=0.0, Level $level=null) |
| |
| | asLocation () |
| |
| | add ($x, $y=0, $z=0, $yaw=0, $pitch=0) |
| |
| | getYaw () |
| |
| | getPitch () |
| |
| | fromObjectAdd (Vector3 $pos, $x, $y, $z) |
| |
| | __toString () |
| |
| | __construct ($x=0, $y=0, $z=0, Level $level=null) |
| |
| | asPosition () |
| |
| | add ($x, $y=0, $z=0) |
| |
| | getLevel () |
| |
| | setLevel (Level $level=null) |
| |
| | isValid () |
| |
| | getSide ($side, $step=1) |
| |
| | __toString () |
| |
| | setComponents ($x, $y, $z) |
| |
| | fromObjectAdd (Vector3 $pos, $x, $y, $z) |
| |
| | __construct ($x=0, $y=0, $z=0) |
| |
| | getX () |
| |
| | getY () |
| |
| | getZ () |
| |
| | getFloorX () |
| |
| | getFloorY () |
| |
| | getFloorZ () |
| |
| | getRight () |
| |
| | getUp () |
| |
| | getForward () |
| |
| | getSouth () |
| |
| | getWest () |
| |
| | add ($x, $y=0, $z=0) |
| |
| | subtract ($x=0, $y=0, $z=0) |
| |
| | multiply ($number) |
| |
| | divide ($number) |
| |
| | ceil () |
| |
| | floor () |
| |
| | round () |
| |
| | abs () |
| |
| | getSide ($side, $step=1) |
| |
| | asVector3 () |
| |
| | distance (Vector3 $pos) |
| |
| | distanceSquared (Vector3 $pos) |
| |
| | maxPlainDistance ($x=0, $z=0) |
| |
| | length () |
| |
| | lengthSquared () |
| |
| | normalize () |
| |
| | dot (Vector3 $v) |
| |
| | cross (Vector3 $v) |
| |
| | equals (Vector3 $v) |
| |
| | getIntermediateWithXValue (Vector3 $v, $x) |
| |
| | getIntermediateWithYValue (Vector3 $v, $y) |
| |
| | getIntermediateWithZValue (Vector3 $v, $z) |
| |
| | setComponents ($x, $y, $z) |
| |
| | fromObjectAdd (Vector3 $pos, $x, $y, $z) |
| |
| | __toString () |
| |
◆ __construct()
| __construct |
( |
|
$x = 0, |
|
|
|
$y = 0, |
|
|
|
$z = 0, |
|
|
|
$yaw = 0.0, |
|
|
|
$pitch = 0.0, |
|
|
Level |
$level = null |
|
) |
| |
- Parameters
-
| int | $x | |
| int | $y | |
| int | $z | |
| float | $yaw | |
| float | $pitch | |
| Level | $level | |
◆ __toString()
- Returns
- string
121 return "Location (level=" . ($this->
isValid() ? $this->
getLevel()->getName() :
"null") .
", x=$this->x, y=$this->y, z=$this->z, yaw=$this->yaw, pitch=$this->pitch)";
◆ add()
| add |
( |
|
$x, |
|
|
|
$y = 0, |
|
|
|
$z = 0, |
|
|
|
$yaw = 0, |
|
|
|
$pitch = 0 |
|
) |
| |
- Parameters
-
| $x | |
| int | $y | |
| int | $z | |
| int | $yaw | |
| int | $pitch | |
- Returns
- Location
79 if(
$x instanceof Location){
80 return new Location($this->x +
$x->x, $this->y +
$x->y, $this->z +
$x->z, $this->yaw +
$x->yaw, $this->pitch +
$x->pitch, $this->level);
82 return new Location($this->x +
$x, $this->y +
$y, $this->z +
$z, $this->yaw +
$yaw, $this->pitch +
$pitch, $this->level);
◆ asLocation()
Return a Location instance
- Returns
- Location
66 return new Location($this->x, $this->y, $this->z, $this->yaw, $this->pitch, $this->level);
◆ fromObject()
| static fromObject |
( |
Vector3 |
$pos, |
|
|
Level |
$level = null, |
|
|
|
$yaw = 0.0, |
|
|
|
$pitch = 0.0 |
|
) |
| |
|
static |
- Parameters
-
| Vector3 | $pos | |
| Level | null | $level | default null |
| float | $yaw | default 0.0 |
| float | $pitch | default 0.0 |
- Returns
- Location
57 return new Location($pos->x, $pos->y, $pos->z,
$yaw,
$pitch, (
$level === null) ? (($pos instanceof Position) ? $pos->level : null) :
$level);
◆ fromObjectAdd()
| fromObjectAdd |
( |
Vector3 |
$pos, |
|
|
|
$x, |
|
|
|
$y, |
|
|
|
$z |
|
) |
| |
- Parameters
-
- Returns
- $this
109 if($pos instanceof Location){
110 $this->yaw = $pos->yaw;
111 $this->pitch = $pos->pitch;
113 parent::fromObjectAdd($pos,
$x,
$y,
$z);
◆ getPitch()
◆ getYaw()
◆ $pitch
◆ $yaw
The documentation for this class was generated from the following file:
- src/pocketmine/level/Location.php