mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
Do not measure Y dimension for moving speed
This commit is contained in:
parent
263824fa01
commit
2b03e71c97
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user