@minecraft/math 2.2.11 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/api-report/math.api.md +127 -0
  2. package/dist/minecraft-math.d.ts +1034 -431
  3. package/dist/minecraft-math.js +833 -6
  4. package/dist/minecraft-math.js.map +3 -3
  5. package/lib/__mocks__/minecraft-server.js +17 -0
  6. package/lib/__mocks__/minecraft-server.js.map +1 -0
  7. package/lib/src/aabb/coreHelpers.js +282 -0
  8. package/lib/src/aabb/coreHelpers.js.map +1 -0
  9. package/lib/src/aabb/coreHelpers.test.js +227 -0
  10. package/lib/src/aabb/coreHelpers.test.js.map +1 -0
  11. package/lib/src/aabb/index.js +4 -0
  12. package/lib/src/aabb/index.js.map +1 -0
  13. package/lib/src/general/clamp.js.map +1 -0
  14. package/lib/src/general/index.js.map +1 -0
  15. package/lib/{index.js → src/index.js} +1 -0
  16. package/lib/src/index.js.map +1 -0
  17. package/lib/src/index.test.js.map +1 -0
  18. package/lib/{vector3 → src/vector3}/coreHelpers.js +294 -2
  19. package/lib/src/vector3/coreHelpers.js.map +1 -0
  20. package/lib/src/vector3/coreHelpers.test.js +578 -0
  21. package/lib/src/vector3/coreHelpers.test.js.map +1 -0
  22. package/lib/src/vector3/index.js.map +1 -0
  23. package/lib/src/vector3/vectorWrapper.js +509 -0
  24. package/lib/src/vector3/vectorWrapper.js.map +1 -0
  25. package/lib/src/vector3/vectorWrapper.test.js +575 -0
  26. package/lib/src/vector3/vectorWrapper.test.js.map +1 -0
  27. package/lib/types/math-beta.d.ts +1034 -431
  28. package/lib/types/math-public.d.ts +1034 -431
  29. package/lib/types/math.d.ts +1034 -431
  30. package/package.json +1 -1
  31. package/lib/general/clamp.js.map +0 -1
  32. package/lib/general/index.js.map +0 -1
  33. package/lib/index.js.map +0 -1
  34. package/lib/index.test.js.map +0 -1
  35. package/lib/vector3/coreHelpers.js.map +0 -1
  36. package/lib/vector3/coreHelpers.test.js +0 -264
  37. package/lib/vector3/coreHelpers.test.js.map +0 -1
  38. package/lib/vector3/index.js.map +0 -1
  39. package/lib/vector3/vectorWrapper.js +0 -230
  40. package/lib/vector3/vectorWrapper.js.map +0 -1
  41. package/lib/vector3/vectorWrapper.test.js +0 -228
  42. package/lib/vector3/vectorWrapper.test.js.map +0 -1
  43. /package/lib/{general → src/general}/clamp.js +0 -0
  44. /package/lib/{general → src/general}/index.js +0 -0
  45. /package/lib/{index.test.js → src/index.test.js} +0 -0
  46. /package/lib/{vector3 → src/vector3}/index.js +0 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/general/clamp.ts", "../src/vector3/coreHelpers.ts", "../src/vector3/vectorWrapper.ts"],
4
- "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Clamps the passed in number to the passed in min and max values.\n *\n * @public\n */\nexport function clampNumber(val: number, min: number, max: number): number {\n return Math.min(Math.max(val, min), max);\n}\n", "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { Vector2, Vector3 } from '@minecraft/server';\nimport { clampNumber } from '../general/clamp.js';\n\n/**\n * Utilities operating on Vector3 objects. All methods are static and do not modify the input objects.\n *\n * @public\n */\nexport class Vector3Utils {\n /**\n * equals\n *\n * Check the equality of two vectors\n */\n static equals(v1: Vector3, v2: Vector3): boolean {\n return v1.x === v2.x && v1.y === v2.y && v1.z === v2.z;\n }\n\n /**\n * add\n *\n * Add two vectors to produce a new vector\n */\n static add(v1: Vector3, v2: Partial<Vector3>): Vector3 {\n return { x: v1.x + (v2.x ?? 0), y: v1.y + (v2.y ?? 0), z: v1.z + (v2.z ?? 0) };\n }\n\n /**\n * subtract\n *\n * Subtract two vectors to produce a new vector (v1-v2)\n */\n static subtract(v1: Vector3, v2: Partial<Vector3>): Vector3 {\n return { x: v1.x - (v2.x ?? 0), y: v1.y - (v2.y ?? 0), z: v1.z - (v2.z ?? 0) };\n }\n\n /** scale\n *\n * Multiple all entries in a vector by a single scalar value producing a new vector\n */\n static scale(v1: Vector3, scale: number): Vector3 {\n return { x: v1.x * scale, y: v1.y * scale, z: v1.z * scale };\n }\n\n /**\n * dot\n *\n * Calculate the dot product of two vectors\n */\n static dot(a: Vector3, b: Vector3): number {\n return a.x * b.x + a.y * b.y + a.z * b.z;\n }\n\n /**\n * cross\n *\n * Calculate the cross product of two vectors. Returns a new vector.\n */\n static cross(a: Vector3, b: Vector3): Vector3 {\n return { x: a.y * b.z - a.z * b.y, y: a.z * b.x - a.x * b.z, z: a.x * b.y - a.y * b.x };\n }\n\n /**\n * magnitude\n *\n * The magnitude of a vector\n */\n static magnitude(v: Vector3): number {\n return Math.sqrt(v.x ** 2 + v.y ** 2 + v.z ** 2);\n }\n\n /**\n * distance\n *\n * Calculate the distance between two vectors\n */\n static distance(a: Vector3, b: Vector3): number {\n return Vector3Utils.magnitude(Vector3Utils.subtract(a, b));\n }\n\n /**\n * normalize\n *\n * Takes a vector 3 and normalizes it to a unit vector\n */\n static normalize(v: Vector3): Vector3 {\n const mag = Vector3Utils.magnitude(v);\n return { x: v.x / mag, y: v.y / mag, z: v.z / mag };\n }\n\n /**\n * floor\n *\n * Floor the components of a vector to produce a new vector\n */\n static floor(v: Vector3): Vector3 {\n return { x: Math.floor(v.x), y: Math.floor(v.y), z: Math.floor(v.z) };\n }\n\n /**\n * toString\n *\n * Create a string representation of a vector3\n */\n static toString(v: Vector3, options?: { decimals?: number; delimiter?: string }): string {\n const decimals = options?.decimals ?? 2;\n const str: string[] = [v.x.toFixed(decimals), v.y.toFixed(decimals), v.z.toFixed(decimals)];\n return str.join(options?.delimiter ?? ', ');\n }\n\n /**\n * fromString\n *\n * Gets a Vector3 from the string representation produced by {@link Vector3Utils.toString}. If any numeric value is not a number\n * or the format is invalid, undefined is returned.\n * @param str - The string to parse\n * @param delimiter - The delimiter used to separate the components. Defaults to the same as the default for {@link Vector3Utils.toString}\n */\n static fromString(str: string, delimiter: string = ','): Vector3 | undefined {\n const parts = str.split(delimiter);\n if (parts.length !== 3) {\n return undefined;\n }\n\n const output = parts.map(part => parseFloat(part));\n if (output.some(part => isNaN(part))) {\n return undefined;\n }\n return { x: output[0], y: output[1], z: output[2] };\n }\n\n /**\n * clamp\n *\n * Clamps the components of a vector to limits to produce a new vector\n */\n static clamp(v: Vector3, limits?: { min?: Partial<Vector3>; max?: Partial<Vector3> }): Vector3 {\n return {\n x: clampNumber(v.x, limits?.min?.x ?? Number.MIN_SAFE_INTEGER, limits?.max?.x ?? Number.MAX_SAFE_INTEGER),\n y: clampNumber(v.y, limits?.min?.y ?? Number.MIN_SAFE_INTEGER, limits?.max?.y ?? Number.MAX_SAFE_INTEGER),\n z: clampNumber(v.z, limits?.min?.z ?? Number.MIN_SAFE_INTEGER, limits?.max?.z ?? Number.MAX_SAFE_INTEGER),\n };\n }\n\n /**\n * lerp\n *\n * Constructs a new vector using linear interpolation on each component from two vectors.\n */\n static lerp(a: Vector3, b: Vector3, t: number): Vector3 {\n return { x: a.x + (b.x - a.x) * t, y: a.y + (b.y - a.y) * t, z: a.z + (b.z - a.z) * t };\n }\n\n /**\n * slerp\n *\n * Constructs a new vector using spherical linear interpolation on each component from two vectors.\n */\n static slerp(a: Vector3, b: Vector3, t: number): Vector3 {\n const theta = Math.acos(Vector3Utils.dot(a, b));\n const sinTheta = Math.sin(theta);\n const ta = Math.sin((1.0 - t) * theta) / sinTheta;\n const tb = Math.sin(t * theta) / sinTheta;\n return Vector3Utils.add(Vector3Utils.scale(a, ta), Vector3Utils.scale(b, tb));\n }\n\n /**\n * multiply\n *\n * Element-wise multiplication of two vectors together.\n * Not to be confused with {@link Vector3Utils.dot} product or {@link Vector3Utils.cross} product\n */\n static multiply(a: Vector3, b: Vector3): Vector3 {\n return { x: a.x * b.x, y: a.y * b.y, z: a.z * b.z };\n }\n\n /**\n * rotateX\n *\n * Rotates the vector around the x axis counterclockwise (left hand rule)\n * @param a - Angle in radians\n */\n static rotateX(v: Vector3, a: number): Vector3 {\n const cos = Math.cos(a);\n const sin = Math.sin(a);\n return { x: v.x, y: v.y * cos - v.z * sin, z: v.z * cos + v.y * sin };\n }\n\n /**\n * rotateY\n *\n * Rotates the vector around the y axis counterclockwise (left hand rule)\n * @param a - Angle in radians\n */\n static rotateY(v: Vector3, a: number): Vector3 {\n const cos = Math.cos(a);\n const sin = Math.sin(a);\n return { x: v.x * cos + v.z * sin, y: v.y, z: v.z * cos - v.x * sin };\n }\n\n /**\n * rotateZ\n *\n * Rotates the vector around the z axis counterclockwise (left hand rule)\n * @param a - Angle in radians\n */\n static rotateZ(v: Vector3, a: number): Vector3 {\n const cos = Math.cos(a);\n const sin = Math.sin(a);\n return { x: v.x * cos - v.y * sin, y: v.y * cos + v.x * sin, z: v.z };\n }\n}\n\n/**\n * Utilities operating on Vector2 objects. All methods are static and do not modify the input objects.\n *\n * @public\n */\nexport class Vector2Utils {\n /**\n * toString\n *\n * Create a string representation of a vector2\n */\n static toString(v: Vector2, options?: { decimals?: number; delimiter?: string }): string {\n const decimals = options?.decimals ?? 2;\n const str: string[] = [v.x.toFixed(decimals), v.y.toFixed(decimals)];\n return str.join(options?.delimiter ?? ', ');\n }\n\n /**\n * fromString\n *\n * Gets a Vector2 from the string representation produced by {@link Vector3Utils.toString}. If any numeric value is not a number\n * or the format is invalid, undefined is returned.\n * @param str - The string to parse\n * @param delimiter - The delimiter used to separate the components. Defaults to the same as the default for {@link Vector3Utils.toString}\n */\n static fromString(str: string, delimiter: string = ','): Vector2 | undefined {\n const parts = str.split(delimiter);\n if (parts.length !== 2) {\n return undefined;\n }\n\n const output = parts.map(part => parseFloat(part));\n if (output.some(part => isNaN(part))) {\n return undefined;\n }\n return { x: output[0], y: output[1] };\n }\n}\n\n/**\n * up\n *\n * A unit vector representing the world UP direction (0,1,0)\n *\n * @public\n */\nexport const VECTOR3_UP: Vector3 = { x: 0, y: 1, z: 0 };\n/**\n * down\n *\n * A unit vector representing the world DOWN direction (0,-1,0)\n *\n * @public\n */\nexport const VECTOR3_DOWN: Vector3 = { x: 0, y: -1, z: 0 };\n/**\n * left\n *\n * A unit vector representing the world LEFT direction (-1,0,0)\n *\n * @public\n */\nexport const VECTOR3_LEFT: Vector3 = { x: -1, y: 0, z: 0 };\n/**\n * right\n *\n * A unit vector representing the world RIGHT direction (1,0,0)\n *\n * @public\n */\nexport const VECTOR3_RIGHT: Vector3 = { x: 1, y: 0, z: 0 };\n/**\n * forward\n *\n * A unit vector representing the world FORWARD direction (0,0,1)\n *\n * @public\n */\nexport const VECTOR3_FORWARD: Vector3 = { x: 0, y: 0, z: 1 };\n/**\n * back\n *\n * A unit vector representing the world BACK direction (0,0,-1)\n *\n * @public\n */\nexport const VECTOR3_BACK: Vector3 = { x: 0, y: 0, z: -1 };\n/**\n * one\n *\n * A unit vector representing the value of 1 in all directions (1,1,1)\n *\n * @public\n */\nexport const VECTOR3_ONE: Vector3 = { x: 1, y: 1, z: 1 };\n/**\n * zero\n *\n * A unit vector representing the value of 0 in all directions (0,0,0)\n *\n * @public\n */\nexport const VECTOR3_ZERO: Vector3 = { x: 0, y: 0, z: 0 };\n/**\n * west\n *\n * A unit vector representing the world WEST direction (-1,0,0)\n * (same as LEFT)\n *\n * @public\n */\nexport const VECTOR3_WEST: Vector3 = { x: -1, y: 0, z: 0 };\n/**\n * east\n *\n * A unit vector representing the world EAST direction (-1,0,0)\n * (same as RIGHT)\n *\n * @public\n */\nexport const VECTOR3_EAST: Vector3 = { x: 1, y: 0, z: 0 };\n/**\n * north\n *\n * A unit vector representing the world NORTH direction (-1,0,0)\n * (same as FORWARD)\n *\n * @public\n */\nexport const VECTOR3_NORTH: Vector3 = { x: 0, y: 0, z: 1 };\n/**\n * south\n *\n * A unit vector representing the world SOUTH direction (-1,0,0)\n * (same as BACK)\n *\n * @public\n */\nexport const VECTOR3_SOUTH: Vector3 = { x: 0, y: 0, z: -1 };\n/**\n * half\n *\n * A unit vector representing the value of 0.5 in all directions (0.5,0.5,0.5)\n *\n * @public\n */\nexport const VECTOR3_HALF: Vector3 = { x: 0.5, y: 0.5, z: 0.5 };\n/**\n * negative\n *\n * A unit vector representing the value of -1 in all directions (-1,-1,-1)\n *\n * @public\n */\nexport const VECTOR3_NEGATIVE_ONE: Vector3 = { x: -1, y: -1, z: -1 };\n/**\n * zero\n *\n * A vector representing the value of 0 in all directions (0,0)\n *\n * @public\n */\nexport const VECTOR2_ZERO: Vector2 = { x: 0, y: 0 };\n", "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { Vector2, Vector3 } from '@minecraft/server';\nimport { Vector2Utils, Vector3Utils } from './coreHelpers.js';\n\n/**\n * Vector3 wrapper class which can be used as a Vector3 for APIs on \\@minecraft/server which require a Vector,\n * but also contain additional helper methods. This is an alternative to using the core Vector 3 utility\n * methods directly, for those who prefer a more object-oriented approach. This version of the class is mutable\n * and changes state inline.\n *\n * For an immutable version of the build, use ImmutableVector3Builder.\n *\n * @public\n */\nexport class Vector3Builder implements Vector3 {\n x: number;\n y: number;\n z: number;\n\n constructor(vecStr: string, delim?: string, arg2?: never);\n constructor(vec: Vector3, arg?: never, arg2?: never);\n constructor(x: number, y: number, z: number);\n constructor(first: number | Vector3 | string, second?: number | string, z?: number) {\n if (typeof first === 'object') {\n this.x = first.x;\n this.y = first.y;\n this.z = first.z;\n } else if (typeof first === 'string') {\n const parsed = Vector3Utils.fromString(first, (second as string | undefined) ?? ',');\n if (!parsed) {\n this.x = 0;\n this.y = 0;\n this.z = 0;\n\n return;\n }\n this.x = parsed.x;\n this.y = parsed.y;\n this.z = parsed.z;\n } else {\n this.x = first;\n this.y = (second as number) ?? 0;\n this.z = z ?? 0;\n }\n }\n\n /**\n * Assigns the values of the passed in vector to this vector. Returns itself.\n */\n assign(vec: Vector3): this {\n this.x = vec.x;\n this.y = vec.y;\n this.z = vec.z;\n return this;\n }\n\n /**\n * equals\n *\n * Check the equality of two vectors\n */\n equals(v: Vector3): boolean {\n return Vector3Utils.equals(this, v);\n }\n\n /**\n * add\n *\n * Adds the vector v to this, returning itself.\n */\n add(v: Partial<Vector3>): this {\n return this.assign(Vector3Utils.add(this, v));\n }\n\n /**\n * subtract\n *\n * Subtracts the vector v from this, returning itself.\n */\n subtract(v: Partial<Vector3>): this {\n return this.assign(Vector3Utils.subtract(this, v));\n }\n\n /** scale\n *\n * Scales this by the passed in value, returning itself.\n */\n scale(val: number): this {\n return this.assign(Vector3Utils.scale(this, val));\n }\n\n /**\n * dot\n *\n * Computes the dot product of this and the passed in vector.\n */\n dot(vec: Vector3): number {\n return Vector3Utils.dot(this, vec);\n }\n\n /**\n * cross\n *\n * Computes the cross product of this and the passed in vector, returning itself.\n */\n cross(vec: Vector3): this {\n return this.assign(Vector3Utils.cross(this, vec));\n }\n\n /**\n * magnitude\n *\n * The magnitude of the vector\n */\n magnitude(): number {\n return Vector3Utils.magnitude(this);\n }\n\n /**\n * distance\n *\n * Calculate the distance between two vectors\n */\n distance(vec: Vector3): number {\n return Vector3Utils.distance(this, vec);\n }\n\n /**\n * normalize\n *\n * Normalizes this vector, returning itself.\n */\n normalize(): this {\n return this.assign(Vector3Utils.normalize(this));\n }\n\n /**\n * floor\n *\n * Floor the components of a vector to produce a new vector\n */\n floor(): this {\n return this.assign(Vector3Utils.floor(this));\n }\n\n /**\n * toString\n *\n * Create a string representation of a vector\n */\n toString(options?: { decimals?: number; delimiter?: string }): string {\n return Vector3Utils.toString(this, options);\n }\n\n /**\n * clamp\n *\n * Clamps the components of a vector to limits to produce a new vector\n */\n clamp(limits: { min?: Partial<Vector3>; max?: Partial<Vector3> }): this {\n return this.assign(Vector3Utils.clamp(this, limits));\n }\n\n /**\n * lerp\n *\n * Constructs a new vector using linear interpolation on each component from two vectors.\n */\n lerp(vec: Vector3, t: number): this {\n return this.assign(Vector3Utils.lerp(this, vec, t));\n }\n\n /**\n * slerp\n *\n * Constructs a new vector using spherical linear interpolation on each component from two vectors.\n */\n slerp(vec: Vector3, t: number): this {\n return this.assign(Vector3Utils.slerp(this, vec, t));\n }\n\n /**\n * multiply\n *\n * Element-wise multiplication of two vectors together.\n * Not to be confused with {@link Vector3Builder.dot} product or {@link Vector3Builder.cross} product\n */\n multiply(vec: Vector3): this {\n return this.assign(Vector3Utils.multiply(this, vec));\n }\n\n /**\n * rotateX\n *\n * Rotates the vector around the x axis counterclockwise (left hand rule)\n * @param a - Angle in radians\n */\n rotateX(a: number): this {\n return this.assign(Vector3Utils.rotateX(this, a));\n }\n\n /**\n * rotateY\n *\n * Rotates the vector around the y axis counterclockwise (left hand rule)\n * @param a - Angle in radians\n */\n rotateY(a: number): this {\n return this.assign(Vector3Utils.rotateY(this, a));\n }\n\n /**\n * rotateZ\n *\n * Rotates the vector around the z axis counterclockwise (left hand rule)\n * @param a - Angle in radians\n */\n rotateZ(a: number): this {\n return this.assign(Vector3Utils.rotateZ(this, a));\n }\n}\n\n/**\n * Vector2 wrapper class which can be used as a Vector2 for APIs on \\@minecraft/server which require a Vector2.\n * @public\n */\nexport class Vector2Builder implements Vector2 {\n x: number;\n y: number;\n\n constructor(vecStr: string, delim?: string);\n constructor(vec: Vector2, arg?: never);\n constructor(x: number, y: number);\n constructor(first: number | Vector2 | string, second?: number | string) {\n if (typeof first === 'object') {\n this.x = first.x;\n this.y = first.y;\n } else if (typeof first === 'string') {\n const parsed = Vector2Utils.fromString(first, (second as string | undefined) ?? ',');\n if (!parsed) {\n this.x = 0;\n this.y = 0;\n\n return;\n }\n\n this.x = parsed.x;\n this.y = parsed.y;\n } else {\n this.x = first;\n this.y = (second as number) ?? 0;\n }\n }\n\n toString(options?: { decimals?: number; delimiter?: string }): string {\n return Vector2Utils.toString(this, options);\n }\n}\n"],
5
- "mappings": ";AAQM,SAAU,YAAY,KAAa,KAAa,KAAW;AAC7D,SAAO,KAAK,IAAI,KAAK,IAAI,KAAK,GAAG,GAAG,GAAG;AAC3C;;;ACCM,IAAO,eAAP,MAAO,cAAY;;;;;;EAMrB,OAAO,OAAO,IAAa,IAA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AwB;AAClE,QAAI,OAAO,UAAU,UAAU;AAC3B,WAAK,IAAI,MAAM;AACf,WAAK,IAAI,MAAM;IACnB,WAAW,OAAO,UAAU,UAAU;AAClC,YAAM,SAAS,aAAa,WAAW,OAAQ,UAAiC,GAAG;AACnF,UAAI,CAAC,QAAQ;AACT,aAAK,IAAI;AACT,aAAK,IAAI;AAET;MACJ;AAEA,WAAK,IAAI,OAAO;AAChB,WAAK,IAAI,OAAO;IACpB,OAAO;AACH,WAAK,IAAI;AACT,WAAK,IAAK,UAAqB;IACnC;EACJ;EAEA,SAAS,SAAmD;AACxD,WAAO,aAAa,SAAS,MAAM,OAAO;EAC9C;;",
3
+ "sources": ["../src/general/clamp.ts", "../src/vector3/coreHelpers.ts", "../src/vector3/vectorWrapper.ts", "../src/aabb/coreHelpers.ts"],
4
+ "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Clamps the passed in number to the passed in min and max values.\n *\n * @public\n */\nexport function clampNumber(val: number, min: number, max: number): number {\n return Math.min(Math.max(val, min), max);\n}\n", "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { Vector2, Vector3, VectorXZ } from '@minecraft/server';\nimport { clampNumber } from '../general/clamp.js';\n\n/**\n * Utilities operating on Vector3 objects. All methods are static and do not modify the input objects.\n *\n * @public\n */\nexport class Vector3Utils {\n /**\n * equals\n *\n * Check the equality of two vectors\n */\n static equals(v1: Vector3, v2: Vector3): boolean {\n return v1.x === v2.x && v1.y === v2.y && v1.z === v2.z;\n }\n\n /**\n * add\n *\n * Add two vectors to produce a new vector\n */\n static add(v1: Vector3, v2: Partial<Vector3>): Vector3 {\n return { x: v1.x + (v2.x ?? 0), y: v1.y + (v2.y ?? 0), z: v1.z + (v2.z ?? 0) };\n }\n\n /**\n * subtract\n *\n * Subtract two vectors to produce a new vector (v1-v2)\n */\n static subtract(v1: Vector3, v2: Partial<Vector3>): Vector3 {\n return { x: v1.x - (v2.x ?? 0), y: v1.y - (v2.y ?? 0), z: v1.z - (v2.z ?? 0) };\n }\n\n /** scale\n *\n * Multiple all entries in a vector by a single scalar value producing a new vector\n */\n static scale(v1: Vector3, scale: number): Vector3 {\n return { x: v1.x * scale, y: v1.y * scale, z: v1.z * scale };\n }\n\n /**\n * dot\n *\n * Calculate the dot product of two vectors\n */\n static dot(a: Vector3, b: Vector3): number {\n return a.x * b.x + a.y * b.y + a.z * b.z;\n }\n\n /**\n * cross\n *\n * Calculate the cross product of two vectors. Returns a new vector.\n */\n static cross(a: Vector3, b: Vector3): Vector3 {\n return { x: a.y * b.z - a.z * b.y, y: a.z * b.x - a.x * b.z, z: a.x * b.y - a.y * b.x };\n }\n\n /**\n * magnitude\n *\n * The magnitude of a vector\n */\n static magnitude(v: Vector3): number {\n return Math.sqrt(v.x ** 2 + v.y ** 2 + v.z ** 2);\n }\n\n /**\n * distance\n *\n * Calculate the distance between two vectors\n */\n static distance(a: Vector3, b: Vector3): number {\n return Vector3Utils.magnitude(Vector3Utils.subtract(a, b));\n }\n\n /**\n * normalize\n *\n * Takes a vector 3 and normalizes it to a unit vector\n */\n static normalize(v: Vector3): Vector3 {\n const mag = Vector3Utils.magnitude(v);\n return { x: v.x / mag, y: v.y / mag, z: v.z / mag };\n }\n\n /**\n * floor\n *\n * Floor the components of a vector to produce a new vector\n */\n static floor(v: Vector3): Vector3 {\n return { x: Math.floor(v.x), y: Math.floor(v.y), z: Math.floor(v.z) };\n }\n\n /**\n * ceil\n *\n * Ceil the components of a vector to produce a new vector\n */\n static ceil(v: Vector3): Vector3 {\n return { x: Math.ceil(v.x), y: Math.ceil(v.y), z: Math.ceil(v.z) };\n }\n\n /**\n * min\n *\n * Min the components of two vectors to produce a new vector\n */\n static min(a: Vector3, b: Vector3): Vector3 {\n return { x: Math.min(a.x, b.x), y: Math.min(a.y, b.y), z: Math.min(a.z, b.z) };\n }\n\n /**\n * max\n *\n * Max the components of two vectors to produce a new vector\n */\n static max(a: Vector3, b: Vector3): Vector3 {\n return { x: Math.max(a.x, b.x), y: Math.max(a.y, b.y), z: Math.max(a.z, b.z) };\n }\n\n /**\n * toString\n *\n * Create a string representation of a vector3\n */\n static toString(v: Vector3, options?: { decimals?: number; delimiter?: string }): string {\n const decimals = options?.decimals ?? 2;\n const str: string[] = [v.x.toFixed(decimals), v.y.toFixed(decimals), v.z.toFixed(decimals)];\n return str.join(options?.delimiter ?? ', ');\n }\n\n /**\n * fromString\n *\n * Gets a Vector3 from the string representation produced by {@link Vector3Utils.toString}. If any numeric value is not a number\n * or the format is invalid, undefined is returned.\n * @param str - The string to parse\n * @param delimiter - The delimiter used to separate the components. Defaults to the same as the default for {@link Vector3Utils.toString}\n */\n static fromString(str: string, delimiter: string = ','): Vector3 | undefined {\n const parts = str.split(delimiter);\n if (parts.length !== 3) {\n return undefined;\n }\n\n const output = parts.map(part => parseFloat(part));\n if (output.some(part => isNaN(part))) {\n return undefined;\n }\n return { x: output[0], y: output[1], z: output[2] };\n }\n\n /**\n * clamp\n *\n * Clamps the components of a vector to limits to produce a new vector\n */\n static clamp(v: Vector3, limits?: { min?: Partial<Vector3>; max?: Partial<Vector3> }): Vector3 {\n return {\n x: clampNumber(v.x, limits?.min?.x ?? Number.MIN_SAFE_INTEGER, limits?.max?.x ?? Number.MAX_SAFE_INTEGER),\n y: clampNumber(v.y, limits?.min?.y ?? Number.MIN_SAFE_INTEGER, limits?.max?.y ?? Number.MAX_SAFE_INTEGER),\n z: clampNumber(v.z, limits?.min?.z ?? Number.MIN_SAFE_INTEGER, limits?.max?.z ?? Number.MAX_SAFE_INTEGER),\n };\n }\n\n /**\n * lerp\n *\n * Constructs a new vector using linear interpolation on each component from two vectors.\n */\n static lerp(a: Vector3, b: Vector3, t: number): Vector3 {\n return { x: a.x + (b.x - a.x) * t, y: a.y + (b.y - a.y) * t, z: a.z + (b.z - a.z) * t };\n }\n\n /**\n * slerp\n *\n * Constructs a new vector using spherical linear interpolation on each component from two vectors.\n */\n static slerp(a: Vector3, b: Vector3, t: number): Vector3 {\n const theta = Math.acos(Vector3Utils.dot(a, b));\n const sinTheta = Math.sin(theta);\n const ta = Math.sin((1.0 - t) * theta) / sinTheta;\n const tb = Math.sin(t * theta) / sinTheta;\n return Vector3Utils.add(Vector3Utils.scale(a, ta), Vector3Utils.scale(b, tb));\n }\n\n /**\n * multiply\n *\n * Element-wise multiplication of two vectors together.\n * Not to be confused with {@link Vector3Utils.dot} product or {@link Vector3Utils.cross} product\n */\n static multiply(a: Vector3, b: Vector3): Vector3 {\n return { x: a.x * b.x, y: a.y * b.y, z: a.z * b.z };\n }\n\n /**\n * rotateX\n *\n * Rotates the vector around the x axis counterclockwise (left hand rule)\n * @param a - Angle in radians\n */\n static rotateX(v: Vector3, a: number): Vector3 {\n const cos = Math.cos(a);\n const sin = Math.sin(a);\n return { x: v.x, y: v.y * cos - v.z * sin, z: v.z * cos + v.y * sin };\n }\n\n /**\n * rotateY\n *\n * Rotates the vector around the y axis counterclockwise (left hand rule)\n * @param a - Angle in radians\n */\n static rotateY(v: Vector3, a: number): Vector3 {\n const cos = Math.cos(a);\n const sin = Math.sin(a);\n return { x: v.x * cos + v.z * sin, y: v.y, z: v.z * cos - v.x * sin };\n }\n\n /**\n * rotateZ\n *\n * Rotates the vector around the z axis counterclockwise (left hand rule)\n * @param a - Angle in radians\n */\n static rotateZ(v: Vector3, a: number): Vector3 {\n const cos = Math.cos(a);\n const sin = Math.sin(a);\n return { x: v.x * cos - v.y * sin, y: v.y * cos + v.x * sin, z: v.z };\n }\n}\n\n/**\n * Utilities operating on Vector2 objects. All methods are static and do not modify the input objects.\n *\n * @public\n */\nexport class Vector2Utils {\n /**\n * equals\n *\n * Check the equality of two vectors\n */\n static equals(v1: Vector2, v2: Vector2): boolean {\n return v1.x === v2.x && v1.y === v2.y;\n }\n\n /**\n * add\n *\n * Add two vectors to produce a new vector\n */\n static add(v1: Vector2, v2: Partial<Vector2>): Vector2 {\n return { x: v1.x + (v2.x ?? 0), y: v1.y + (v2.y ?? 0) };\n }\n\n /**\n * subtract\n *\n * Subtract two vectors to produce a new vector (v1-v2)\n */\n static subtract(v1: Vector2, v2: Partial<Vector2>): Vector2 {\n return { x: v1.x - (v2.x ?? 0), y: v1.y - (v2.y ?? 0) };\n }\n\n /** scale\n *\n * Multiple all entries in a vector by a single scalar value producing a new vector\n */\n static scale(v1: Vector2, scale: number): Vector2 {\n return { x: v1.x * scale, y: v1.y * scale };\n }\n\n /**\n * dot\n *\n * Calculate the dot product of two vectors\n */\n static dot(a: Vector2, b: Vector2): number {\n return a.x * b.x + a.y * b.y;\n }\n\n /**\n * magnitude\n *\n * The magnitude of a vector\n */\n static magnitude(v: Vector2): number {\n return Math.sqrt(v.x ** 2 + v.y ** 2);\n }\n\n /**\n * distance\n *\n * Calculate the distance between two vectors\n */\n static distance(a: Vector2, b: Vector2): number {\n return Vector2Utils.magnitude(Vector2Utils.subtract(a, b));\n }\n\n /**\n * normalize\n *\n * Takes a vector 3 and normalizes it to a unit vector\n */\n static normalize(v: Vector2): Vector2 {\n const mag = Vector2Utils.magnitude(v);\n return { x: v.x / mag, y: v.y / mag };\n }\n\n /**\n * floor\n *\n * Floor the components of a vector to produce a new vector\n */\n static floor(v: Vector2): Vector2 {\n return { x: Math.floor(v.x), y: Math.floor(v.y) };\n }\n\n /**\n * toString\n *\n * Create a string representation of a vector2\n */\n static toString(v: Vector2, options?: { decimals?: number; delimiter?: string }): string {\n const decimals = options?.decimals ?? 2;\n const str: string[] = [v.x.toFixed(decimals), v.y.toFixed(decimals)];\n return str.join(options?.delimiter ?? ', ');\n }\n\n /**\n * fromString\n *\n * Gets a Vector2 from the string representation produced by {@link Vector2Utils.toString}. If any numeric value is not a number\n * or the format is invalid, undefined is returned.\n * @param str - The string to parse\n * @param delimiter - The delimiter used to separate the components. Defaults to the same as the default for {@link Vector2Utils.toString}\n */\n static fromString(str: string, delimiter: string = ','): Vector2 | undefined {\n const parts = str.split(delimiter);\n if (parts.length !== 2) {\n return undefined;\n }\n\n const output = parts.map(part => parseFloat(part));\n if (output.some(part => isNaN(part))) {\n return undefined;\n }\n return { x: output[0], y: output[1] };\n }\n\n /**\n * clamp\n *\n * Clamps the components of a vector to limits to produce a new vector\n */\n static clamp(v: Vector2, limits?: { min?: Partial<Vector2>; max?: Partial<Vector2> }): Vector2 {\n return {\n x: clampNumber(v.x, limits?.min?.x ?? Number.MIN_SAFE_INTEGER, limits?.max?.x ?? Number.MAX_SAFE_INTEGER),\n y: clampNumber(v.y, limits?.min?.y ?? Number.MIN_SAFE_INTEGER, limits?.max?.y ?? Number.MAX_SAFE_INTEGER),\n };\n }\n\n /**\n * lerp\n *\n * Constructs a new vector using linear interpolation on each component from two vectors.\n */\n static lerp(a: Vector2, b: Vector2, t: number): Vector2 {\n return { x: a.x + (b.x - a.x) * t, y: a.y + (b.y - a.y) * t };\n }\n\n /**\n * slerp\n *\n * Constructs a new vector using spherical linear interpolation on each component from two vectors.\n */\n static slerp(a: Vector2, b: Vector2, t: number): Vector2 {\n const theta = Math.acos(Vector2Utils.dot(a, b));\n const sinTheta = Math.sin(theta);\n const ta = Math.sin((1.0 - t) * theta) / sinTheta;\n const tb = Math.sin(t * theta) / sinTheta;\n return Vector2Utils.add(Vector2Utils.scale(a, ta), Vector2Utils.scale(b, tb));\n }\n\n /**\n * multiply\n *\n * Element-wise multiplication of two vectors together.\n * Not to be confused with {@link Vector2Utils.dot} product\n */\n static multiply(a: Vector2, b: Vector2): Vector2 {\n return { x: a.x * b.x, y: a.y * b.y };\n }\n}\n\n/**\n * Utilities operating on VectorXZ objects. All methods are static and do not modify the input objects.\n *\n * @public\n */\nexport class VectorXZUtils {\n /**\n * equals\n *\n * Check the equality of two vectors\n */\n static equals(v1: VectorXZ, v2: VectorXZ): boolean {\n return v1.x === v2.x && v1.z === v2.z;\n }\n\n /**\n * add\n *\n * Add two vectors to produce a new vector\n */\n static add(v1: VectorXZ, v2: Partial<VectorXZ>): VectorXZ {\n return { x: v1.x + (v2.x ?? 0), z: v1.z + (v2.z ?? 0) };\n }\n\n /**\n * subtract\n *\n * Subtract two vectors to produce a new vector (v1-v2)\n */\n static subtract(v1: VectorXZ, v2: Partial<VectorXZ>): VectorXZ {\n return { x: v1.x - (v2.x ?? 0), z: v1.z - (v2.z ?? 0) };\n }\n\n /** scale\n *\n * Multiple all entries in a vector by a single scalar value producing a new vector\n */\n static scale(v1: VectorXZ, scale: number): VectorXZ {\n return { x: v1.x * scale, z: v1.z * scale };\n }\n\n /**\n * dot\n *\n * Calculate the dot product of two vectors\n */\n static dot(a: VectorXZ, b: VectorXZ): number {\n return a.x * b.x + a.z * b.z;\n }\n\n /**\n * magnitude\n *\n * The magnitude of a vector\n */\n static magnitude(v: VectorXZ): number {\n return Math.sqrt(v.x ** 2 + v.z ** 2);\n }\n\n /**\n * distance\n *\n * Calculate the distance between two vectors\n */\n static distance(a: VectorXZ, b: VectorXZ): number {\n return VectorXZUtils.magnitude(VectorXZUtils.subtract(a, b));\n }\n\n /**\n * normalize\n *\n * Takes a vector 3 and normalizes it to a unit vector\n */\n static normalize(v: VectorXZ): VectorXZ {\n const mag = VectorXZUtils.magnitude(v);\n return { x: v.x / mag, z: v.z / mag };\n }\n\n /**\n * floor\n *\n * Floor the components of a vector to produce a new vector\n */\n static floor(v: VectorXZ): VectorXZ {\n return { x: Math.floor(v.x), z: Math.floor(v.z) };\n }\n\n /**\n * toString\n *\n * Create a string representation of a vectorxz\n */\n static toString(v: VectorXZ, options?: { decimals?: number; delimiter?: string }): string {\n const decimals = options?.decimals ?? 2;\n const str: string[] = [v.x.toFixed(decimals), v.z.toFixed(decimals)];\n return str.join(options?.delimiter ?? ', ');\n }\n\n /**\n * fromString\n *\n * Gets a VectorXZ from the string representation produced by {@link VectorXZUtils.toString}. If any numeric value is not a number\n * or the format is invalid, undefined is returned.\n * @param str - The string to parse\n * @param delimiter - The delimiter used to separate the components. Defaults to the same as the default for {@link VectorXZUtils.toString}\n */\n static fromString(str: string, delimiter: string = ','): VectorXZ | undefined {\n const parts = str.split(delimiter);\n if (parts.length !== 2) {\n return undefined;\n }\n\n const output = parts.map(part => parseFloat(part));\n if (output.some(part => isNaN(part))) {\n return undefined;\n }\n return { x: output[0], z: output[1] };\n }\n\n /**\n * clamp\n *\n * Clamps the components of a vector to limits to produce a new vector\n */\n static clamp(v: VectorXZ, limits?: { min?: Partial<VectorXZ>; max?: Partial<VectorXZ> }): VectorXZ {\n return {\n x: clampNumber(v.x, limits?.min?.x ?? Number.MIN_SAFE_INTEGER, limits?.max?.x ?? Number.MAX_SAFE_INTEGER),\n z: clampNumber(v.z, limits?.min?.z ?? Number.MIN_SAFE_INTEGER, limits?.max?.z ?? Number.MAX_SAFE_INTEGER),\n };\n }\n\n /**\n * lerp\n *\n * Constructs a new vector using linear interpolation on each component from two vectors.\n */\n static lerp(a: VectorXZ, b: VectorXZ, t: number): VectorXZ {\n return { x: a.x + (b.x - a.x) * t, z: a.z + (b.z - a.z) * t };\n }\n\n /**\n * slerp\n *\n * Constructs a new vector using spherical linear interpolation on each component from two vectors.\n */\n static slerp(a: VectorXZ, b: VectorXZ, t: number): VectorXZ {\n const theta = Math.acos(VectorXZUtils.dot(a, b));\n const sinTheta = Math.sin(theta);\n const ta = Math.sin((1.0 - t) * theta) / sinTheta;\n const tb = Math.sin(t * theta) / sinTheta;\n return VectorXZUtils.add(VectorXZUtils.scale(a, ta), VectorXZUtils.scale(b, tb));\n }\n\n /**\n * multiply\n *\n * Element-wise multiplication of two vectors together.\n * Not to be confused with {@link VectorXZUtils.dot} product\n */\n static multiply(a: VectorXZ, b: VectorXZ): VectorXZ {\n return { x: a.x * b.x, z: a.z * b.z };\n }\n}\n\n/**\n * up\n *\n * A unit vector representing the world UP direction (0,1,0)\n *\n * @public\n */\nexport const VECTOR3_UP: Vector3 = { x: 0, y: 1, z: 0 };\n/**\n * down\n *\n * A unit vector representing the world DOWN direction (0,-1,0)\n *\n * @public\n */\nexport const VECTOR3_DOWN: Vector3 = { x: 0, y: -1, z: 0 };\n/**\n * left\n *\n * A unit vector representing the world LEFT direction (-1,0,0)\n *\n * @public\n */\nexport const VECTOR3_LEFT: Vector3 = { x: -1, y: 0, z: 0 };\n/**\n * right\n *\n * A unit vector representing the world RIGHT direction (1,0,0)\n *\n * @public\n */\nexport const VECTOR3_RIGHT: Vector3 = { x: 1, y: 0, z: 0 };\n/**\n * forward\n *\n * A unit vector representing the world FORWARD direction (0,0,1)\n *\n * @public\n */\nexport const VECTOR3_FORWARD: Vector3 = { x: 0, y: 0, z: 1 };\n/**\n * back\n *\n * A unit vector representing the world BACK direction (0,0,-1)\n *\n * @public\n */\nexport const VECTOR3_BACK: Vector3 = { x: 0, y: 0, z: -1 };\n/**\n * one\n *\n * A unit vector representing the value of 1 in all directions (1,1,1)\n *\n * @public\n */\nexport const VECTOR3_ONE: Vector3 = { x: 1, y: 1, z: 1 };\n/**\n * zero\n *\n * A unit vector representing the value of 0 in all directions (0,0,0)\n *\n * @public\n */\nexport const VECTOR3_ZERO: Vector3 = { x: 0, y: 0, z: 0 };\n/**\n * west\n *\n * A unit vector representing the world WEST direction (-1,0,0)\n * (same as LEFT)\n *\n * @public\n */\nexport const VECTOR3_WEST: Vector3 = { x: -1, y: 0, z: 0 };\n/**\n * east\n *\n * A unit vector representing the world EAST direction (-1,0,0)\n * (same as RIGHT)\n *\n * @public\n */\nexport const VECTOR3_EAST: Vector3 = { x: 1, y: 0, z: 0 };\n/**\n * north\n *\n * A unit vector representing the world NORTH direction (-1,0,0)\n * (same as FORWARD)\n *\n * @public\n */\nexport const VECTOR3_NORTH: Vector3 = { x: 0, y: 0, z: 1 };\n/**\n * south\n *\n * A unit vector representing the world SOUTH direction (-1,0,0)\n * (same as BACK)\n *\n * @public\n */\nexport const VECTOR3_SOUTH: Vector3 = { x: 0, y: 0, z: -1 };\n/**\n * half\n *\n * A unit vector representing the value of 0.5 in all directions (0.5,0.5,0.5)\n *\n * @public\n */\nexport const VECTOR3_HALF: Vector3 = { x: 0.5, y: 0.5, z: 0.5 };\n/**\n * negative\n *\n * A unit vector representing the value of -1 in all directions (-1,-1,-1)\n *\n * @public\n */\nexport const VECTOR3_NEGATIVE_ONE: Vector3 = { x: -1, y: -1, z: -1 };\n/**\n * zero\n *\n * A vector representing the value of 0 in all directions (0,0)\n *\n * @public\n */\nexport const VECTOR2_ZERO: Vector2 = { x: 0, y: 0 };\n/**\n * zero\n *\n * A vector representing the value of 0 in all directions (0,0)\n *\n * @public\n */\nexport const VECTORXZ_ZERO: VectorXZ = { x: 0, z: 0 };\n", "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { Vector2, Vector3, VectorXZ } from '@minecraft/server';\nimport { Vector2Utils, Vector3Utils, VectorXZUtils } from './coreHelpers.js';\n\n/**\n * Vector3 wrapper class which can be used as a Vector3 for APIs on \\@minecraft/server which require a Vector,\n * but also contain additional helper methods. This is an alternative to using the core Vector 3 utility\n * methods directly, for those who prefer a more object-oriented approach. This version of the class is mutable\n * and changes state inline.\n *\n * For an immutable version of the build, use ImmutableVector3Builder.\n *\n * @public\n */\nexport class Vector3Builder implements Vector3 {\n x: number;\n y: number;\n z: number;\n\n constructor(vecStr: string, delim?: string, arg2?: never);\n constructor(vec: Vector3, arg?: never, arg2?: never);\n constructor(x: number, y: number, z: number);\n constructor(first: number | Vector3 | string, second?: number | string, z?: number) {\n if (typeof first === 'object') {\n this.x = first.x;\n this.y = first.y;\n this.z = first.z;\n } else if (typeof first === 'string') {\n const parsed = Vector3Utils.fromString(first, (second as string | undefined) ?? ',');\n if (!parsed) {\n this.x = 0;\n this.y = 0;\n this.z = 0;\n\n return;\n }\n this.x = parsed.x;\n this.y = parsed.y;\n this.z = parsed.z;\n } else {\n this.x = first;\n this.y = (second as number) ?? 0;\n this.z = z ?? 0;\n }\n }\n\n /**\n * Assigns the values of the passed in vector to this vector. Returns itself.\n */\n assign(vec: Vector3): this {\n this.x = vec.x;\n this.y = vec.y;\n this.z = vec.z;\n return this;\n }\n\n /**\n * equals\n *\n * Check the equality of two vectors\n */\n equals(v: Vector3): boolean {\n return Vector3Utils.equals(this, v);\n }\n\n /**\n * add\n *\n * Adds the vector v to this, returning itself.\n */\n add(v: Partial<Vector3>): this {\n return this.assign(Vector3Utils.add(this, v));\n }\n\n /**\n * subtract\n *\n * Subtracts the vector v from this, returning itself.\n */\n subtract(v: Partial<Vector3>): this {\n return this.assign(Vector3Utils.subtract(this, v));\n }\n\n /** scale\n *\n * Scales this by the passed in value, returning itself.\n */\n scale(val: number): this {\n return this.assign(Vector3Utils.scale(this, val));\n }\n\n /**\n * dot\n *\n * Computes the dot product of this and the passed in vector.\n */\n dot(vec: Vector3): number {\n return Vector3Utils.dot(this, vec);\n }\n\n /**\n * cross\n *\n * Computes the cross product of this and the passed in vector, returning itself.\n */\n cross(vec: Vector3): this {\n return this.assign(Vector3Utils.cross(this, vec));\n }\n\n /**\n * magnitude\n *\n * The magnitude of the vector\n */\n magnitude(): number {\n return Vector3Utils.magnitude(this);\n }\n\n /**\n * distance\n *\n * Calculate the distance between two vectors\n */\n distance(vec: Vector3): number {\n return Vector3Utils.distance(this, vec);\n }\n\n /**\n * normalize\n *\n * Normalizes this vector, returning itself.\n */\n normalize(): this {\n return this.assign(Vector3Utils.normalize(this));\n }\n\n /**\n * floor\n *\n * Floor the components of a vector to produce a new vector\n */\n floor(): this {\n return this.assign(Vector3Utils.floor(this));\n }\n\n /**\n * ceil\n *\n * Ceil the components of a vector to produce a new vector\n */\n ceil(): this {\n return this.assign(Vector3Utils.ceil(this));\n }\n\n /**\n * min\n *\n * Min the components of two vectors to produce a new vector\n */\n min(vec: Vector3): this {\n return this.assign(Vector3Utils.min(this, vec));\n }\n\n /**\n * max\n *\n * Max the components of two vectors to produce a new vector\n */\n max(vec: Vector3): this {\n return this.assign(Vector3Utils.max(this, vec));\n }\n\n /**\n * toString\n *\n * Create a string representation of a vector\n */\n toString(options?: { decimals?: number; delimiter?: string }): string {\n return Vector3Utils.toString(this, options);\n }\n\n /**\n * clamp\n *\n * Clamps the components of a vector to limits to produce a new vector\n */\n clamp(limits: { min?: Partial<Vector3>; max?: Partial<Vector3> }): this {\n return this.assign(Vector3Utils.clamp(this, limits));\n }\n\n /**\n * lerp\n *\n * Constructs a new vector using linear interpolation on each component from two vectors.\n */\n lerp(vec: Vector3, t: number): this {\n return this.assign(Vector3Utils.lerp(this, vec, t));\n }\n\n /**\n * slerp\n *\n * Constructs a new vector using spherical linear interpolation on each component from two vectors.\n */\n slerp(vec: Vector3, t: number): this {\n return this.assign(Vector3Utils.slerp(this, vec, t));\n }\n\n /**\n * multiply\n *\n * Element-wise multiplication of two vectors together.\n * Not to be confused with {@link Vector3Builder.dot} product or {@link Vector3Builder.cross} product\n */\n multiply(vec: Vector3): this {\n return this.assign(Vector3Utils.multiply(this, vec));\n }\n\n /**\n * rotateX\n *\n * Rotates the vector around the x axis counterclockwise (left hand rule)\n * @param a - Angle in radians\n */\n rotateX(a: number): this {\n return this.assign(Vector3Utils.rotateX(this, a));\n }\n\n /**\n * rotateY\n *\n * Rotates the vector around the y axis counterclockwise (left hand rule)\n * @param a - Angle in radians\n */\n rotateY(a: number): this {\n return this.assign(Vector3Utils.rotateY(this, a));\n }\n\n /**\n * rotateZ\n *\n * Rotates the vector around the z axis counterclockwise (left hand rule)\n * @param a - Angle in radians\n */\n rotateZ(a: number): this {\n return this.assign(Vector3Utils.rotateZ(this, a));\n }\n}\n\n/**\n * Vector2 wrapper class which can be used as a Vector2 for APIs on \\@minecraft/server which require a Vector2.\n * @public\n */\nexport class Vector2Builder implements Vector2 {\n x: number;\n y: number;\n\n constructor(vecStr: string, delim?: string);\n constructor(vec: Vector2, arg?: never);\n constructor(x: number, y: number);\n constructor(first: number | Vector2 | string, second?: number | string) {\n if (typeof first === 'object') {\n this.x = first.x;\n this.y = first.y;\n } else if (typeof first === 'string') {\n const parsed = Vector2Utils.fromString(first, (second as string | undefined) ?? ',');\n if (!parsed) {\n this.x = 0;\n this.y = 0;\n\n return;\n }\n\n this.x = parsed.x;\n this.y = parsed.y;\n } else {\n this.x = first;\n this.y = (second as number) ?? 0;\n }\n }\n\n toString(options?: { decimals?: number; delimiter?: string }): string {\n return Vector2Utils.toString(this, options);\n }\n\n /**\n * Assigns the values of the passed in vector to this vector. Returns itself.\n */\n assign(vec: Vector2): this {\n this.x = vec.x;\n this.y = vec.y;\n return this;\n }\n\n /**\n * equals\n *\n * Check the equality of two vectors\n */\n equals(v: Vector2): boolean {\n return Vector2Utils.equals(this, v);\n }\n\n /**\n * add\n *\n * Adds the vector v to this, returning itself.\n */\n add(v: Partial<Vector2>): this {\n return this.assign(Vector2Utils.add(this, v));\n }\n\n /**\n * subtract\n *\n * Subtracts the vector v from this, returning itself.\n */\n subtract(v: Partial<Vector2>): this {\n return this.assign(Vector2Utils.subtract(this, v));\n }\n\n /** scale\n *\n * Scales this by the passed in value, returning itself.\n */\n scale(val: number): this {\n return this.assign(Vector2Utils.scale(this, val));\n }\n\n /**\n * dot\n *\n * Computes the dot product of this and the passed in vector.\n */\n dot(vec: Vector2): number {\n return Vector2Utils.dot(this, vec);\n }\n\n /**\n * magnitude\n *\n * The magnitude of the vector\n */\n magnitude(): number {\n return Vector2Utils.magnitude(this);\n }\n\n /**\n * distance\n *\n * Calculate the distance between two vectors\n */\n distance(vec: Vector2): number {\n return Vector2Utils.distance(this, vec);\n }\n\n /**\n * normalize\n *\n * Normalizes this vector, returning itself.\n */\n normalize(): this {\n return this.assign(Vector2Utils.normalize(this));\n }\n\n /**\n * floor\n *\n * Floor the components of a vector to produce a new vector\n */\n floor(): this {\n return this.assign(Vector2Utils.floor(this));\n }\n\n /**\n * clamp\n *\n * Clamps the components of a vector to limits to produce a new vector\n */\n clamp(limits: { min?: Partial<Vector2>; max?: Partial<Vector2> }): this {\n return this.assign(Vector2Utils.clamp(this, limits));\n }\n\n /**\n * lerp\n *\n * Constructs a new vector using linear interpolation on each component from two vectors.\n */\n lerp(vec: Vector2, t: number): this {\n return this.assign(Vector2Utils.lerp(this, vec, t));\n }\n\n /**\n * slerp\n *\n * Constructs a new vector using spherical linear interpolation on each component from two vectors.\n */\n slerp(vec: Vector2, t: number): this {\n return this.assign(Vector2Utils.slerp(this, vec, t));\n }\n\n /**\n * multiply\n *\n * Element-wise multiplication of two vectors together.\n * Not to be confused with {@link Vector2Builder.dot} product\n */\n multiply(vec: Vector2): this {\n return this.assign(Vector2Utils.multiply(this, vec));\n }\n}\n\n/**\n * VectorXZ wrapper class which can be used as a VectorXZ for APIs on \\@minecraft/server which require a VectorXZ.\n * @public\n */\nexport class VectorXZBuilder implements VectorXZ {\n x: number;\n z: number;\n\n constructor(vecStr: string, delim?: string);\n constructor(vec: VectorXZ, arg?: never);\n constructor(x: number, y: number);\n constructor(first: number | VectorXZ | string, second?: number | string) {\n if (typeof first === 'object') {\n this.x = first.x;\n this.z = first.z;\n } else if (typeof first === 'string') {\n const parsed = VectorXZUtils.fromString(first, (second as string | undefined) ?? ',');\n if (!parsed) {\n this.x = 0;\n this.z = 0;\n\n return;\n }\n\n this.x = parsed.x;\n this.z = parsed.z;\n } else {\n this.x = first;\n this.z = (second as number) ?? 0;\n }\n }\n\n toString(options?: { decimals?: number; delimiter?: string }): string {\n return VectorXZUtils.toString(this, options);\n }\n\n /**\n * Assigns the values of the passed in vector to this vector. Returns itself.\n */\n assign(vec: VectorXZ): this {\n this.x = vec.x;\n this.z = vec.z;\n return this;\n }\n\n /**\n * equals\n *\n * Check the equality of two vectors\n */\n equals(v: VectorXZ): boolean {\n return VectorXZUtils.equals(this, v);\n }\n\n /**\n * add\n *\n * Adds the vector v to this, returning itself.\n */\n add(v: Partial<VectorXZ>): this {\n return this.assign(VectorXZUtils.add(this, v));\n }\n\n /**\n * subtract\n *\n * Subtracts the vector v from this, returning itself.\n */\n subtract(v: Partial<VectorXZ>): this {\n return this.assign(VectorXZUtils.subtract(this, v));\n }\n\n /** scale\n *\n * Scales this by the passed in value, returning itself.\n */\n scale(val: number): this {\n return this.assign(VectorXZUtils.scale(this, val));\n }\n\n /**\n * dot\n *\n * Computes the dot product of this and the passed in vector.\n */\n dot(vec: VectorXZ): number {\n return VectorXZUtils.dot(this, vec);\n }\n\n /**\n * magnitude\n *\n * The magnitude of the vector\n */\n magnitude(): number {\n return VectorXZUtils.magnitude(this);\n }\n\n /**\n * distance\n *\n * Calculate the distance between two vectors\n */\n distance(vec: VectorXZ): number {\n return VectorXZUtils.distance(this, vec);\n }\n\n /**\n * normalize\n *\n * Normalizes this vector, returning itself.\n */\n normalize(): this {\n return this.assign(VectorXZUtils.normalize(this));\n }\n\n /**\n * floor\n *\n * Floor the components of a vector to produce a new vector\n */\n floor(): this {\n return this.assign(VectorXZUtils.floor(this));\n }\n\n /**\n * clamp\n *\n * Clamps the components of a vector to limits to produce a new vector\n */\n clamp(limits: { min?: Partial<VectorXZ>; max?: Partial<VectorXZ> }): this {\n return this.assign(VectorXZUtils.clamp(this, limits));\n }\n\n /**\n * lerp\n *\n * Constructs a new vector using linear interpolation on each component from two vectors.\n */\n lerp(vec: VectorXZ, t: number): this {\n return this.assign(VectorXZUtils.lerp(this, vec, t));\n }\n\n /**\n * slerp\n *\n * Constructs a new vector using spherical linear interpolation on each component from two vectors.\n */\n slerp(vec: VectorXZ, t: number): this {\n return this.assign(VectorXZUtils.slerp(this, vec, t));\n }\n\n /**\n * multiply\n *\n * Element-wise multiplication of two vectors together.\n * Not to be confused with {@link VectorXZBuilder.dot} product\n */\n multiply(vec: VectorXZ): this {\n return this.assign(VectorXZUtils.multiply(this, vec));\n }\n}\n", "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AABB, Vector3 } from '@minecraft/server';\nimport { BlockVolume } from '@minecraft/server';\nimport { Vector3Utils } from '../vector3/coreHelpers.js';\n\n/**\n * An error that is thrown when using an invalid AABB with AABBUtils operations.\n *\n * @public\n */\nexport class AABBInvalidExtentError extends Error {\n constructor(extent: Vector3) {\n super(`Invalid AABB extent of '${Vector3Utils.toString(extent)}'`);\n }\n}\n\n/**\n * Utilities operating on AABB objects. All methods are static and do not modify the input objects.\n *\n * @public\n */\nexport class AABBUtils {\n private constructor() {}\n\n /**\n * EPSILON\n *\n * The internal epsilon value that determines validity and used for block volume tolerance.\n */\n static EPSILON = 0.00001;\n\n /**\n * createFromCornerPoints\n *\n * Gets an AABB from points defining it's corners, the order doesn't matter.\n * @param pointA - The first corner point.\n * @param pointB - The second corner point.\n * @throws {@link AABBInvalidExtentError}\n * This exception is thrown if the resulting AABB is invalid.\n *\n * @returns - The resulting AABB.\n */\n static createFromCornerPoints(pointA: Vector3, pointB: Vector3): AABB {\n const min = Vector3Utils.min(pointA, pointB);\n const max = Vector3Utils.max(pointA, pointB);\n\n const extent = Vector3Utils.multiply(Vector3Utils.subtract(max, min), { x: 0.5, y: 0.5, z: 0.5 });\n const aabb: AABB = { center: Vector3Utils.add(min, extent), extent: extent };\n AABBUtils.throwErrorIfInvalid(aabb);\n return aabb;\n }\n\n /**\n * isValid\n *\n * Determines if the AABB has non-zero extent on all axes.\n * @param aabb - The AABB to test for validity.\n * @returns - True if all extent axes are non-zero, otherwise false.\n */\n static isValid(aabb: AABB): boolean {\n return (\n aabb.extent.x >= AABBUtils.EPSILON &&\n aabb.extent.y >= AABBUtils.EPSILON &&\n aabb.extent.z >= AABBUtils.EPSILON\n );\n }\n\n /**\n * throwErrorIfInvalid\n *\n * Throws an error if the AABB is invalid.\n * @param aabb - The AABB to test for validity.\n * @throws {@link AABBInvalidExtentError}\n * This exception is thrown if the input AABB is invalid.\n */\n static throwErrorIfInvalid(aabb: AABB): void {\n if (!AABBUtils.isValid(aabb)) {\n throw new AABBInvalidExtentError(aabb.extent);\n }\n }\n\n /**\n * equals\n *\n * Compares the equality of two AABBs.\n * @param aabb - The first AABB in the comparison.\n * @param other - The second AABB in the comparison.\n * @throws {@link AABBInvalidExtentError}\n * This exception is thrown if either of the input AABBs are invalid.\n *\n * @returns - True if the center and extent of both AABBs are equal.\n */\n static equals(aabb: AABB, other: AABB): boolean {\n AABBUtils.throwErrorIfInvalid(aabb);\n AABBUtils.throwErrorIfInvalid(other);\n\n return Vector3Utils.equals(aabb.center, other.center) && Vector3Utils.equals(aabb.extent, other.extent);\n }\n\n /**\n * getMin\n *\n * Gets the minimum corner of an AABB.\n * @param aabb - The AABB to retrieve the minimum corner of.\n * @throws {@link AABBInvalidExtentError}\n * This exception is thrown if the input AABB is invalid.\n *\n * @returns - The minimum corner of the AABB.\n */\n static getMin(aabb: AABB): Vector3 {\n AABBUtils.throwErrorIfInvalid(aabb);\n\n return Vector3Utils.subtract(aabb.center, aabb.extent);\n }\n\n /**\n * getMax\n *\n * Gets the maximum corner of an AABB.\n * @param aabb - The AABB to retrieve the maximum corner of.\n * @throws {@link AABBInvalidExtentError}\n * This exception is thrown if the input AABB is invalid.\n *\n * @returns - The maximum corner of the AABB.\n */\n static getMax(aabb: AABB): Vector3 {\n AABBUtils.throwErrorIfInvalid(aabb);\n\n return Vector3Utils.add(aabb.center, aabb.extent);\n }\n\n /**\n * getSpan\n *\n * Gets the span of an AABB.\n * @param aabb - The AABB to retrieve the span of.\n * @throws {@link AABBInvalidExtentError}\n * This exception is thrown if the input AABB is invalid.\n *\n * @returns - The span of the AABB.\n */\n static getSpan(aabb: AABB): Vector3 {\n AABBUtils.throwErrorIfInvalid(aabb);\n\n return Vector3Utils.multiply(aabb.extent, { x: 2.0, y: 2.0, z: 2.0 });\n }\n\n /**\n * getBlockVolume\n *\n * Creates the smallest BlockVolume that includes all of a source AABB.\n * @param aabb - The source AABB.\n * @throws {@link AABBInvalidExtentError}\n * This exception is thrown if the input AABB is invalid.\n *\n * @returns - The BlockVolume containing the source AABB.\n */\n static getBlockVolume(aabb: AABB): BlockVolume {\n AABBUtils.throwErrorIfInvalid(aabb);\n\n const epsilon = AABBUtils.EPSILON;\n const epsilonVec: Vector3 = { x: epsilon, y: epsilon, z: epsilon };\n const from = Vector3Utils.floor(Vector3Utils.add(AABBUtils.getMin(aabb), epsilonVec));\n const to = Vector3Utils.ceil(Vector3Utils.subtract(AABBUtils.getMax(aabb), epsilonVec));\n return new BlockVolume(from, to);\n }\n\n /**\n * translate\n *\n * Creates a translated AABB given a source AABB and translation vector.\n * @param aabb - The source AABB.\n * @param delta - The translation vector to add to the AABBs center.\n * @throws {@link AABBInvalidExtentError}\n * This exception is thrown if the input AABB is invalid.\n *\n * @returns - The resulting translated AABB.\n */\n static translate(aabb: AABB, delta: Vector3): AABB {\n AABBUtils.throwErrorIfInvalid(aabb);\n\n return { center: Vector3Utils.add(aabb.center, delta), extent: aabb.extent };\n }\n\n /**\n * dilate\n *\n * Creates a dilated AABB given a source AABB and dilation vector.\n * @param aabb - The source AABB.\n * @param size - The dilation vector to add to the AABBs extent.\n * @throws {@link AABBInvalidExtentError}\n * This exception is thrown if the input AABB is invalid.\n *\n * @returns - The resulting dilated AABB.\n */\n static dilate(aabb: AABB, size: Vector3): AABB {\n AABBUtils.throwErrorIfInvalid(aabb);\n\n const epsilon = AABBUtils.EPSILON;\n const epsilonVec: Vector3 = { x: epsilon, y: epsilon, z: epsilon };\n let dilatedExtent = Vector3Utils.add(aabb.extent, size);\n dilatedExtent = Vector3Utils.clamp(dilatedExtent, { min: epsilonVec });\n return { center: aabb.center, extent: dilatedExtent };\n }\n\n /**\n * expand\n *\n * Creates an expanded AABB given two source AABBs.\n * @param aabb - The first source AABB.\n * @param other - The second source AABB.\n * @throws {@link AABBInvalidExtentError}\n * This exception is thrown if either of the input AABBs are invalid.\n *\n * @returns - The resulting expanded AABB.\n */\n static expand(aabb: AABB, other: AABB): AABB {\n AABBUtils.throwErrorIfInvalid(aabb);\n AABBUtils.throwErrorIfInvalid(other);\n\n const aabbMin = AABBUtils.getMin(aabb);\n const otherMin = AABBUtils.getMin(other);\n const min = Vector3Utils.min(aabbMin, otherMin);\n const aabbMax = AABBUtils.getMax(aabb);\n const otherMax = AABBUtils.getMax(other);\n const max = Vector3Utils.max(aabbMax, otherMax);\n return AABBUtils.createFromCornerPoints(min, max);\n }\n\n /**\n * getIntersection\n *\n * Creates an AABB of the intersecting area of two source AABBs.\n * @param aabb - The first source AABB.\n * @param other - The second source AABB.\n * @throws {@link AABBInvalidExtentError}\n * This exception is thrown if either of the input AABBs are invalid.\n *\n * @returns - The resulting intersecting AABB if they intersect, otherwise returns undefined.\n */\n static getIntersection(aabb: AABB, other: AABB): AABB | undefined {\n AABBUtils.throwErrorIfInvalid(aabb);\n AABBUtils.throwErrorIfInvalid(other);\n\n if (!AABBUtils.intersects(aabb, other)) {\n return undefined;\n }\n\n const aabbMin = AABBUtils.getMin(aabb);\n const otherMin = AABBUtils.getMin(other);\n const min = Vector3Utils.max(aabbMin, otherMin);\n const aabbMax = AABBUtils.getMax(aabb);\n const otherMax = AABBUtils.getMax(other);\n const max = Vector3Utils.min(aabbMax, otherMax);\n return AABBUtils.createFromCornerPoints(min, max);\n }\n\n /**\n * intersects\n *\n * Calculates if two AABBs are intersecting.\n * @param aabb - The first AABB.\n * @param other - The second AABB.\n * @throws {@link AABBInvalidExtentError}\n * This exception is thrown if either of the input AABBs are invalid.\n *\n * @returns - True if the AABBs are intersecting, otherwise false.\n */\n static intersects(aabb: AABB, other: AABB): boolean {\n AABBUtils.throwErrorIfInvalid(aabb);\n AABBUtils.throwErrorIfInvalid(other);\n\n const aabbMin = AABBUtils.getMin(aabb);\n const aabbMax = AABBUtils.getMax(aabb);\n const otherMin = AABBUtils.getMin(other);\n const otherMax = AABBUtils.getMax(other);\n\n if (otherMax.x < aabbMin.x || otherMin.x > aabbMax.x) {\n return false;\n }\n if (otherMax.y < aabbMin.y || otherMin.y > aabbMax.y) {\n return false;\n }\n if (otherMax.z < aabbMin.z || otherMin.z > aabbMax.z) {\n return false;\n }\n return true;\n }\n\n /**\n * isInside\n *\n * Calculates if a position is inside of an AABB.\n * @param aabb - The AABB to test against.\n * @param pos - The position to test.\n * @throws {@link AABBInvalidExtentError}\n * This exception is thrown if the input AABB is invalid.\n *\n * @returns True if the position is inside of the AABB, otherwise returns false.\n */\n static isInside(aabb: AABB, pos: Vector3): boolean {\n AABBUtils.throwErrorIfInvalid(aabb);\n\n const min = AABBUtils.getMin(aabb);\n if (pos.x < min.x || pos.y < min.y || pos.z < min.z) {\n return false;\n }\n\n const max = AABBUtils.getMax(aabb);\n if (pos.x > max.x || pos.y > max.y || pos.z > max.z) {\n return false;\n }\n\n return true;\n }\n}\n"],
5
+ "mappings": ";AAQM,SAAU,YAAY,KAAa,KAAa,KAAW;AAC7D,SAAO,KAAK,IAAI,KAAK,IAAI,KAAK,GAAG,GAAG,GAAG;AAC3C;;;ACCM,IAAO,eAAP,MAAO,cAAY;;;;;;EAMrB,OAAO,OAAO,IAAa,IAAW;AAClC,WAAO,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG;EACzD;;;;;;EAOA,OAAO,IAAI,IAAa,IAAoB;AACxC,WAAO,EAAE,GAAG,GAAG,KAAK,GAAG,KAAK,IAAI,GAAG,GAAG,KAAK,GAAG,KAAK,IAAI,GAAG,GAAG,KAAK,GAAG,KAAK,GAAE;EAChF;;;;;;EAOA,OAAO,SAAS,IAAa,IAAoB;AAC7C,WAAO,EAAE,GAAG,GAAG,KAAK,GAAG,KAAK,IAAI,GAAG,GAAG,KAAK,GAAG,KAAK,IAAI,GAAG,GAAG,KAAK,GAAG,KAAK,GAAE;EAChF;;;;;EAMA,OAAO,MAAM,IAAa,OAAa;AACnC,WAAO,EAAE,GAAG,GAAG,IAAI,OAAO,GAAG,GAAG,IAAI,OAAO,GAAG,GAAG,IAAI,MAAK;EAC9D;;;;;;EAOA,OAAO,IAAI,GAAY,GAAU;AAC7B,WAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE;EAC3C;;;;;;EAOA,OAAO,MAAM,GAAY,GAAU;AAC/B,WAAO,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAA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Y,KAAY;AACpC,eAAU,oBAAoB,IAAI;AAElC,UAAM,MAAM,WAAU,OAAO,IAAI;AACjC,QAAI,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,GAAG;AACjD,aAAO;IACX;AAEA,UAAM,MAAM,WAAU,OAAO,IAAI;AACjC,QAAI,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,GAAG;AACjD,aAAO;IACX;AAEA,WAAO;EACX;;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,17 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { Vector3Utils } from '../src/vector3/coreHelpers.js';
4
+ export class BlockVolume {
5
+ from;
6
+ to;
7
+ constructor(from, to) {
8
+ this.from = from;
9
+ this.to = to;
10
+ this.from = Vector3Utils.floor(from);
11
+ this.to = Vector3Utils.floor(to);
12
+ }
13
+ }
14
+ export const createMockServerBindings = () => {
15
+ return { BlockVolume };
16
+ };
17
+ //# sourceMappingURL=minecraft-server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"minecraft-server.js","sourceRoot":"","sources":["../../__mocks__/minecraft-server.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,MAAM,OAAO,WAAW;IAET;IACA;IAFX,YACW,IAAa,EACb,EAAW;QADX,SAAI,GAAJ,IAAI,CAAS;QACb,OAAE,GAAF,EAAE,CAAS;QAElB,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACrC,IAAI,CAAC,EAAE,GAAG,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACrC,CAAC;CACJ;AAED,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,EAAE;IACzC,OAAO,EAAE,WAAW,EAAE,CAAC;AAC3B,CAAC,CAAC"}
@@ -0,0 +1,282 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { BlockVolume } from '@minecraft/server';
4
+ import { Vector3Utils } from '../vector3/coreHelpers.js';
5
+ /**
6
+ * An error that is thrown when using an invalid AABB with AABBUtils operations.
7
+ *
8
+ * @public
9
+ */
10
+ export class AABBInvalidExtentError extends Error {
11
+ constructor(extent) {
12
+ super(`Invalid AABB extent of '${Vector3Utils.toString(extent)}'`);
13
+ }
14
+ }
15
+ /**
16
+ * Utilities operating on AABB objects. All methods are static and do not modify the input objects.
17
+ *
18
+ * @public
19
+ */
20
+ export class AABBUtils {
21
+ constructor() { }
22
+ /**
23
+ * EPSILON
24
+ *
25
+ * The internal epsilon value that determines validity and used for block volume tolerance.
26
+ */
27
+ static EPSILON = 0.00001;
28
+ /**
29
+ * createFromCornerPoints
30
+ *
31
+ * Gets an AABB from points defining it's corners, the order doesn't matter.
32
+ * @param pointA - The first corner point.
33
+ * @param pointB - The second corner point.
34
+ * @throws {@link AABBInvalidExtentError}
35
+ * This exception is thrown if the resulting AABB is invalid.
36
+ *
37
+ * @returns - The resulting AABB.
38
+ */
39
+ static createFromCornerPoints(pointA, pointB) {
40
+ const min = Vector3Utils.min(pointA, pointB);
41
+ const max = Vector3Utils.max(pointA, pointB);
42
+ const extent = Vector3Utils.multiply(Vector3Utils.subtract(max, min), { x: 0.5, y: 0.5, z: 0.5 });
43
+ const aabb = { center: Vector3Utils.add(min, extent), extent: extent };
44
+ AABBUtils.throwErrorIfInvalid(aabb);
45
+ return aabb;
46
+ }
47
+ /**
48
+ * isValid
49
+ *
50
+ * Determines if the AABB has non-zero extent on all axes.
51
+ * @param aabb - The AABB to test for validity.
52
+ * @returns - True if all extent axes are non-zero, otherwise false.
53
+ */
54
+ static isValid(aabb) {
55
+ return (aabb.extent.x >= AABBUtils.EPSILON &&
56
+ aabb.extent.y >= AABBUtils.EPSILON &&
57
+ aabb.extent.z >= AABBUtils.EPSILON);
58
+ }
59
+ /**
60
+ * throwErrorIfInvalid
61
+ *
62
+ * Throws an error if the AABB is invalid.
63
+ * @param aabb - The AABB to test for validity.
64
+ * @throws {@link AABBInvalidExtentError}
65
+ * This exception is thrown if the input AABB is invalid.
66
+ */
67
+ static throwErrorIfInvalid(aabb) {
68
+ if (!AABBUtils.isValid(aabb)) {
69
+ throw new AABBInvalidExtentError(aabb.extent);
70
+ }
71
+ }
72
+ /**
73
+ * equals
74
+ *
75
+ * Compares the equality of two AABBs.
76
+ * @param aabb - The first AABB in the comparison.
77
+ * @param other - The second AABB in the comparison.
78
+ * @throws {@link AABBInvalidExtentError}
79
+ * This exception is thrown if either of the input AABBs are invalid.
80
+ *
81
+ * @returns - True if the center and extent of both AABBs are equal.
82
+ */
83
+ static equals(aabb, other) {
84
+ AABBUtils.throwErrorIfInvalid(aabb);
85
+ AABBUtils.throwErrorIfInvalid(other);
86
+ return Vector3Utils.equals(aabb.center, other.center) && Vector3Utils.equals(aabb.extent, other.extent);
87
+ }
88
+ /**
89
+ * getMin
90
+ *
91
+ * Gets the minimum corner of an AABB.
92
+ * @param aabb - The AABB to retrieve the minimum corner of.
93
+ * @throws {@link AABBInvalidExtentError}
94
+ * This exception is thrown if the input AABB is invalid.
95
+ *
96
+ * @returns - The minimum corner of the AABB.
97
+ */
98
+ static getMin(aabb) {
99
+ AABBUtils.throwErrorIfInvalid(aabb);
100
+ return Vector3Utils.subtract(aabb.center, aabb.extent);
101
+ }
102
+ /**
103
+ * getMax
104
+ *
105
+ * Gets the maximum corner of an AABB.
106
+ * @param aabb - The AABB to retrieve the maximum corner of.
107
+ * @throws {@link AABBInvalidExtentError}
108
+ * This exception is thrown if the input AABB is invalid.
109
+ *
110
+ * @returns - The maximum corner of the AABB.
111
+ */
112
+ static getMax(aabb) {
113
+ AABBUtils.throwErrorIfInvalid(aabb);
114
+ return Vector3Utils.add(aabb.center, aabb.extent);
115
+ }
116
+ /**
117
+ * getSpan
118
+ *
119
+ * Gets the span of an AABB.
120
+ * @param aabb - The AABB to retrieve the span of.
121
+ * @throws {@link AABBInvalidExtentError}
122
+ * This exception is thrown if the input AABB is invalid.
123
+ *
124
+ * @returns - The span of the AABB.
125
+ */
126
+ static getSpan(aabb) {
127
+ AABBUtils.throwErrorIfInvalid(aabb);
128
+ return Vector3Utils.multiply(aabb.extent, { x: 2.0, y: 2.0, z: 2.0 });
129
+ }
130
+ /**
131
+ * getBlockVolume
132
+ *
133
+ * Creates the smallest BlockVolume that includes all of a source AABB.
134
+ * @param aabb - The source AABB.
135
+ * @throws {@link AABBInvalidExtentError}
136
+ * This exception is thrown if the input AABB is invalid.
137
+ *
138
+ * @returns - The BlockVolume containing the source AABB.
139
+ */
140
+ static getBlockVolume(aabb) {
141
+ AABBUtils.throwErrorIfInvalid(aabb);
142
+ const epsilon = AABBUtils.EPSILON;
143
+ const epsilonVec = { x: epsilon, y: epsilon, z: epsilon };
144
+ const from = Vector3Utils.floor(Vector3Utils.add(AABBUtils.getMin(aabb), epsilonVec));
145
+ const to = Vector3Utils.ceil(Vector3Utils.subtract(AABBUtils.getMax(aabb), epsilonVec));
146
+ return new BlockVolume(from, to);
147
+ }
148
+ /**
149
+ * translate
150
+ *
151
+ * Creates a translated AABB given a source AABB and translation vector.
152
+ * @param aabb - The source AABB.
153
+ * @param delta - The translation vector to add to the AABBs center.
154
+ * @throws {@link AABBInvalidExtentError}
155
+ * This exception is thrown if the input AABB is invalid.
156
+ *
157
+ * @returns - The resulting translated AABB.
158
+ */
159
+ static translate(aabb, delta) {
160
+ AABBUtils.throwErrorIfInvalid(aabb);
161
+ return { center: Vector3Utils.add(aabb.center, delta), extent: aabb.extent };
162
+ }
163
+ /**
164
+ * dilate
165
+ *
166
+ * Creates a dilated AABB given a source AABB and dilation vector.
167
+ * @param aabb - The source AABB.
168
+ * @param size - The dilation vector to add to the AABBs extent.
169
+ * @throws {@link AABBInvalidExtentError}
170
+ * This exception is thrown if the input AABB is invalid.
171
+ *
172
+ * @returns - The resulting dilated AABB.
173
+ */
174
+ static dilate(aabb, size) {
175
+ AABBUtils.throwErrorIfInvalid(aabb);
176
+ const epsilon = AABBUtils.EPSILON;
177
+ const epsilonVec = { x: epsilon, y: epsilon, z: epsilon };
178
+ let dilatedExtent = Vector3Utils.add(aabb.extent, size);
179
+ dilatedExtent = Vector3Utils.clamp(dilatedExtent, { min: epsilonVec });
180
+ return { center: aabb.center, extent: dilatedExtent };
181
+ }
182
+ /**
183
+ * expand
184
+ *
185
+ * Creates an expanded AABB given two source AABBs.
186
+ * @param aabb - The first source AABB.
187
+ * @param other - The second source AABB.
188
+ * @throws {@link AABBInvalidExtentError}
189
+ * This exception is thrown if either of the input AABBs are invalid.
190
+ *
191
+ * @returns - The resulting expanded AABB.
192
+ */
193
+ static expand(aabb, other) {
194
+ AABBUtils.throwErrorIfInvalid(aabb);
195
+ AABBUtils.throwErrorIfInvalid(other);
196
+ const aabbMin = AABBUtils.getMin(aabb);
197
+ const otherMin = AABBUtils.getMin(other);
198
+ const min = Vector3Utils.min(aabbMin, otherMin);
199
+ const aabbMax = AABBUtils.getMax(aabb);
200
+ const otherMax = AABBUtils.getMax(other);
201
+ const max = Vector3Utils.max(aabbMax, otherMax);
202
+ return AABBUtils.createFromCornerPoints(min, max);
203
+ }
204
+ /**
205
+ * getIntersection
206
+ *
207
+ * Creates an AABB of the intersecting area of two source AABBs.
208
+ * @param aabb - The first source AABB.
209
+ * @param other - The second source AABB.
210
+ * @throws {@link AABBInvalidExtentError}
211
+ * This exception is thrown if either of the input AABBs are invalid.
212
+ *
213
+ * @returns - The resulting intersecting AABB if they intersect, otherwise returns undefined.
214
+ */
215
+ static getIntersection(aabb, other) {
216
+ AABBUtils.throwErrorIfInvalid(aabb);
217
+ AABBUtils.throwErrorIfInvalid(other);
218
+ if (!AABBUtils.intersects(aabb, other)) {
219
+ return undefined;
220
+ }
221
+ const aabbMin = AABBUtils.getMin(aabb);
222
+ const otherMin = AABBUtils.getMin(other);
223
+ const min = Vector3Utils.max(aabbMin, otherMin);
224
+ const aabbMax = AABBUtils.getMax(aabb);
225
+ const otherMax = AABBUtils.getMax(other);
226
+ const max = Vector3Utils.min(aabbMax, otherMax);
227
+ return AABBUtils.createFromCornerPoints(min, max);
228
+ }
229
+ /**
230
+ * intersects
231
+ *
232
+ * Calculates if two AABBs are intersecting.
233
+ * @param aabb - The first AABB.
234
+ * @param other - The second AABB.
235
+ * @throws {@link AABBInvalidExtentError}
236
+ * This exception is thrown if either of the input AABBs are invalid.
237
+ *
238
+ * @returns - True if the AABBs are intersecting, otherwise false.
239
+ */
240
+ static intersects(aabb, other) {
241
+ AABBUtils.throwErrorIfInvalid(aabb);
242
+ AABBUtils.throwErrorIfInvalid(other);
243
+ const aabbMin = AABBUtils.getMin(aabb);
244
+ const aabbMax = AABBUtils.getMax(aabb);
245
+ const otherMin = AABBUtils.getMin(other);
246
+ const otherMax = AABBUtils.getMax(other);
247
+ if (otherMax.x < aabbMin.x || otherMin.x > aabbMax.x) {
248
+ return false;
249
+ }
250
+ if (otherMax.y < aabbMin.y || otherMin.y > aabbMax.y) {
251
+ return false;
252
+ }
253
+ if (otherMax.z < aabbMin.z || otherMin.z > aabbMax.z) {
254
+ return false;
255
+ }
256
+ return true;
257
+ }
258
+ /**
259
+ * isInside
260
+ *
261
+ * Calculates if a position is inside of an AABB.
262
+ * @param aabb - The AABB to test against.
263
+ * @param pos - The position to test.
264
+ * @throws {@link AABBInvalidExtentError}
265
+ * This exception is thrown if the input AABB is invalid.
266
+ *
267
+ * @returns True if the position is inside of the AABB, otherwise returns false.
268
+ */
269
+ static isInside(aabb, pos) {
270
+ AABBUtils.throwErrorIfInvalid(aabb);
271
+ const min = AABBUtils.getMin(aabb);
272
+ if (pos.x < min.x || pos.y < min.y || pos.z < min.z) {
273
+ return false;
274
+ }
275
+ const max = AABBUtils.getMax(aabb);
276
+ if (pos.x > max.x || pos.y > max.y || pos.z > max.z) {
277
+ return false;
278
+ }
279
+ return true;
280
+ }
281
+ }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