@buley/hexgrid-3d 1.1.0 → 1.1.1
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.
- package/build_log.txt +500 -0
- package/build_src_log.txt +8 -0
- package/package.json +1 -1
- package/site/.eslintrc.json +3 -0
- package/site/DEPLOYMENT.md +196 -0
- package/site/INDEX.md +127 -0
- package/site/QUICK_START.md +86 -0
- package/site/README.md +85 -0
- package/site/SITE_SUMMARY.md +180 -0
- package/site/next.config.js +12 -0
- package/site/package.json +26 -0
- package/site/src/app/docs/page.tsx +148 -0
- package/site/src/app/examples/page.tsx +133 -0
- package/site/src/app/globals.css +160 -0
- package/site/src/app/layout.tsx +29 -0
- package/site/src/app/page.tsx +163 -0
- package/site/tsconfig.json +29 -0
- package/site/vercel.json +6 -0
- package/src/adapters/DashAdapter.ts +57 -0
- package/src/algorithms/ParticleSystem3D.ts +25 -4
- package/src/components/NarrationOverlay.tsx +1 -1
- package/src/lib/narration.ts +17 -0
- package/src/lib/stats-tracker.ts +25 -0
- package/src/lib/theme-colors.ts +12 -0
- package/src/math/HexCoordinates.ts +849 -4
- package/src/math/Vector3.ts +44 -0
- package/src/types/shared-utils.d.ts +10 -0
- package/src/types.ts +1 -0
- package/tsconfig.json +21 -14
package/src/math/Vector3.ts
CHANGED
|
@@ -64,6 +64,50 @@ export class Vector3 {
|
|
|
64
64
|
return new Vector3(x, y, z);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
clone(): Vector3 {
|
|
68
|
+
return new Vector3(this.x, this.y, this.z);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
add(other: Vector3): Vector3 {
|
|
72
|
+
return new Vector3(this.x + other.x, this.y + other.y, this.z + other.z);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
subtract(other: Vector3): Vector3 {
|
|
76
|
+
return new Vector3(this.x - other.x, this.y - other.y, this.z - other.z);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
scale(factor: number): Vector3 {
|
|
80
|
+
return new Vector3(this.x * factor, this.y * factor, this.z * factor);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
dot(other: Vector3): number {
|
|
84
|
+
return this.x * other.x + this.y * other.y + this.z * other.z;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
cross(other: Vector3): Vector3 {
|
|
88
|
+
return new Vector3(
|
|
89
|
+
this.y * other.z - this.z * other.y,
|
|
90
|
+
this.z * other.x - this.x * other.z,
|
|
91
|
+
this.x * other.y - this.y * other.x
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
length(): number {
|
|
96
|
+
return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
magnitude(): number {
|
|
100
|
+
return this.length();
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
normalize(): Vector3 {
|
|
104
|
+
const len = this.length();
|
|
105
|
+
if (len === 0) {
|
|
106
|
+
return new Vector3(0, 0, 0);
|
|
107
|
+
}
|
|
108
|
+
return new Vector3(this.x / len, this.y / len, this.z / len);
|
|
109
|
+
}
|
|
110
|
+
|
|
67
111
|
distanceTo(other: Vector3): number {
|
|
68
112
|
const dx = this.x - other.x;
|
|
69
113
|
const dy = this.y - other.y;
|
package/src/types.ts
CHANGED
package/tsconfig.json
CHANGED
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
{
|
|
2
|
-
"extends": "../../tsconfig.json",
|
|
3
2
|
"compilerOptions": {
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
3
|
+
"target": "es2020",
|
|
4
|
+
"lib": ["dom", "dom.iterable", "esnext"],
|
|
5
|
+
"allowJs": true,
|
|
6
|
+
"skipLibCheck": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"allowSyntheticDefaultImports": true,
|
|
9
|
+
"strict": true,
|
|
10
|
+
"forceConsistentCasingInFileNames": true,
|
|
11
|
+
"noFallthroughCasesInSwitch": true,
|
|
12
|
+
"module": "esnext",
|
|
13
|
+
"moduleResolution": "node",
|
|
14
|
+
"resolveJsonModule": true,
|
|
15
|
+
"isolatedModules": true,
|
|
16
|
+
"noEmit": true,
|
|
17
|
+
"jsx": "react-jsx",
|
|
18
|
+
"baseUrl": ".",
|
|
19
|
+
"paths": {
|
|
20
|
+
"@/*": ["src/*"]
|
|
21
|
+
}
|
|
10
22
|
},
|
|
11
|
-
"include": [
|
|
12
|
-
|
|
13
|
-
"tests/**/*",
|
|
14
|
-
"../../lib/**/*",
|
|
15
|
-
"../../components/debug/**/*"
|
|
16
|
-
],
|
|
17
|
-
"exclude": ["node_modules", "dist"]
|
|
23
|
+
"include": ["src"],
|
|
24
|
+
"exclude": ["node_modules", "dist", "tests"]
|
|
18
25
|
}
|