diff --git a/src/lib/Pos3.hx b/src/lib/Pos3.hx index 104d245..75ef0a7 100644 --- a/src/lib/Pos3.hx +++ b/src/lib/Pos3.hx @@ -104,4 +104,8 @@ abstract Pos3(Vec3) from Vec3 to Vec3{ z: Math.fround(this.z) }); } + + public function distance(rhs:Pos3):Float { + return Math.sqrt(Math.pow(this.x - rhs.x, 2) + Math.pow(this.y - rhs.y, 2) + Math.pow(this.z - rhs.z, 2)); + } }