From f197222fe64e56f74eb67bf6cbab25f6763222eb Mon Sep 17 00:00:00 2001 From: mincomk Date: Sat, 7 Jun 2025 13:18:22 +0900 Subject: [PATCH] feat: fromXYZ --- package.json | 2 +- src/vec.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 012e97c..e0ba9b2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "computercraft-mutil", - "version": "1.0.0", + "version": "1.0.1", "description": "", "license": "ISC", "author": "", diff --git a/src/vec.ts b/src/vec.ts index fa6b7a0..570e247 100644 --- a/src/vec.ts +++ b/src/vec.ts @@ -5,6 +5,10 @@ export class Vec3 { public z: number, ) { } + public static fromXYZ({ x, y, z }: { x: number; y: number; z: number }) { + return new Vec3(x, y, z); + } + public dot(b: Vec3): number { return this.x * b.x + this.y * b.y + this.z * b.z; }