diff --git a/server/Vec2.ts b/server/Vec2.ts index 98f2aac..812a60f 100644 --- a/server/Vec2.ts +++ b/server/Vec2.ts @@ -17,6 +17,10 @@ export class Vec2 { } } + public get isZero() { + return this.x === 0 && this.y === 0; + } + public set(x?:Vec2 | number, y?:number) { if (x instanceof Vec2) { this.x = x.x; diff --git a/server/Vec3.ts b/server/Vec3.ts index ff2604d..c71ed9b 100644 --- a/server/Vec3.ts +++ b/server/Vec3.ts @@ -21,6 +21,10 @@ export class Vec3 { } } + public get isZero() { + return this.x === 0 && this.y === 0 && this.z === 0; + } + public set(x?:Vec3 | number, y?:number, z?:number) { if (x instanceof Vec3) { this.x = x.x;