Do not measure Y dimension for moving speed

This commit is contained in:
Shoghi Cervantes Pueyo 2013-03-30 21:38:29 +01:00
parent 263824fa01
commit 2b03e71c97

View File

@ -552,8 +552,8 @@ class Entity extends stdClass{
public function calculateVelocity(){
$diffTime = max(0.05, abs(microtime(true) - $this->last[5]));
$origin = new Vector3($this->last[0], $this->last[1], $this->last[2]);
$final = new Vector3($this->x, $this->y, $this->z);
$origin = new Vector3($this->last[0], $this->last[2]);
$final = new Vector3($this->x, $this->z);
$speedX = ($this->last[0] - $this->x) / $diffTime;
$speedY = ($this->last[1] - $this->y) / $diffTime;
$speedZ = ($this->last[2] - $this->z) / $diffTime;