PocketMine-MP 5.33.2 git-1133d49c924b4358c79d44eeb97dcbf56cb4d1eb
Loading...
Searching...
No Matches
pocketmine\math\AxisAlignedBB Class Reference
+ Collaboration diagram for pocketmine\math\AxisAlignedBB:

Public Member Functions

 __construct (float $minX, float $minY, float $minZ, float $maxX, float $maxY, float $maxZ)
 
 __toString ()
 
 addCoord (float $x, float $y, float $z)
 
 calculateIntercept (Vector3 $pos1, Vector3 $pos2)
 
 calculateXOffset (AxisAlignedBB $bb, float $x)
 
 calculateYOffset (AxisAlignedBB $bb, float $y)
 
 calculateZOffset (AxisAlignedBB $bb, float $z)
 
 contractedCopy (float $x, float $y, float $z)
 
 expandedCopy (float $x, float $y, float $z)
 
 extendedCopy (Facing $face, float $distance)
 
 getAverageEdgeLength ()
 
 getVolume ()
 
 getXLength ()
 
 getYLength ()
 
 getZLength ()
 
 intersectsWith (AxisAlignedBB $bb, float $epsilon=0.00001)
 
 isCube (float $epsilon=0.000001)
 
 isVectorInside (Vector3 $vector)
 
 isVectorInXY (Vector3 $vector)
 
 isVectorInXZ (Vector3 $vector)
 
 isVectorInYZ (Vector3 $vector)
 
 offsetCopy (float $x, float $y, float $z)
 
 offsetTowardsCopy (Facing $face, float $distance)
 
 squashedCopy (Axis $axis, float $distance)
 
 stretchedCopy (Axis $axis, float $distance)
 
 trimmedCopy (Facing $face, float $distance)
 

Static Public Member Functions

static one ()
 

Public Attributes

float $maxX
 
float $maxY
 
float $maxZ
 
float $minX
 
float $minY
 
float $minZ
 

Detailed Description

Definition at line 29 of file AxisAlignedBB.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\math\AxisAlignedBB::__construct ( float $minX,
float $minY,
float $minZ,
float $maxX,
float $maxY,
float $maxZ )

Definition at line 38 of file AxisAlignedBB.php.

Member Function Documentation

◆ __toString()

pocketmine\math\AxisAlignedBB::__toString ( )

Definition at line 412 of file AxisAlignedBB.php.

◆ addCoord()

pocketmine\math\AxisAlignedBB::addCoord ( float $x,
float $y,
float $z )

Returns a new AxisAlignedBB extended by the specified X, Y and Z. If each of X, Y and Z are positive, the relevant max bound will be increased. If negative, the relevant min bound will be decreased.

Definition at line 61 of file AxisAlignedBB.php.

◆ calculateIntercept()

pocketmine\math\AxisAlignedBB::calculateIntercept ( Vector3 $pos1,
Vector3 $pos2 )

Performs a ray-trace and calculates the point on the AABB's edge nearest the start position that the ray-trace collided with. Returns a RayTraceResult with colliding vector closest to the start position. Returns null if no colliding point was found.

Definition at line 355 of file AxisAlignedBB.php.

◆ calculateXOffset()

pocketmine\math\AxisAlignedBB::calculateXOffset ( AxisAlignedBB $bb,
float $x )

Definition at line 211 of file AxisAlignedBB.php.

◆ calculateYOffset()

pocketmine\math\AxisAlignedBB::calculateYOffset ( AxisAlignedBB $bb,
float $y )

Definition at line 233 of file AxisAlignedBB.php.

◆ calculateZOffset()

pocketmine\math\AxisAlignedBB::calculateZOffset ( AxisAlignedBB $bb,
float $z )

Definition at line 255 of file AxisAlignedBB.php.

◆ contractedCopy()

pocketmine\math\AxisAlignedBB::contractedCopy ( float $x,
float $y,
float $z )

Returns a copy of the AxisAlignedBB with bounds contracted by the specified X, Y and Z.

Definition at line 130 of file AxisAlignedBB.php.

◆ expandedCopy()

pocketmine\math\AxisAlignedBB::expandedCopy ( float $x,
float $y,
float $z )

Returns a copy of the AxisAlignedBB with bounds outset by the specified X, Y and Z.

Definition at line 93 of file AxisAlignedBB.php.

◆ extendedCopy()

pocketmine\math\AxisAlignedBB::extendedCopy ( Facing $face,
float $distance )

Returns a copy of the AxisAlignedBB extended in the given direction.

Parameters
float$distanceNegative values pull the face in, positive values push out.

Definition at line 146 of file AxisAlignedBB.php.

◆ getAverageEdgeLength()

pocketmine\math\AxisAlignedBB::getAverageEdgeLength ( )

Returns the mean average of the AABB's X, Y and Z lengths.

Definition at line 307 of file AxisAlignedBB.php.

◆ getVolume()

pocketmine\math\AxisAlignedBB::getVolume ( )

Returns the interior volume of the AABB.

Definition at line 325 of file AxisAlignedBB.php.

◆ getXLength()

pocketmine\math\AxisAlignedBB::getXLength ( )

Definition at line 311 of file AxisAlignedBB.php.

◆ getYLength()

pocketmine\math\AxisAlignedBB::getYLength ( )

Definition at line 313 of file AxisAlignedBB.php.

◆ getZLength()

pocketmine\math\AxisAlignedBB::getZLength ( )

Definition at line 315 of file AxisAlignedBB.php.

◆ intersectsWith()

pocketmine\math\AxisAlignedBB::intersectsWith ( AxisAlignedBB $bb,
float $epsilon = 0.00001 )

Returns whether any part of the specified AABB is inside (intersects with) this one.

Definition at line 280 of file AxisAlignedBB.php.

Referenced by pocketmine\block\Block\collidesWithBB().

+ Here is the caller graph for this function:

◆ isCube()

pocketmine\math\AxisAlignedBB::isCube ( float $epsilon = 0.000001)

Definition at line 317 of file AxisAlignedBB.php.

◆ isVectorInside()

pocketmine\math\AxisAlignedBB::isVectorInside ( Vector3 $vector)

Returns whether the specified vector is within the bounds of this AABB on all axes.

Definition at line 293 of file AxisAlignedBB.php.

◆ isVectorInXY()

pocketmine\math\AxisAlignedBB::isVectorInXY ( Vector3 $vector)

Returns whether the specified vector is within the X and Y bounds of this AABB.

Definition at line 346 of file AxisAlignedBB.php.

◆ isVectorInXZ()

pocketmine\math\AxisAlignedBB::isVectorInXZ ( Vector3 $vector)

Returns whether the specified vector is within the X and Z bounds of this AABB.

Definition at line 339 of file AxisAlignedBB.php.

◆ isVectorInYZ()

pocketmine\math\AxisAlignedBB::isVectorInYZ ( Vector3 $vector)

Returns whether the specified vector is within the Y and Z bounds of this AABB.

Definition at line 332 of file AxisAlignedBB.php.

◆ offsetCopy()

pocketmine\math\AxisAlignedBB::offsetCopy ( float $x,
float $y,
float $z )

Returns a copy of the AxisAlignedBB offset by the specified X, Y and Z.

Definition at line 107 of file AxisAlignedBB.php.

◆ offsetTowardsCopy()

pocketmine\math\AxisAlignedBB::offsetTowardsCopy ( Facing $face,
float $distance )

Returns a copy of the AxisAlignedBB offset in the given direction by the specified distance.

Definition at line 121 of file AxisAlignedBB.php.

◆ one()

static pocketmine\math\AxisAlignedBB::one ( )
static

Returns a 1x1x1 bounding box starting at grid position 0,0,0.

Definition at line 419 of file AxisAlignedBB.php.

◆ squashedCopy()

pocketmine\math\AxisAlignedBB::squashedCopy ( Axis $axis,
float $distance )

Inverse of stretchedCopy().

See also
AxisAlignedBB::stretchedCopy()

Definition at line 207 of file AxisAlignedBB.php.

◆ stretchedCopy()

pocketmine\math\AxisAlignedBB::stretchedCopy ( Axis $axis,
float $distance )

Returns a copy of the AxisAlignedBB stretched along the given axis.

Parameters
float$distanceNegative values reduce width, positive values increase width.

Definition at line 181 of file AxisAlignedBB.php.

◆ trimmedCopy()

pocketmine\math\AxisAlignedBB::trimmedCopy ( Facing $face,
float $distance )

Inverse of extendedCopy().

See also
AxisAlignedBB::extendedCopy()
Parameters
float$distancePositive values pull the face in, negative values push out.

Definition at line 172 of file AxisAlignedBB.php.

Member Data Documentation

◆ $maxX

float pocketmine\math\AxisAlignedBB::$maxX

Definition at line 34 of file AxisAlignedBB.php.

◆ $maxY

float pocketmine\math\AxisAlignedBB::$maxY

Definition at line 35 of file AxisAlignedBB.php.

◆ $maxZ

float pocketmine\math\AxisAlignedBB::$maxZ

Definition at line 36 of file AxisAlignedBB.php.

◆ $minX

float pocketmine\math\AxisAlignedBB::$minX

Definition at line 31 of file AxisAlignedBB.php.

◆ $minY

float pocketmine\math\AxisAlignedBB::$minY

Definition at line 32 of file AxisAlignedBB.php.

◆ $minZ

float pocketmine\math\AxisAlignedBB::$minZ

Definition at line 33 of file AxisAlignedBB.php.


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