PocketMine-MP 5.33.2 git-919492bdcad8510eb6606439eb77e1c604f1d1ea
Loading...
Searching...
No Matches
pocketmine\math\Vector3 Class Reference
+ Inheritance diagram for pocketmine\math\Vector3:
+ Collaboration diagram for pocketmine\math\Vector3:

Public Member Functions

 __construct (public float|int $x, public float|int $y, public float|int $z)
 
 __toString ()
 
 abs ()
 
 add (float|int $x, float|int $y, float|int $z)
 
 addVector (Vector3 $v)
 
 asVector3 ()
 
 ceil ()
 
 cross (Vector3 $v)
 
 distance (Vector3 $pos)
 
 distanceSquared (Vector3 $pos)
 
 divide (float $number)
 
 dot (Vector3 $v)
 
 down (int $step=1)
 
 east (int $step=1)
 
 equals (Vector3 $v)
 
 floor ()
 
 getFloorX ()
 
 getFloorY ()
 
 getFloorZ ()
 
 getIntermediateWithXValue (Vector3 $v, float $x)
 
 getIntermediateWithYValue (Vector3 $v, float $y)
 
 getIntermediateWithZValue (Vector3 $v, float $z)
 
 getSide (Facing $side, int $step=1)
 
 getX ()
 
 getY ()
 
 getZ ()
 
 length ()
 
 lengthSquared ()
 
 multiply (float $number)
 
 normalize ()
 
 north (int $step=1)
 
 round (int $precision=0, int $mode=PHP_ROUND_HALF_UP)
 
 sides (int $step=1)
 
 sidesAroundAxis (Axis $axis, int $step=1)
 
 sidesArray (bool $keys=false, int $step=1)
 
 south (int $step=1)
 
 subtract (float|int $x, float|int $y, float|int $z)
 
 subtractVector (Vector3 $v)
 
 up (int $step=1)
 
 west (int $step=1)
 
 withComponents (float|int|null $x, float|int|null $y, float|int|null $z)
 

Static Public Member Functions

static maxComponents (Vector3 $vector, Vector3 ... $vectors)
 
static minComponents (Vector3 $vector, Vector3 ... $vectors)
 
static sum (Vector3 ... $vector3s)
 
static zero ()
 

Detailed Description

Definition at line 37 of file Vector3.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\math\Vector3::__construct ( public float|int $x,
public float|int $y,
public float|int $z )

Definition at line 38 of file Vector3.php.

Member Function Documentation

◆ __toString()

pocketmine\math\Vector3::__toString ( )

Definition at line 317 of file Vector3.php.

◆ abs()

pocketmine\math\Vector3::abs ( )

Definition at line 114 of file Vector3.php.

◆ add()

pocketmine\math\Vector3::add ( float|int $x,
float|int $y,
float|int $z )

Definition at line 73 of file Vector3.php.

◆ addVector()

pocketmine\math\Vector3::addVector ( Vector3 $v)

Definition at line 77 of file Vector3.php.

◆ asVector3()

pocketmine\math\Vector3::asVector3 ( )

Return a Vector3 instance

Definition at line 209 of file Vector3.php.

◆ ceil()

pocketmine\math\Vector3::ceil ( )

Definition at line 97 of file Vector3.php.

◆ cross()

pocketmine\math\Vector3::cross ( Vector3 $v)

Definition at line 245 of file Vector3.php.

◆ distance()

pocketmine\math\Vector3::distance ( Vector3 $pos)

Definition at line 213 of file Vector3.php.

◆ distanceSquared()

pocketmine\math\Vector3::distanceSquared ( Vector3 $pos)

Definition at line 217 of file Vector3.php.

◆ divide()

pocketmine\math\Vector3::divide ( float $number)

Definition at line 93 of file Vector3.php.

◆ dot()

pocketmine\math\Vector3::dot ( Vector3 $v)

Definition at line 241 of file Vector3.php.

◆ down()

pocketmine\math\Vector3::down ( int $step = 1)
Returns
Vector3

Definition at line 130 of file Vector3.php.

◆ east()

pocketmine\math\Vector3::east ( int $step = 1)
Returns
Vector3

Definition at line 165 of file Vector3.php.

◆ equals()

pocketmine\math\Vector3::equals ( Vector3 $v)

Definition at line 253 of file Vector3.php.

◆ floor()

pocketmine\math\Vector3::floor ( )

Definition at line 101 of file Vector3.php.

◆ getFloorX()

pocketmine\math\Vector3::getFloorX ( )

Definition at line 61 of file Vector3.php.

◆ getFloorY()

pocketmine\math\Vector3::getFloorY ( )

Definition at line 65 of file Vector3.php.

◆ getFloorZ()

pocketmine\math\Vector3::getFloorZ ( )

Definition at line 69 of file Vector3.php.

◆ getIntermediateWithXValue()

pocketmine\math\Vector3::getIntermediateWithXValue ( Vector3 $v,
float $x )

Returns a new vector with x value equal to the second parameter, along the line between this vector and the passed in vector, or null if not possible.

Definition at line 264 of file Vector3.php.

◆ getIntermediateWithYValue()

pocketmine\math\Vector3::getIntermediateWithYValue ( Vector3 $v,
float $y )

Returns a new vector with y value equal to the second parameter, along the line between this vector and the passed in vector, or null if not possible.

Definition at line 283 of file Vector3.php.

◆ getIntermediateWithZValue()

pocketmine\math\Vector3::getIntermediateWithZValue ( Vector3 $v,
float $z )

Returns a new vector with z value equal to the second parameter, along the line between this vector and the passed in vector, or null if not possible.

Definition at line 302 of file Vector3.php.

◆ getSide()

pocketmine\math\Vector3::getSide ( Facing $side,
int $step = 1 )
Returns
Vector3

Reimplemented in pocketmine\world\Position.

Definition at line 121 of file Vector3.php.

◆ getX()

pocketmine\math\Vector3::getX ( )

Definition at line 49 of file Vector3.php.

◆ getY()

pocketmine\math\Vector3::getY ( )

Definition at line 53 of file Vector3.php.

◆ getZ()

pocketmine\math\Vector3::getZ ( )

Definition at line 57 of file Vector3.php.

◆ length()

pocketmine\math\Vector3::length ( )

Definition at line 224 of file Vector3.php.

◆ lengthSquared()

pocketmine\math\Vector3::lengthSquared ( )

Definition at line 228 of file Vector3.php.

◆ maxComponents()

static pocketmine\math\Vector3::maxComponents ( Vector3 $vector,
Vector3 ... $vectors )
static

Returns a new Vector3 taking the maximum of each component in the input vectors.

Parameters
Vector3...$vectors

Definition at line 338 of file Vector3.php.

◆ minComponents()

static pocketmine\math\Vector3::minComponents ( Vector3 $vector,
Vector3 ... $vectors )
static

Returns a new Vector3 taking the minimum of each component in the input vectors.

Parameters
Vector3...$vectors

Definition at line 355 of file Vector3.php.

◆ multiply()

pocketmine\math\Vector3::multiply ( float $number)

Definition at line 89 of file Vector3.php.

◆ normalize()

pocketmine\math\Vector3::normalize ( )

Definition at line 232 of file Vector3.php.

◆ north()

pocketmine\math\Vector3::north ( int $step = 1)
Returns
Vector3

Definition at line 144 of file Vector3.php.

◆ round()

pocketmine\math\Vector3::round ( int $precision = 0,
int $mode = PHP_ROUND_HALF_UP )

@phpstan-param 1|2|3|4 $mode

Definition at line 108 of file Vector3.php.

References pocketmine\math\Vector3\round().

Referenced by pocketmine\math\Vector3\round().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sides()

pocketmine\math\Vector3::sides ( int $step = 1)

Yields vectors stepped out from this one in all directions.

Parameters
int$stepDistance in each direction to shift the vector
Returns
\Generator|Vector3[] @phpstan-return \Generator<int, Vector3, void, void>

Definition at line 177 of file Vector3.php.

◆ sidesAroundAxis()

pocketmine\math\Vector3::sidesAroundAxis ( Axis $axis,
int $step = 1 )

Yields vectors stepped out from this one in directions except those on the given axis.

Returns
\Generator|Vector3[] @phpstan-return \Generator<int, Vector3, void, void>

Definition at line 198 of file Vector3.php.

◆ sidesArray()

pocketmine\math\Vector3::sidesArray ( bool $keys = false,
int $step = 1 )

Same as sides() but returns a pre-populated array instead of Generator.

Returns
Vector3[]

Definition at line 188 of file Vector3.php.

◆ south()

pocketmine\math\Vector3::south ( int $step = 1)
Returns
Vector3

Definition at line 151 of file Vector3.php.

◆ subtract()

pocketmine\math\Vector3::subtract ( float|int $x,
float|int $y,
float|int $z )

Definition at line 81 of file Vector3.php.

◆ subtractVector()

pocketmine\math\Vector3::subtractVector ( Vector3 $v)

Definition at line 85 of file Vector3.php.

◆ sum()

static pocketmine\math\Vector3::sum ( Vector3 ... $vector3s)
static

Definition at line 367 of file Vector3.php.

◆ up()

pocketmine\math\Vector3::up ( int $step = 1)
Returns
Vector3

Definition at line 137 of file Vector3.php.

◆ west()

pocketmine\math\Vector3::west ( int $step = 1)
Returns
Vector3

Definition at line 158 of file Vector3.php.

◆ withComponents()

pocketmine\math\Vector3::withComponents ( float|int|null $x,
float|int|null $y,
float|int|null $z )

Returns a Vector3 with the provided components. If any of the components are null, the values from this Vector3 will be filled in instead. If no components are overridden (all components are null), the original vector will be returned unchanged.

Definition at line 326 of file Vector3.php.

◆ zero()

static pocketmine\math\Vector3::zero ( )
static

Definition at line 44 of file Vector3.php.


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