@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.
@@ -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;
@@ -0,0 +1,10 @@
1
+ declare module '@emotions-app/shared-utils/ontology/types' {
2
+ export interface OntologyType {
3
+ [key: string]: any;
4
+ }
5
+ export interface OntologyEntity {
6
+ id: string;
7
+ type: string;
8
+ [key: string]: any;
9
+ }
10
+ }
package/src/types.ts CHANGED
@@ -4,6 +4,7 @@
4
4
 
5
5
  import type { RefObject } from 'react';
6
6
  import type { HexGridFeatureFlags } from './features';
7
+ export type { HexGridFeatureFlags } from './features';
7
8
 
8
9
  /**
9
10
  * Photo type for HexGrid visualization
package/tsconfig.json CHANGED
@@ -1,18 +1,25 @@
1
1
  {
2
- "extends": "../../tsconfig.json",
3
2
  "compilerOptions": {
4
- "outDir": "./dist",
5
- "rootDir": "../../",
6
- "declaration": true,
7
- "declarationMap": true,
8
- "composite": true,
9
- "noEmit": true
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
- "src/**/*",
13
- "tests/**/*",
14
- "../../lib/**/*",
15
- "../../components/debug/**/*"
16
- ],
17
- "exclude": ["node_modules", "dist"]
23
+ "include": ["src"],
24
+ "exclude": ["node_modules", "dist", "tests"]
18
25
  }