mirror of
https://github.com/celisej567/mcpe.git
synced 2026-09-17 20:10:23 +03:00
* Add PathFinder and friends.
This commit is contained in:
17
source/world/level/path/Node.cpp
Normal file
17
source/world/level/path/Node.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
/********************************************************************
|
||||
Minecraft: Pocket Edition - Decompilation Project
|
||||
Copyright (C) 2023 iProgramInCpp
|
||||
|
||||
The following code is licensed under the BSD 1 clause license.
|
||||
SPDX-License-Identifier: BSD-1-Clause
|
||||
********************************************************************/
|
||||
#include "Node.hpp"
|
||||
#include "common/Mth.hpp"
|
||||
|
||||
float Node::distanceTo(Node* node)
|
||||
{
|
||||
float dx = node->m_x - m_x;
|
||||
float dy = node->m_y - m_y;
|
||||
float dz = node->m_z - m_z;
|
||||
return Mth::sqrt(dx * dx + dy * dy + dz * dz);
|
||||
}
|
||||
Reference in New Issue
Block a user