main.js.map for 2d raycaster demo

mail@pastecode.io avatar
unknown
json
21 days ago
48 kB
3
Indexable
Never
{
  "version": 3,
  "sources": ["../src/maths/vector.ts", "../src/maths/vector2.ts", "../src/maths/volumes/bounding_volume.ts", "../src/maths/volumes/bounding_box.ts", "../src/maths/physics/aabb.ts", "../src/maths/physics/cast.ts", "../src/maths/physics/raycaster.ts", "../src/maths/mod.ts", "../src/main.ts"],
  "sourcesContent": ["export abstract class AbstractVector {\n\tabstract absolute(): this;\n\tabstract add(v: AbstractVector | number): this;\n\tabstract angle(other?: AbstractVector): number;\n\tabstract aspect(): number;\n\tabstract ceil(): this;\n\tabstract centre(other?: AbstractVector): this;\n\tabstract clamp(min: number, max: number): this;\n\tabstract clone(): this;\n\tabstract copy(other: AbstractVector): this;\n\tabstract cross(other: AbstractVector): number;\n\tabstract direction(other: AbstractVector): this;\n\tabstract distance(other: AbstractVector): number;\n\tabstract distanceSquared(other: AbstractVector): number;\n\tabstract dot(other: AbstractVector): number;\n\tabstract diverge(other: AbstractVector): this;\n\tabstract equals(other: AbstractVector): boolean;\n\tabstract floor(): this;\n\tabstract fromAngle(angle: number): this;\n\tabstract fromArray(elements: number[]): this;\n\tabstract gradient(other: AbstractVector): number;\n\tabstract isFinite(): boolean;\n\tabstract isNaN(): boolean;\n\tabstract isNormalised(): boolean;\n\tabstract isUnit(): boolean;\n\tabstract isZero(): boolean;\n\tabstract length(): number;\n\tabstract lengthSquared(): number;\n\tabstract lerp(other: AbstractVector, alpha: number): this;\n\tabstract max(other: AbstractVector): this;\n\tabstract midpoint(other: AbstractVector): this;\n\tabstract min(other: AbstractVector): this;\n\tabstract multiply(v: AbstractVector | number): this;\n\tabstract negate(): this;\n\tabstract normal(other?: AbstractVector): this;\n\tabstract normalise(): this;\n\tabstract perpendicular(): this;\n\tabstract project(other: AbstractVector): this;\n\tabstract reflect(normal: AbstractVector): this;\n\tabstract reject(other: AbstractVector): this;\n\tabstract remainder(other: AbstractVector): this;\n\tabstract rotate(angle: number): this;\n\tabstract rotateAround(centre: AbstractVector, angle: number): this;\n\tabstract round(): this;\n\tabstract polar(length: number, angle: number, out?: AbstractVector): this;\n\tabstract scale(scalar: number): this;\n\tabstract set(other: AbstractVector | number[]): this;\n\tabstract setScalar(scalar: number): this;\n\tabstract sign(): this;\n\tabstract slerp(other: AbstractVector, alpha: number): this;\n\tabstract subtract(v: AbstractVector): this;\n\tabstract substractScalar(scalar: number): this;\n\tabstract toArray(): number[];\n\tabstract unit(): this;\n\tabstract zero(): this;\n\n\ttoString(): string {\n\t\treturn `${this.constructor.name}(${this.toArray().join(\", \")})`;\n\t}\n}\n", "import { AbstractVector } from \"./vector.ts\";\n\nexport class Vector2 extends AbstractVector {\n\tconstructor(public x = 0, public y = 0) {\n\t\tsuper();\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}\n\n\tstatic get UP(): Readonly<Vector2> {\n\t\treturn new Vector2(0, -1);\n\t}\n\n\tstatic get DOWN(): Readonly<Vector2> {\n\t\treturn new Vector2(0, 1);\n\t}\n\n\tstatic get LEFT(): Readonly<Vector2> {\n\t\treturn new Vector2(-1, 0);\n\t}\n\n\tstatic get RIGHT(): Readonly<Vector2> {\n\t\treturn new Vector2(1, 0);\n\t}\n\n\tstatic get TOP_LEFT(): Readonly<Vector2> {\n\t\treturn new Vector2(-1, 1);\n\t}\n\n\tstatic get TOP_RIGHT(): Readonly<Vector2> {\n\t\treturn new Vector2(1, 1);\n\t}\n\n\tstatic get BOTTOM_LEFT(): Readonly<Vector2> {\n\t\treturn new Vector2(-1, -1);\n\t}\n\n\tstatic get BOTTOM_RIGHT(): Readonly<Vector2> {\n\t\treturn new Vector2(1, -1);\n\t}\n\n\tstatic get ZERO(): Readonly<Vector2> {\n\t\treturn new Vector2(0, 0);\n\t}\n\n\toverride absolute(): this {\n\t\tthis.x = Math.abs(this.x);\n\t\tthis.y = Math.abs(this.y);\n\n\t\treturn this;\n\t}\n\n\toverride add(other: Vector2): this {\n\t\tthis.x += other.x;\n\t\tthis.y += other.y;\n\n\t\treturn this;\n\t}\n\n\toverride addScalar(scalar: number): this {\n\t\tthis.x += scalar;\n\t\tthis.y += scalar;\n\n\t\treturn this;\n\t}\n\n\toverride angle(other?: Vector2): number {\n\t\tif (other === undefined) return Math.atan2(this.y, this.x);\n\n\t\treturn Math.atan2(other.y - this.y, other.x - this.x);\n\t}\n\n\toverride aspect(): number {\n\t\treturn this.x / this.y;\n\t}\n\n\toverride centre(other?: Vector2): this {\n\t\tif (other) {\n\t\t\tthis.x = (this.x + other.x) / 2;\n\t\t\tthis.y = (this.y + other.y) / 2;\n\n\t\t\treturn this;\n\t\t}\n\n\t\tthis.x /= 2;\n\t\tthis.y /= 2;\n\n\t\treturn this;\n\t}\n\n\toverride ceil(): this {\n\t\tthis.x = Math.ceil(this.x);\n\t\tthis.y = Math.ceil(this.y);\n\n\t\treturn this;\n\t}\n\n\toverride clamp(min: number, max: number): this {\n\t\tthis.x = Math.min(Math.max(this.x, min), max);\n\t\tthis.y = Math.min(Math.max(this.y, min), max);\n\n\t\treturn this;\n\t}\n\n\toverride clone(): this {\n\t\treturn new Vector2(this.x, this.y) as this;\n\t}\n\n\toverride copy(other: Vector2): this {\n\t\tthis.x = other.x;\n\t\tthis.y = other.y;\n\n\t\treturn this;\n\t}\n\n\toverride cross(other: Vector2): number {\n\t\treturn (this.x * other.y) - (this.y * other.x);\n\t}\n\n\toverride direction(other: Vector2): this {\n\t\tthis.x = other.x - this.x;\n\t\tthis.y = other.y - this.y;\n\n\t\treturn this;\n\t}\n\n\toverride distance(other: Vector2): number {\n\t\treturn Math.hypot(other.x - this.x, other.y - this.y);\n\t}\n\n\toverride distanceSquared(other: Vector2): number {\n\t\treturn ((other.x - this.x) ** 2) + ((other.y - this.y) ** 2);\n\t}\n\n\toverride diverge(other: Vector2): this {\n\t\tthis.x = other.x - this.x;\n\t\tthis.y = other.y - this.y;\n\n\t\treturn this;\n\t}\n\n\toverride dot(other: Vector2): number {\n\t\treturn (this.x * other.x) + (this.y * other.y);\n\t}\n\n\toverride equals(other: Vector2): boolean {\n\t\treturn (\n\t\t\tthis.x === other.x &&\n\t\t\tthis.y === other.y\n\t\t);\n\t}\n\n\toverride floor(): this {\n\t\tthis.x = Math.floor(this.x);\n\t\tthis.y = Math.floor(this.y);\n\n\t\treturn this;\n\t}\n\n\toverride fromAngle(angle: number): this {\n\t\tthis.x = Math.cos(angle);\n\t\tthis.y = Math.sin(angle);\n\n\t\treturn this;\n\t}\n\n\toverride fromArray(elements: [number, number]): this {\n\t\tthis.x = elements[0];\n\t\tthis.y = elements[1];\n\n\t\treturn this;\n\t}\n\n\toverride gradient(other: Vector2): number {\n\t\treturn (other.y - this.y) / (other.x - this.x);\n\t}\n\n\toverride isFinite(): boolean {\n\t\treturn Number.isFinite(this.x) && Number.isFinite(this.y);\n\t}\n\n\toverride isNaN(): boolean {\n\t\treturn Number.isNaN(this.x) || Number.isNaN(this.y);\n\t}\n\n\toverride isNormalised(): boolean {\n\t\treturn this.lengthSquared() === 1;\n\t}\n\n\toverride isUnit(): boolean {\n\t\treturn this.length() === 1;\n\t}\n\n\toverride isZero(): boolean {\n\t\treturn (\n\t\t\tthis.x === 0 &&\n\t\t\tthis.y === 0\n\t\t);\n\t}\n\n\toverride length(): number {\n\t\treturn Math.hypot(this.x, this.y);\n\t}\n\n\toverride lengthSquared(): number {\n\t\treturn (this.x ** 2) + (this.y ** 2);\n\t}\n\n\toverride lerp(other: Vector2, alpha: number): this {\n\t\tthis.x += (other.x - this.x) * alpha;\n\t\tthis.y += (other.y - this.y) * alpha;\n\n\t\treturn this;\n\t}\n\n\toverride max(other: Vector2): this {\n\t\tthis.x = Math.max(this.x, other.x);\n\t\tthis.y = Math.max(this.y, other.y);\n\n\t\treturn this;\n\t}\n\n\toverride midpoint(other: Vector2): this {\n\t\tthis.x = (this.x + other.x) / 2;\n\t\tthis.y = (this.y + other.y) / 2;\n\n\t\treturn this;\n\t}\n\n\toverride min(other: Vector2): this {\n\t\tthis.x = Math.min(this.x, other.x);\n\t\tthis.y = Math.min(this.y, other.y);\n\n\t\treturn this;\n\t}\n\n\toverride multiply(other: Vector2): this {\n\t\tthis.x *= other.x;\n\t\tthis.y *= other.y;\n\n\t\treturn this;\n\t}\n\n\toverride negate(): this {\n\t\tthis.x = -this.x;\n\t\tthis.y = -this.y;\n\n\t\treturn this;\n\t}\n\n\toverride normal(other?: Vector2): this {\n\t\tif (other) {\n\t\t\treturn this.centre(other).normal(other.centre(this));\n\t\t}\n\n\t\treturn this.fromArray([-this.y, this.x]).normalise();\n\t}\n\n\toverride normalise(): this {\n\t\tconst length = this.length();\n\n\t\tthis.x /= length;\n\t\tthis.y /= length;\n\n\t\treturn this;\n\t}\n\n\toverride perpendicular(): this {\n\t\tconst x = this.x;\n\n\t\tthis.x = -this.y;\n\t\tthis.y = x;\n\n\t\treturn this;\n\t}\n\n\toverride project(other: Vector2): this {\n\t\tlet scalar;\n\n\t\tif (this.isNormalised()) {\n\t\t\tscalar = this.dot(other);\n\t\t} else {\n\t\t\tscalar = this.dot(other) / other.lengthSquared();\n\t\t}\n\n\t\tthis.x = other.x * scalar;\n\t\tthis.y = other.y * scalar;\n\n\t\treturn this;\n\t}\n\n\toverride reflect(normal: Vector2): this {\n\t\tconst scalar = 2 * this.dot(normal);\n\n\t\tthis.x -= normal.x * scalar;\n\t\tthis.y -= normal.y * scalar;\n\n\t\treturn this;\n\t}\n\n\toverride reject(other: Vector2): this {\n\t\tlet scalar;\n\n\t\tif (this.isNormalised()) {\n\t\t\tscalar = this.dot(other);\n\t\t} else {\n\t\t\tscalar = this.dot(other) / other.lengthSquared();\n\t\t}\n\n\t\tthis.x -= other.x * scalar;\n\t\tthis.y -= other.y * scalar;\n\n\t\treturn this;\n\t}\n\n\toverride remainder(other: Vector2): this {\n\t\tthis.x %= other.x;\n\t\tthis.y %= other.y;\n\n\t\treturn this;\n\t}\n\n\toverride rotate(angle: number): this {\n\t\tconst cos = Math.cos(angle);\n\t\tconst sin = Math.sin(angle);\n\n\t\tconst x = this.x;\n\t\tconst y = this.y;\n\n\t\tthis.x = (x * cos) - (y * sin);\n\t\tthis.y = (x * sin) + (y * cos);\n\n\t\treturn this;\n\t}\n\n\toverride rotateAround(centre: Vector2, angle: number): this {\n\t\tconst cos = Math.cos(angle);\n\t\tconst sin = Math.sin(angle);\n\n\t\tconst x = this.x - centre.x;\n\t\tconst y = this.y - centre.y;\n\n\t\tthis.x = (x * cos) - (y * sin) + centre.x;\n\t\tthis.y = (x * sin) + (y * cos) + centre.y;\n\n\t\treturn this;\n\t}\n\n\toverride round(): this {\n\t\tthis.x = Math.round(this.x);\n\t\tthis.y = Math.round(this.y);\n\n\t\treturn this;\n\t}\n\n\toverride polar(length: number, angle: number, out?: Vector2): this {\n\t\tif (out === undefined) out = new Vector2();\n\n\t\tout.x = length * Math.cos(angle);\n\t\tout.y = length * Math.sin(angle);\n\n\t\treturn this;\n\t}\n\n\toverride scale(scalar: number): this {\n\t\tthis.x *= scalar;\n\t\tthis.y *= scalar;\n\n\t\treturn this;\n\t}\n\n\toverride set(v: Vector2 | [number, number]): this {\n\t\tif (v instanceof Vector2) {\n\t\t\tthis.x = v.x;\n\t\t\tthis.y = v.y;\n\t\t} else {\n\t\t\tthis.x = v[0];\n\t\t\tthis.y = v[1];\n\t\t}\n\n\t\treturn this;\n\t}\n\n\toverride setScalar(scalar: number): this {\n\t\tthis.x = scalar;\n\t\tthis.y = scalar;\n\n\t\treturn this;\n\t}\n\n\toverride sign(): this {\n\t\tthis.x = Math.sign(this.x);\n\t\tthis.y = Math.sign(this.y);\n\n\t\treturn this;\n\t}\n\n\toverride slerp(other: Vector2, alpha: number): this {\n\t\tconst angle = this.angle(other);\n\n\t\tthis.x = Math.cos(angle) * alpha;\n\t\tthis.y = Math.sin(angle) * alpha;\n\n\t\treturn this;\n\t}\n\n\toverride subtract(v: Vector2): this {\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\n\t\treturn this;\n\t}\n\n\toverride substractScalar(scalar: number): this {\n\t\tthis.x -= scalar;\n\t\tthis.y -= scalar;\n\n\t\treturn this;\n\t}\n\n\toverride toArray(): [number, number] {\n\t\treturn [this.x, this.y];\n\t}\n\n\toverride unit(): this {\n\t\tconst length = this.length();\n\n\t\tthis.x /= length;\n\t\tthis.y /= length;\n\n\t\treturn this;\n\t}\n\n\toverride zero(): this {\n\t\tthis.x = 0;\n\t\tthis.y = 0;\n\n\t\treturn this;\n\t}\n\n\t*[Symbol.iterator](): Generator<number> {\n\t\tyield this.x;\n\t\tyield this.y;\n\t}\n}\n", "import type { AbstractVector } from \"../vector.ts\";\n\nexport abstract class AbstractBoundingVolume {\n\tabstract area(): number;\n\tabstract centre(other?: AbstractBoundingVolume): AbstractVector;\n\tabstract clone(): this;\n\tabstract combine(other: AbstractBoundingVolume): this;\n\tabstract contains(other: AbstractBoundingVolume): boolean;\n\tabstract copy(other: this): this;\n\tabstract difference(other: AbstractBoundingVolume): this;\n\tabstract equals(other: AbstractBoundingVolume): boolean;\n\tabstract fromArray(elements: number[]): this;\n\tabstract intersect(other: AbstractBoundingVolume): this;\n\tabstract intersects(other: AbstractBoundingVolume): boolean;\n\tabstract perimeter(): number;\n\tabstract toArray(): number[];\n\n\ttoString(): string {\n\t\treturn `${this.constructor.name}(${this.toArray().join(\", \")})`;\n\t}\n}\n", "import { Vector2 } from \"../vector2.ts\";\nimport { AbstractBoundingVolume } from \"./bounding_volume.ts\";\n\nexport class BoundingBox extends AbstractBoundingVolume {\n\tconstructor(\n\t\tpublic x = 0,\n\t\tpublic y = 0,\n\t\tpublic width = 1,\n\t\tpublic height = 1,\n\t) {\n\t\tsuper();\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t}\n\n\toverride area(): number {\n\t\treturn this.width * this.height;\n\t}\n\n\toverride centre(other?: BoundingBox): Vector2 {\n\t\tif (other) {\n\t\t\treturn new Vector2(\n\t\t\t\t(this.x + (this.width / 2)) + (other.x + (other.width / 2)),\n\t\t\t\t(this.y + (this.height / 2)) + (other.y + (other.height / 2)),\n\t\t\t);\n\t\t}\n\n\t\treturn new Vector2(this.x + this.width / 2, this.y + this.height / 2);\n\t}\n\n\toverride clone(): this {\n\t\treturn new BoundingBox(this.x, this.y, this.width, this.height) as this;\n\t}\n\n\toverride combine(other: BoundingBox): this {\n\t\tconst x = Math.min(this.x, other.x);\n\t\tconst y = Math.min(this.y, other.y);\n\t\tconst width = Math.max(this.x + this.width, other.x + other.width) - x;\n\t\tconst height = Math.max(this.y + this.height, other.y + other.height) - y;\n\n\t\treturn this.fromArray([x, y, width, height]);\n\t}\n\n\toverride contains(other: BoundingBox): boolean {\n\t\treturn (\n\t\t\tthis.x <= other.x &&\n\t\t\tthis.y <= other.y &&\n\t\t\tthis.x + this.width >= other.x + other.width &&\n\t\t\tthis.y + this.height >= other.y + other.height\n\t\t);\n\t}\n\n\toverride copy(other: BoundingBox): this {\n\t\tthis.x = other.x;\n\t\tthis.y = other.y;\n\t\tthis.width = other.width;\n\t\tthis.height = other.height;\n\n\t\treturn this;\n\t}\n\n\toverride difference(other: BoundingBox): this {\n\t\treturn this.fromArray([\n\t\t\tMath.min(this.x, other.x),\n\t\t\tMath.min(this.y, other.y),\n\t\t\tMath.max(this.x + this.width, other.x + other.width) - Math.min(\n\t\t\t\tthis.x,\n\t\t\t\tother.x,\n\t\t\t),\n\t\t\tMath.max(this.y + this.height, other.y + other.height) - Math.min(\n\t\t\t\tthis.y,\n\t\t\t\tother.y,\n\t\t\t),\n\t\t]);\n\t}\n\n\toverride equals(other: BoundingBox): boolean {\n\t\treturn (\n\t\t\tthis.x === other.x &&\n\t\t\tthis.y === other.y &&\n\t\t\tthis.width === other.width &&\n\t\t\tthis.height === other.height\n\t\t);\n\t}\n\n\toverride fromArray(elements: [number, number, number, number]): this {\n\t\tthis.x = elements[0];\n\t\tthis.y = elements[1];\n\t\tthis.width = elements[2];\n\t\tthis.height = elements[3];\n\n\t\treturn this;\n\t}\n\n\toverride intersect(other: BoundingBox): this {\n\t\tconst x0 = Math.max(this.x, other.x);\n\t\tconst y0 = Math.max(this.y, other.y);\n\t\tconst x1 = Math.min(this.x + this.width, other.x + other.width);\n\t\tconst y1 = Math.min(this.y + this.height, other.y + other.height);\n\n\t\tconst width = Math.max(0, x1 - x0);\n\t\tconst height = Math.max(0, y1 - y0);\n\n\t\treturn this.fromArray([x0, y0, width, height]);\n\t}\n\n\toverride intersects(other: BoundingBox): boolean {\n\t\treturn (\n\t\t\tthis.x < (other.x + other.width) &&\n\t\t\tthis.x + this.width > other.x &&\n\t\t\tthis.y < (other.y + other.height) &&\n\t\t\tthis.y + this.height > other.y\n\t\t);\n\t}\n\n\toverride perimeter(): number {\n\t\treturn 2 * (this.width + this.height);\n\t}\n\n\toverride toArray(): [number, number, number, number] {\n\t\treturn [this.x, this.y, this.width, this.height];\n\t}\n}\n", "import { BoundingBox, type BoundingCircle } from \"../mod.ts\";\nimport { Vector2 } from \"../vector2.ts\";\n\nexport class AxisAlignedBoundingBox extends BoundingBox {\n\tconstructor(\n\t\tpublic readonly min = new Vector2(),\n\t\tpublic readonly max = new Vector2(),\n\t) {\n\t\tsuper();\n\t}\n\n\toverride area(): number {\n\t\treturn (this.max.x - this.min.x) * (this.max.y - this.min.y);\n\t}\n\n\toverride centre(other?: AxisAlignedBoundingBox): Vector2 {\n\t\tif (other) {\n\t\t\treturn new Vector2(\n\t\t\t\t((this.min.x + this.max.x) / 2) + ((other.min.x + other.max.x) / 2),\n\t\t\t\t((this.min.y + this.max.y) / 2) + ((other.min.y + other.max.y) / 2),\n\t\t\t);\n\t\t}\n\n\t\treturn new Vector2(\n\t\t\t(this.min.x + this.max.x) / 2,\n\t\t\t(this.min.y + this.max.y) / 2,\n\t\t);\n\t}\n\n\toverride clone(): this {\n\t\treturn new AxisAlignedBoundingBox(\n\t\t\tthis.min.clone(),\n\t\t\tthis.max.clone(),\n\t\t) as this;\n\t}\n\n\toverride combine(other: AxisAlignedBoundingBox): this {\n\t\tconst x = Math.min(this.min.x, other.min.x);\n\t\tconst y = Math.min(this.min.y, other.min.y);\n\t\tconst width = Math.max(this.max.x, other.max.x) - x;\n\t\tconst height = Math.max(this.max.y, other.max.y) - y;\n\n\t\treturn this.fromArray([x, y, width, height]);\n\t}\n\n\toverride contains(other: AxisAlignedBoundingBox): boolean {\n\t\treturn (\n\t\t\tthis.min.x <= other.min.x &&\n\t\t\tthis.min.y <= other.min.y &&\n\t\t\tthis.max.x >= other.max.x &&\n\t\t\tthis.max.y >= other.max.y\n\t\t);\n\t}\n\n\toverride copy(other: AxisAlignedBoundingBox): this {\n\t\tthis.min.copy(other.min);\n\t\tthis.max.copy(other.max);\n\n\t\treturn this;\n\t}\n\n\toverride difference(other: AxisAlignedBoundingBox): this {\n\t\tconst x = Math.max(this.min.x, other.min.x);\n\t\tconst y = Math.max(this.min.y, other.min.y);\n\t\tconst width = Math.min(this.max.x, other.max.x) - x;\n\t\tconst height = Math.min(this.max.y, other.max.y) - y;\n\n\t\treturn this.fromArray([x, y, width, height]);\n\t}\n\n\toverride equals(other: AxisAlignedBoundingBox): boolean {\n\t\treturn (\n\t\t\tthis.min.equals(other.min) &&\n\t\t\tthis.max.equals(other.max)\n\t\t);\n\t}\n\n\toverride intersect(other: AxisAlignedBoundingBox): this {\n\t\tconst x = Math.max(this.min.x, other.min.x);\n\t\tconst y = Math.max(this.min.y, other.min.y);\n\t\tconst width = Math.min(this.max.x, other.max.x) - x;\n\t\tconst height = Math.min(this.max.y, other.max.y) - y;\n\n\t\treturn this.fromArray([x, y, width, height]);\n\t}\n\n\tintersectBox(\n\t\tother: BoundingBox,\n\t): this {\n\t\tconst x = Math.max(this.min.x, other.x);\n\t\tconst y = Math.max(this.min.y, other.y);\n\t\tconst width = Math.min(this.max.x, other.x + other.width) - x;\n\t\tconst height = Math.min(this.max.y, other.y + other.height) - y;\n\n\t\treturn this.fromArray([x, y, width, height]);\n\t}\n\n\tintersectCircle(\n\t\tother: BoundingCircle,\n\t): this {\n\t\tconst x = Math.max(this.min.x, other.x - other.radius);\n\t\tconst y = Math.max(this.min.y, other.y - other.radius);\n\t\tconst width = Math.min(this.max.x, other.x + other.radius) - x;\n\t\tconst height = Math.min(this.max.y, other.y + other.radius) - y;\n\n\t\treturn this.fromArray([x, y, width, height]);\n\t}\n\n\toverride intersects(other: AxisAlignedBoundingBox): boolean {\n\t\treturn !(\n\t\t\tthis.max.x < other.min.x ||\n\t\t\tthis.min.x > other.max.x ||\n\t\t\tthis.max.y < other.min.y ||\n\t\t\tthis.min.y > other.max.y\n\t\t);\n\t}\n\n\tintersectsBox(\n\t\tother: BoundingBox,\n\t): boolean {\n\t\treturn !(\n\t\t\tthis.max.x < other.x ||\n\t\t\tthis.min.x > (other.x + other.width) ||\n\t\t\tthis.max.y < other.y ||\n\t\t\tthis.min.y > (other.y + other.height)\n\t\t);\n\t}\n\n\tintersectsCircle(\n\t\tother: BoundingCircle,\n\t): boolean {\n\t\tconst dx = Math.max(this.min.x - other.x, 0, other.x - this.max.x);\n\t\tconst dy = Math.max(this.min.y - other.y, 0, other.y - this.max.y);\n\n\t\treturn (dx ** 2) + (dy ** 2) <= other.radius ** 2;\n\t}\n\n\tnormal(other?: AxisAlignedBoundingBox): Vector2 {\n\t\tif (other) {\n\t\t\treturn this.centre(other).normal(other.centre(this));\n\t\t}\n\n\t\treturn new Vector2(\n\t\t\tthis.max.y - this.min.y,\n\t\t\tthis.min.x - this.max.x,\n\t\t).normalise();\n\t}\n\n\toverride perimeter(): number {\n\t\treturn 2 * ((this.max.x - this.min.x) + (this.max.y - this.min.y));\n\t}\n\n\toverride toArray(): [number, number, number, number] {\n\t\treturn [this.min.x, this.min.y, this.max.x, this.max.y];\n\t}\n}\n", "import type { AbstractVector } from \"../vector.ts\";\n\nexport abstract class AbstractCaster {\n\tabstract angle(other?: AbstractVector): number;\n\tabstract cast(other?: AbstractVector, scalar?: number): AbstractVector;\n\tabstract centre(other?: AbstractVector): AbstractVector;\n\tabstract intersect(elements: number[]): AbstractVector;\n\tabstract normal(): AbstractVector;\n\tabstract normalise(): this;\n\tabstract toArray(): number[];\n\n\ttoString(): string {\n\t\treturn `${this.constructor.name}(${this.toArray().join(\", \")})`;\n\t}\n}\n", "import { Vector2 } from \"../mod.ts\";\nimport type { BoundingCircle } from \"../volumes/mod.ts\";\nimport { AbstractCaster } from \"./cast.ts\";\nimport type { AABB } from \"./mod.ts\";\n\nexport class Raycaster extends AbstractCaster {\n\tconstructor(public origin = new Vector2(), public direction = new Vector2()) {\n\t\tsuper();\n\n\t\tthis.origin = origin;\n\t\tthis.direction = direction;\n\t}\n\n\toverride angle(other?: Vector2): number {\n\t\tif (other === undefined) {\n\t\t\treturn Math.atan2(this.direction.y, this.direction.x);\n\t\t}\n\n\t\treturn Math.atan2(other.y - this.origin.y, other.x - this.origin.x);\n\t}\n\n\toverride cast(other?: Vector2, scalar?: number): Vector2 {\n\t\tif (other) {\n\t\t\tthis.direction = new Vector2(\n\t\t\t\tother.x - this.origin.x,\n\t\t\t\tother.y - this.origin.y,\n\t\t\t);\n\t\t}\n\n\t\tif (scalar) {\n\t\t\tthis.direction = this.direction.normalise().scale(scalar);\n\t\t}\n\n\t\treturn new Vector2(\n\t\t\tthis.origin.x + this.direction.x,\n\t\t\tthis.origin.y + this.direction.y,\n\t\t);\n\t}\n\n\toverride centre(other?: Vector2): Vector2 {\n\t\tif (other) {\n\t\t\treturn new Vector2(\n\t\t\t\t(this.origin.x + other.x) / 2,\n\t\t\t\t(this.origin.y + other.y) / 2,\n\t\t\t);\n\t\t}\n\n\t\treturn new Vector2(\n\t\t\tthis.origin.x + (this.direction.x / 2),\n\t\t\tthis.origin.y + (this.direction.y / 2),\n\t\t);\n\t}\n\n\toverride intersect(elements: [number, number, number, number]): Vector2 {\n\t\tconst [x1, y1, x2, y2] = elements;\n\n\t\tconst t1 = (y1 - this.origin.y) / this.direction.y;\n\t\tconst t2 = (y2 - this.origin.y) / this.direction.y;\n\t\tconst t3 = (x1 - this.origin.x) / this.direction.x;\n\t\tconst t4 = (x2 - this.origin.x) / this.direction.x;\n\n\t\tconst tmin = Math.max(\n\t\t\tMath.min(t1, t2),\n\t\t\tMath.min(t3, t4),\n\t\t);\n\t\tconst tmax = Math.min(\n\t\t\tMath.max(t1, t2),\n\t\t\tMath.max(t3, t4),\n\t\t);\n\n\t\tif (tmax < 0 && tmin > tmax) throw new Error(\"intersection not found\");\n\n\t\treturn new Vector2(\n\t\t\tthis.origin.x + (tmin * this.direction.x),\n\t\t\tthis.origin.y + (tmin * this.direction.y),\n\t\t);\n\t}\n\n\tintersectAABB(aabb: AABB): Vector2 {\n\t\tif (this.direction.x === 0 || this.direction.y === 0) {\n\t\t\tthrow new Error(\"direction cannot be zero\");\n\t\t}\n\n\t\tconst t1 = (aabb.min.x - this.origin.x) / this.direction.x;\n\t\tconst t2 = (aabb.max.x - this.origin.x) / this.direction.x;\n\t\tconst t3 = (aabb.min.y - this.origin.y) / this.direction.y;\n\t\tconst t4 = (aabb.max.y - this.origin.y) / this.direction.y;\n\n\t\tconst tmin = Math.max(\n\t\t\tMath.min(t1, t2),\n\t\t\tMath.min(t3, t4),\n\t\t);\n\t\tconst tmax = Math.min(\n\t\t\tMath.max(t1, t2),\n\t\t\tMath.max(t3, t4),\n\t\t);\n\n\t\tif (tmax < 0 && tmin > tmax) throw new Error(\"intersection not found\");\n\n\t\treturn new Vector2(\n\t\t\tthis.origin.x + (tmin * this.direction.x),\n\t\t\tthis.origin.y + (tmin * this.direction.y),\n\t\t);\n\t}\n\n\tintersectCircle(other: BoundingCircle): [Vector2, Vector2] {\n\t\tconst dx = this.origin.x - other.x;\n\t\tconst dy = this.origin.y - other.y;\n\n\t\tconst a = this.direction.dot(this.direction);\n\t\tconst b = 2 * this.direction.dot(new Vector2(dx, dy));\n\t\tconst c = ((dx ** 2) + (dy ** 2)) - (other.radius ** 2);\n\n\t\tconst discriminant = (b ** 2) - (4 * a * c);\n\t\tif (discriminant < 0) return [new Vector2(), new Vector2()];\n\n\t\tconst t1 = (-b + Math.sqrt(discriminant)) / (2 * a);\n\t\tconst t2 = (-b - Math.sqrt(discriminant)) / (2 * a);\n\n\t\treturn [\n\t\t\tnew Vector2(\n\t\t\t\tthis.origin.x + (t1 * this.direction.x),\n\t\t\t\tthis.origin.y + (t1 * this.direction.y),\n\t\t\t),\n\t\t\tnew Vector2(\n\t\t\t\tthis.origin.x + (t2 * this.direction.x),\n\t\t\t\tthis.origin.y + (t2 * this.direction.y),\n\t\t\t),\n\t\t];\n\t}\n\n\tintersectLineSegment(start: Vector2, end: Vector2): Vector2 {\n\t\tconst dx = end.x - start.x;\n\t\tconst dy = end.y - start.y;\n\n\t\tconst t =\n\t\t\t(((this.origin.x - start.x) * dy) - ((this.origin.y - start.y) * dx)) /\n\t\t\t((this.direction.x * dy) - (this.direction.y * dx));\n\t\tif (t < 0 || t > 1) throw new Error(\"intersection not found\");\n\n\t\tconst u = (((this.origin.x - start.x) * this.direction.y) -\n\t\t\t((this.origin.y - start.y) * this.direction.x)) /\n\t\t\t((this.direction.x * dy) - (this.direction.y * dx));\n\t\tif (u < 0 || u > 1) throw new Error(\"intersection not found\");\n\n\t\treturn new Vector2(\n\t\t\tstart.x + (t * dx),\n\t\t\tstart.y + (t * dy),\n\t\t);\n\t}\n\n\toverride normal(): Vector2 {\n\t\treturn new Vector2(this.direction.y, -this.direction.x);\n\t}\n\n\toverride normalise(): this {\n\t\tconst squaredLength = this.direction.lengthSquared();\n\t\tif (squaredLength === 0) {\n\t\t\tthrow new Error(\"cannot normalise zero-length vector\");\n\t\t}\n\n\t\tthis.direction.x /= squaredLength;\n\t\tthis.direction.y /= squaredLength;\n\n\t\treturn this;\n\t}\n\n\toverride toArray(): [number, number, number, number] {\n\t\treturn [\n\t\t\tthis.origin.x,\n\t\t\tthis.origin.y,\n\t\t\tthis.origin.x + this.direction.x,\n\t\t\tthis.origin.y + this.direction.y,\n\t\t];\n\t}\n}\n", "export * from \"./volumes/mod.ts\";\nexport { Matrix2 } from \"./matrix2.ts\";\nexport * from \"./physics/mod.ts\";\nexport * from \"./shapes/mod.ts\";\nexport { Vector2 } from \"./vector2.ts\";\n\nexport const PI_SQUARED = Math.PI * Math.PI;\nexport const PI2 = Math.PI * 2;\nexport const HALF_PI = Math.PI / 2;\nexport const QUARTER_PI = Math.PI / 4;\n\nexport const DEGREES_TO_RADIANS = Math.PI / 180;\nexport const RADIANS_TO_DEGREES = 180 / Math.PI;\n\nexport function toRadians(angle: number): number {\n\treturn angle * DEGREES_TO_RADIANS;\n}\n\nexport function toDegrees(angle: number): number {\n\treturn angle * RADIANS_TO_DEGREES;\n}\n", "import { AABB, PI2, Raycaster, Vector2 } from \"../src/mod.ts\";\n\nconst canvas = document.createElement(\"canvas\");\ncanvas.width = 640;\ncanvas.height = 480;\ndocument.body.appendChild(canvas);\n\nconst ctx = canvas.getContext(\"2d\") as CanvasRenderingContext2D;\n\nconst aabb = new AABB(\n\tnew Vector2(canvas.width / 2 - 50, canvas.height / 2 - 50),\n\tnew Vector2(canvas.width / 2 + 50, canvas.height / 2 + 50),\n);\n\nconst ray1 = new Raycaster(aabb.centre(), Vector2.RIGHT);\nconst ray2 = new Raycaster(aabb.centre(), Vector2.LEFT);\n\nfunction update(): void {\n\tray1.origin = aabb.centre().add(new Vector2(100, 0).rotate(ray1.angle()));\n\tray2.origin = aabb.centre().add(new Vector2(100, 0).rotate(ray2.angle()));\n\n\tray1.direction.rotate(-0.03);\n\tray2.direction.rotate(0.01);\n}\n\nfunction render(): void {\n\tctx.clearRect(0, 0, canvas.width, canvas.height);\n\n\tctx.fillStyle = \"black\";\n\tctx.fillRect(0, 0, canvas.width, canvas.height);\n\n\tdrawBox(aabb, \"white\");\n\tdrawPoint(aabb.centre(), \"blue\");\n\n\tdrawRay(ray1, \"yellow\");\n\tdrawRay(ray2, \"yellow\");\n\n\tconst intersection1 = ray1.intersectAABB(aabb);\n\tconst intersection2 = ray2.intersectAABB(aabb);\n\tif (intersection1 && intersection2) {\n\t\tdrawPoints([intersection1, intersection2], \"yellow\");\n\t}\n\n\tdrawIntersection(aabb, ray1, ray2);\n}\n\nfunction loop(): void {\n\tupdate();\n\trender();\n\n\trequestAnimationFrame(loop);\n}\n\nfunction drawIntersection(\n\taabb: AABB,\n\tray1: Raycaster,\n\tray2: Raycaster,\n): void {\n\tconst intersection1 = ray1.intersectAABB(aabb);\n\tconst intersection2 = ray2.intersectAABB(aabb);\n\n\tif (intersection1 && intersection2) {\n\t\tctx.fillStyle = \"rgba(255, 255, 0, 0.5)\";\n\t\tctx.beginPath();\n\t\tctx.moveTo(aabb.centre().x, aabb.centre().y);\n\t\tctx.lineTo(intersection1.x, intersection1.y);\n\t\tctx.lineTo(intersection2.x, intersection2.y);\n\t\tctx.closePath();\n\t\tctx.fill();\n\t}\n}\n\nfunction drawRay(ray: Raycaster, colour: string): void {\n\tctx.strokeStyle = colour;\n\tctx.beginPath();\n\tctx.moveTo(ray.origin.x, ray.origin.y);\n\tctx.lineTo(\n\t\tray.origin.x + ray.direction.x * 1000,\n\t\tray.origin.y + ray.direction.y * 1000,\n\t);\n\tctx.stroke();\n}\n\nfunction drawPoints(points: Vector2[], colour: string): void {\n\tctx.fillStyle = colour;\n\n\tfor (const point of points) {\n\t\tctx.beginPath();\n\t\tctx.arc(point.x, point.y, 5, 0, PI2);\n\t\tctx.fill();\n\t}\n}\n\nfunction drawPoint(point: Vector2, colour: string): void {\n\tctx.fillStyle = colour;\n\tctx.beginPath();\n\tctx.arc(point.x, point.y, 5, 0, PI2);\n\tctx.fill();\n}\n\nfunction drawBox(box: AABB, colour: string): void {\n\tctx.strokeStyle = colour;\n\tctx.strokeRect(\n\t\tbox.min.x,\n\t\tbox.min.y,\n\t\tbox.max.x - box.min.x,\n\t\tbox.max.y - box.min.y,\n\t);\n}\n\ndocument.addEventListener(\"DOMContentLoaded\", function (): void {\n\tloop();\n});\n"],
  "mappings": "MAAO,IAAeA,EAAf,KAA8B,CAwDpC,UAAmB,CAClB,MAAO,GAAG,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AAI,UAAU,EACdA,EAAI,KAAK,EAEX,CAEA,SAASW,EAAQM,EAAgBC,EAAsB,CACtDlB,EAAI,YAAckB,EAClBlB,EAAI,UAAU,EACdA,EAAI,OAAOiB,EAAI,OAAO,EAAGA,EAAI,OAAO,CAAC,EACrCjB,EAAI,OACHiB,EAAI,OAAO,EAAIA,EAAI,UAAU,EAAI,IACjCA,EAAI,OAAO,EAAIA,EAAI,UAAU,EAAI,GAClC,EACAjB,EAAI,OAAO,CACZ,CAEA,SAASc,EAAWK,EAAmBD,EAAsB,CAC5DlB,EAAI,UAAYkB,EAEhB,QAAWE,KAASD,EACnBnB,EAAI,UAAU,EACdA,EAAI,IAAIoB,EAAM,EAAGA,EAAM,EAAG,EAAG,EAAGC,CAAG,EACnCrB,EAAI,KAAK,CAEX,CAEA,SAASU,EAAUU,EAAgBF,EAAsB,CACxDlB,EAAI,UAAYkB,EAChBlB,EAAI,UAAU,EACdA,EAAI,IAAIoB,EAAM,EAAGA,EAAM,EAAG,EAAG,EAAGC,CAAG,EACnCrB,EAAI,KAAK,CACV,CAEA,SAASS,EAAQa,EAAWJ,EAAsB,CACjDlB,EAAI,YAAckB,EAClBlB,EAAI,WACHsB,EAAI,IAAI,EACRA,EAAI,IAAI,EACRA,EAAI,IAAI,EAAIA,EAAI,IAAI,EACpBA,EAAI,IAAI,EAAIA,EAAI,IAAI,CACrB,CACD,CAEA,SAAS,iBAAiB,mBAAoB,UAAkB,CAC/DN,EAAK,CACN,CAAC",
  "names": ["AbstractVector", "Vector2", "_Vector2", "AbstractVector", "x", "y", "other", "scalar", "min", "max", "angle", "elements", "alpha", "length", "normal", "cos", "sin", "centre", "out", "v", "AbstractBoundingVolume", "BoundingBox", "_BoundingBox", "AbstractBoundingVolume", "x", "y", "width", "height", "other", "Vector2", "elements", "x0", "y0", "x1", "y1", "AxisAlignedBoundingBox", "_AxisAlignedBoundingBox", "BoundingBox", "min", "Vector2", "max", "other", "x", "y", "width", "height", "dx", "dy", "AbstractCaster", "Raycaster", "AbstractCaster", "origin", "Vector2", "direction", "other", "scalar", "elements", "x1", "y1", "x2", "y2", "t1", "t2", "t3", "t4", "tmin", "tmax", "aabb", "dx", "dy", "a", "b", "discriminant", "start", "end", "t", "u", "squaredLength", "PI_SQUARED", "PI2", "HALF_PI", "QUARTER_PI", "DEGREES_TO_RADIANS", "RADIANS_TO_DEGREES", "canvas", "ctx", "aabb", "AxisAlignedBoundingBox", "Vector2", "ray1", "Raycaster", "ray2", "update", "render", "drawBox", "drawPoint", "drawRay", "intersection1", "intersection2", "drawPoints", "drawIntersection", "loop", "ray", "colour", "points", "point", "PI2", "box"]
}
Leave a Comment