diff --git a/src/lib/Pos3.hx b/src/lib/Pos3.hx index eb236f9..104d245 100644 --- a/src/lib/Pos3.hx +++ b/src/lib/Pos3.hx @@ -96,4 +96,12 @@ abstract Pos3(Vec3) from Vec3 to Vec3{ public function toString():String { return 'Pos3(${this.x}, ${this.y}, ${this.z})'; } + + public function round():Pos3 { + return new Pos3({ + x: Math.fround(this.x), + y: Math.fround(this.y), + z: Math.fround(this.z) + }); + } }