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

@ -64,7 +64,7 @@ class MovingObjectPosition{
$ob->blockX = $x;
$ob->blockY = $y;
$ob->blockZ = $z;
$ob->hitVector = new Vector3($hitVector->x, $hitVector->y, $hitVector->z);
$ob->hitVector = Vector3::createVector($hitVector->x, $hitVector->y, $hitVector->z);
return $ob;
}
@ -77,7 +77,7 @@ class MovingObjectPosition{
$ob = new MovingObjectPosition;
$ob->typeOfHit = 1;
$ob->entityHit = $entity;
$ob->hitVector = new Vector3($entity->x, $entity->y, $entity->z);
$ob->hitVector = Vector3::createVector($entity->x, $entity->y, $entity->z);
return $ob;
}
}