Implemented Vector3 List and AxisAlignedBB Pool to decrease object allocation

This commit is contained in:
Shoghi Cervantes
2014-10-27 15:39:20 +01:00
parent be948f99cc
commit 7abf52e615
39 changed files with 273 additions and 223 deletions

View File

@ -48,12 +48,9 @@ class Slab extends Transparent{
}
public function getBoundingBox(){
if($this->boundingBox !== null){
return $this->boundingBox;
}
if(($this->meta & 0x08) > 0){
return $this->boundingBox = new AxisAlignedBB(
return AxisAlignedBB::getBoundingBoxFromPool(
$this->x,
$this->y + 0.5,
$this->z,
@ -62,7 +59,7 @@ class Slab extends Transparent{
$this->z + 1
);
}else{
return $this->boundingBox = new AxisAlignedBB(
return AxisAlignedBB::getBoundingBoxFromPool(
$this->x,
$this->y,
$this->z,