GenisysPro  for Minecraft PE/Windows 10 v1.1.x
Feature-rich server software for Minecraft PE and Windows 10 Edition
MovingObjectPosition Class Reference

Static Public Member Functions

static fromBlock ($x, $y, $z, $side, Vector3 $hitVector)
 
static fromEntity (Entity $entity)
 

Data Fields

 $typeOfHit
 
 $blockX
 
 $blockY
 
 $blockZ
 
 $sideHit
 
 $hitVector
 
 $entityHit = null
 

Protected Member Functions

 __construct ()
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( )
protected

MovingObjectPosition constructor.

51  {
52 
53  }

Member Function Documentation

◆ fromBlock()

static fromBlock (   $x,
  $y,
  $z,
  $side,
Vector3  $hitVector 
)
static
Parameters
int$x
int$y
int$z
int$side
Vector3$hitVector
Returns
MovingObjectPosition
64  {
65  $ob = new MovingObjectPosition;
66  $ob->typeOfHit = 0;
67  $ob->blockX = $x;
68  $ob->blockY = $y;
69  $ob->blockZ = $z;
70  $ob->hitVector = new Vector3($hitVector->x, $hitVector->y, $hitVector->z);
71  return $ob;
72  }

◆ fromEntity()

static fromEntity ( Entity  $entity)
static
Parameters
Entity$entity
Returns
MovingObjectPosition
79  {
80  $ob = new MovingObjectPosition;
81  $ob->typeOfHit = 1;
82  $ob->entityHit = $entity;
83  $ob->hitVector = new Vector3($entity->x, $entity->y, $entity->z);
84  return $ob;
85  }

Field Documentation

◆ $blockX

$blockX

◆ $blockY

$blockY

◆ $blockZ

$blockZ

◆ $entityHit

$entityHit = null

◆ $hitVector

$hitVector

◆ $sideHit

$sideHit

Which side was hit. If its -1 then it went the full length of the ray trace. Bottom = 0, Top = 1, East = 2, West = 3, North = 4, South = 5.

◆ $typeOfHit

$typeOfHit

0 = block, 1 = entity


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