@buley/hexgrid-3d 3.2.3 → 3.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.
- package/dist/algorithms/AdvancedStatistics.d.ts +2 -2
- package/dist/algorithms/AdvancedStatistics.d.ts.map +1 -1
- package/dist/algorithms/AdvancedStatistics.js +2 -2
- package/dist/algorithms/BayesianStatistics.d.ts +6 -0
- package/dist/algorithms/BayesianStatistics.d.ts.map +1 -1
- package/dist/algorithms/BayesianStatistics.js +54 -0
- package/dist/algorithms/FlowField.d.ts +11 -0
- package/dist/algorithms/FlowField.d.ts.map +1 -1
- package/dist/algorithms/FlowField.js +13 -0
- package/dist/algorithms/FluidSimulation.d.ts +21 -3
- package/dist/algorithms/FluidSimulation.d.ts.map +1 -1
- package/dist/algorithms/FluidSimulation.js +40 -0
- package/dist/algorithms/GraphAlgorithms.d.ts +1 -1
- package/dist/algorithms/GraphAlgorithms.d.ts.map +1 -1
- package/dist/algorithms/GraphAlgorithms.js +87 -15
- package/dist/algorithms/OutlierDetection.d.ts +4 -0
- package/dist/algorithms/OutlierDetection.d.ts.map +1 -1
- package/dist/algorithms/OutlierDetection.js +15 -3
- package/dist/algorithms/ParticleSystem.d.ts +46 -3
- package/dist/algorithms/ParticleSystem.d.ts.map +1 -1
- package/dist/algorithms/ParticleSystem.js +118 -15
- package/dist/components/HexGrid.d.ts +32 -2
- package/dist/components/HexGrid.d.ts.map +1 -1
- package/dist/components/HexGrid.js +5456 -25
- package/dist/components/debug/PoolStatsOverlay.d.ts +6 -0
- package/dist/components/debug/PoolStatsOverlay.d.ts.map +1 -0
- package/dist/components/debug/PoolStatsOverlay.js +18 -0
- package/dist/components/index.d.ts +3 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/lib/html-utils.d.ts +2 -0
- package/dist/lib/html-utils.d.ts.map +1 -0
- package/dist/lib/html-utils.js +7 -0
- package/dist/lib/logger.d.ts +20 -0
- package/dist/lib/logger.d.ts.map +1 -0
- package/dist/lib/logger.js +9 -0
- package/dist/lib/narration.d.ts +5 -0
- package/dist/lib/narration.d.ts.map +1 -1
- package/dist/lib/narration.js +19 -0
- package/dist/lib/stats-tracker.d.ts +2 -0
- package/dist/lib/stats-tracker.d.ts.map +1 -1
- package/dist/lib/stats-tracker.js +13 -0
- package/dist/lib/theme-colors.d.ts +9 -0
- package/dist/lib/theme-colors.d.ts.map +1 -1
- package/dist/lib/theme-colors.js +18 -1
- package/dist/math/Matrix4.d.ts +179 -2
- package/dist/math/Matrix4.d.ts.map +1 -1
- package/dist/math/Matrix4.js +528 -8
- package/dist/math/Quaternion.d.ts +69 -0
- package/dist/math/Quaternion.d.ts.map +1 -1
- package/dist/math/Quaternion.js +439 -0
- package/dist/math/SpatialIndex.d.ts +32 -13
- package/dist/math/SpatialIndex.d.ts.map +1 -1
- package/dist/math/SpatialIndex.js +239 -33
- package/package.json +4 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PoolStatsOverlay.d.ts","sourceRoot":"","sources":["../../../src/components/debug/PoolStatsOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,OAAO,CAAA;CAChB;AAED,wBAAgB,gBAAgB,CAAC,EAAE,MAAM,EAAE,EAAE,qBAAqB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IAAI,CAsB5F"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export function PoolStatsOverlay({ isOpen }) {
|
|
3
|
+
if (!isOpen)
|
|
4
|
+
return null;
|
|
5
|
+
return (_jsx("div", { style: {
|
|
6
|
+
position: 'absolute',
|
|
7
|
+
top: 8,
|
|
8
|
+
right: 8,
|
|
9
|
+
background: 'rgba(0, 0, 0, 0.75)',
|
|
10
|
+
color: '#0ff',
|
|
11
|
+
padding: '8px 12px',
|
|
12
|
+
borderRadius: 4,
|
|
13
|
+
fontSize: 11,
|
|
14
|
+
fontFamily: 'monospace',
|
|
15
|
+
pointerEvents: 'none',
|
|
16
|
+
zIndex: 1000,
|
|
17
|
+
}, children: "Pool Stats Overlay" }));
|
|
18
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,YAAY,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AACvC,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { HexGrid } from './HexGrid';
|
|
1
|
+
export { HexGrid, default } from './HexGrid';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html-utils.d.ts","sourceRoot":"","sources":["../../src/lib/html-utils.ts"],"names":[],"mappings":"AAEA,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAItD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const logger: {
|
|
2
|
+
debug: (..._args: unknown[]) => void;
|
|
3
|
+
log: {
|
|
4
|
+
(...data: any[]): void;
|
|
5
|
+
(...data: any[]): void;
|
|
6
|
+
};
|
|
7
|
+
info: {
|
|
8
|
+
(...data: any[]): void;
|
|
9
|
+
(...data: any[]): void;
|
|
10
|
+
};
|
|
11
|
+
warn: {
|
|
12
|
+
(...data: any[]): void;
|
|
13
|
+
(...data: any[]): void;
|
|
14
|
+
};
|
|
15
|
+
error: {
|
|
16
|
+
(...data: any[]): void;
|
|
17
|
+
(...data: any[]): void;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/lib/logger.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,MAAM;sBANK,OAAO,EAAE;;;;;;;;;;;;;;;;;CAYhC,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const noop = (..._args) => { };
|
|
2
|
+
const isDev = typeof process !== 'undefined' && process?.env?.NODE_ENV !== 'production';
|
|
3
|
+
export const logger = {
|
|
4
|
+
debug: isDev ? console.debug.bind(console) : noop,
|
|
5
|
+
log: console.log.bind(console),
|
|
6
|
+
info: console.info.bind(console),
|
|
7
|
+
warn: console.warn.bind(console),
|
|
8
|
+
error: console.error.bind(console),
|
|
9
|
+
};
|
package/dist/lib/narration.d.ts
CHANGED
|
@@ -9,4 +9,9 @@ export interface NarrationMessage {
|
|
|
9
9
|
export declare class NarrationManager {
|
|
10
10
|
static getInstance(): any;
|
|
11
11
|
}
|
|
12
|
+
export declare class NarrationEngine {
|
|
13
|
+
private statsTracker;
|
|
14
|
+
constructor(statsTracker: any);
|
|
15
|
+
generateNarration(generation: number, territories: Map<string, number>, velocities: Map<string, number>, titles: Map<string, string>, totalHexes: number, availableHexes: number, births: number, deaths: number): NarrationMessage[];
|
|
16
|
+
}
|
|
12
17
|
//# sourceMappingURL=narration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"narration.d.ts","sourceRoot":"","sources":["../../src/lib/narration.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,gBAAgB;IAC3B,MAAM,CAAC,WAAW,IAAI,GAAG;CAM1B"}
|
|
1
|
+
{"version":3,"file":"narration.d.ts","sourceRoot":"","sources":["../../src/lib/narration.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,gBAAgB;IAC3B,MAAM,CAAC,WAAW,IAAI,GAAG;CAM1B;AAED,qBAAa,eAAe;IAC1B,OAAO,CAAC,YAAY,CAAM;gBAEd,YAAY,EAAE,GAAG;IAI7B,iBAAiB,CACf,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAChC,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAC3B,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GACb,gBAAgB,EAAE;CAgBtB"}
|
package/dist/lib/narration.js
CHANGED
|
@@ -6,3 +6,22 @@ export class NarrationManager {
|
|
|
6
6
|
};
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
|
+
export class NarrationEngine {
|
|
10
|
+
constructor(statsTracker) {
|
|
11
|
+
this.statsTracker = statsTracker;
|
|
12
|
+
}
|
|
13
|
+
generateNarration(generation, territories, velocities, titles, totalHexes, availableHexes, births, deaths) {
|
|
14
|
+
const messages = [];
|
|
15
|
+
const timestamp = new Date().toISOString();
|
|
16
|
+
if (births > 0 || deaths > 0) {
|
|
17
|
+
messages.push({
|
|
18
|
+
generation,
|
|
19
|
+
timestamp,
|
|
20
|
+
priority: 1,
|
|
21
|
+
text: `Generation ${generation}: ${births} births, ${deaths} deaths`,
|
|
22
|
+
eventType: 'lifecycle',
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
return messages;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stats-tracker.d.ts","sourceRoot":"","sources":["../../src/lib/stats-tracker.ts"],"names":[],"mappings":"AAAA,qBAAa,YAAY;IACvB,MAAM,CAAC,WAAW,IAAI,YAAY;IAIlC,eAAe,IAAI,GAAG;IAStB,iBAAiB,IAAI,GAAG;IAOxB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,EAAE;
|
|
1
|
+
{"version":3,"file":"stats-tracker.d.ts","sourceRoot":"","sources":["../../src/lib/stats-tracker.ts"],"names":[],"mappings":"AAAA,qBAAa,YAAY;IACvB,MAAM,CAAC,WAAW,IAAI,YAAY;IAIlC,eAAe,IAAI,GAAG;IAStB,iBAAiB,IAAI,GAAG;IAOxB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,EAAE;IAIpC,WAAW,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI;IAO5B,WAAW,IAAI,GAAG;CAOnB"}
|
|
@@ -19,4 +19,17 @@ export class StatsTracker {
|
|
|
19
19
|
getLeaderboard(limit) {
|
|
20
20
|
return [];
|
|
21
21
|
}
|
|
22
|
+
importState(json) {
|
|
23
|
+
// Restore state from serialized JSON
|
|
24
|
+
if (json && typeof json === 'object') {
|
|
25
|
+
Object.assign(this, json);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exportState() {
|
|
29
|
+
return {
|
|
30
|
+
generation: this.getCurrentStats().generation,
|
|
31
|
+
stats: this.getCurrentStats(),
|
|
32
|
+
records: this.getAllTimeRecords(),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
22
35
|
}
|
|
@@ -4,4 +4,13 @@ export declare const ThemeColors: {
|
|
|
4
4
|
};
|
|
5
5
|
export declare function getAccentRgba(alpha?: number): string;
|
|
6
6
|
export declare function getAccentHex(): string;
|
|
7
|
+
export declare function setCustomAccentColor(hex: string): void;
|
|
8
|
+
export declare function clearCustomAccentColor(): void;
|
|
9
|
+
export declare function getCurrentAccentHex(): string;
|
|
10
|
+
export declare function getAccentColor(): {
|
|
11
|
+
hex: string;
|
|
12
|
+
r: number;
|
|
13
|
+
g: number;
|
|
14
|
+
b: number;
|
|
15
|
+
};
|
|
7
16
|
//# sourceMappingURL=theme-colors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-colors.d.ts","sourceRoot":"","sources":["../../src/lib/theme-colors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW;;;CAGvB,CAAC;AAEF,wBAAgB,aAAa,CAAC,KAAK,GAAE,MAAU,GAAG,MAAM,CAEvD;AAED,wBAAgB,YAAY,IAAI,MAAM,CAErC"}
|
|
1
|
+
{"version":3,"file":"theme-colors.d.ts","sourceRoot":"","sources":["../../src/lib/theme-colors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW;;;CAGvB,CAAC;AAEF,wBAAgB,aAAa,CAAC,KAAK,GAAE,MAAU,GAAG,MAAM,CAEvD;AAED,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAID,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEtD;AAED,wBAAgB,sBAAsB,IAAI,IAAI,CAE7C;AAED,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C;AAED,wBAAgB,cAAc,IAAI;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAMjF"}
|
package/dist/lib/theme-colors.js
CHANGED
|
@@ -6,5 +6,22 @@ export function getAccentRgba(alpha = 1) {
|
|
|
6
6
|
return `rgba(0, 255, 255, ${alpha})`;
|
|
7
7
|
}
|
|
8
8
|
export function getAccentHex() {
|
|
9
|
-
return '#00ffff';
|
|
9
|
+
return customAccentColor ?? '#00ffff';
|
|
10
|
+
}
|
|
11
|
+
let customAccentColor = null;
|
|
12
|
+
export function setCustomAccentColor(hex) {
|
|
13
|
+
customAccentColor = hex;
|
|
14
|
+
}
|
|
15
|
+
export function clearCustomAccentColor() {
|
|
16
|
+
customAccentColor = null;
|
|
17
|
+
}
|
|
18
|
+
export function getCurrentAccentHex() {
|
|
19
|
+
return customAccentColor ?? '#00ffff';
|
|
20
|
+
}
|
|
21
|
+
export function getAccentColor() {
|
|
22
|
+
const hex = getCurrentAccentHex();
|
|
23
|
+
const r = parseInt(hex.slice(1, 3), 16);
|
|
24
|
+
const g = parseInt(hex.slice(3, 5), 16);
|
|
25
|
+
const b = parseInt(hex.slice(5, 7), 16);
|
|
26
|
+
return { hex, r, g, b };
|
|
10
27
|
}
|
package/dist/math/Matrix4.d.ts
CHANGED
|
@@ -1,9 +1,186 @@
|
|
|
1
1
|
import { Vector3 } from './Vector3';
|
|
2
|
+
/**
|
|
3
|
+
* 4x4 matrix using column-major storage (OpenGL convention).
|
|
4
|
+
*
|
|
5
|
+
* Memory layout (16-element array):
|
|
6
|
+
* | e[0] e[4] e[8] e[12] |
|
|
7
|
+
* | e[1] e[5] e[9] e[13] |
|
|
8
|
+
* | e[2] e[6] e[10] e[14] |
|
|
9
|
+
* | e[3] e[7] e[11] e[15] |
|
|
10
|
+
*/
|
|
2
11
|
export declare class Matrix4 {
|
|
3
|
-
|
|
12
|
+
elements: number[];
|
|
4
13
|
constructor(elements?: number[]);
|
|
5
14
|
static identity(): Matrix4;
|
|
15
|
+
static zero(): Matrix4;
|
|
6
16
|
static translation(x: number, y: number, z: number): Matrix4;
|
|
7
|
-
|
|
17
|
+
static translationFromVector(v: Vector3): Matrix4;
|
|
18
|
+
static scale(x: number, y: number, z: number): Matrix4;
|
|
19
|
+
static uniformScale(s: number): Matrix4;
|
|
20
|
+
/**
|
|
21
|
+
* Rotation around the X axis.
|
|
22
|
+
* Column-major: [5]=cos, [6]=sin, [9]=-sin, [10]=cos
|
|
23
|
+
*/
|
|
24
|
+
static rotationX(angle: number): Matrix4;
|
|
25
|
+
/**
|
|
26
|
+
* Rotation around the Y axis.
|
|
27
|
+
* Column-major: [0]=cos, [2]=-sin, [8]=sin, [10]=cos
|
|
28
|
+
*/
|
|
29
|
+
static rotationY(angle: number): Matrix4;
|
|
30
|
+
/**
|
|
31
|
+
* Rotation around the Z axis.
|
|
32
|
+
* Column-major: [0]=cos, [1]=sin, [4]=-sin, [5]=cos
|
|
33
|
+
*/
|
|
34
|
+
static rotationZ(angle: number): Matrix4;
|
|
35
|
+
/**
|
|
36
|
+
* Rotation around an arbitrary axis using Rodrigues' rotation formula.
|
|
37
|
+
*/
|
|
38
|
+
static rotationAxis(axis: Vector3, angle: number): Matrix4;
|
|
39
|
+
/**
|
|
40
|
+
* Compose rotation from Euler angles: R = Rx * Ry * Rz
|
|
41
|
+
*/
|
|
42
|
+
static rotationEuler(x: number, y: number, z: number): Matrix4;
|
|
43
|
+
/**
|
|
44
|
+
* Perspective projection matrix.
|
|
45
|
+
* elements[11] = -1, elements[15] = 0
|
|
46
|
+
*/
|
|
47
|
+
static perspective(fov: number, aspect: number, near: number, far: number): Matrix4;
|
|
48
|
+
/**
|
|
49
|
+
* Orthographic projection matrix.
|
|
50
|
+
* elements[15] = 1
|
|
51
|
+
*/
|
|
52
|
+
static orthographic(left: number, right: number, bottom: number, top: number, near: number, far: number): Matrix4;
|
|
53
|
+
/**
|
|
54
|
+
* Look-at view matrix.
|
|
55
|
+
* elements[15] = 1
|
|
56
|
+
*/
|
|
57
|
+
static lookAt(eye: Vector3, target: Vector3, up: Vector3): Matrix4;
|
|
58
|
+
/**
|
|
59
|
+
* Compose a TRS (Translation * Rotation * Scale) matrix.
|
|
60
|
+
* elements[12]=t.x, elements[0]=s.x*R[0], etc.
|
|
61
|
+
*/
|
|
62
|
+
static compose(translation: Vector3, rotation: Matrix4, scale: Vector3): Matrix4;
|
|
63
|
+
clone(): Matrix4;
|
|
64
|
+
copy(other: Matrix4): this;
|
|
65
|
+
/**
|
|
66
|
+
* Column-major matrix multiplication: this * other.
|
|
67
|
+
*
|
|
68
|
+
* Result column j = this * column j of other.
|
|
69
|
+
*/
|
|
70
|
+
multiply(other: Matrix4): Matrix4;
|
|
71
|
+
/**
|
|
72
|
+
* Premultiply: other * this
|
|
73
|
+
*/
|
|
74
|
+
premultiply(other: Matrix4): Matrix4;
|
|
75
|
+
/**
|
|
76
|
+
* Transform a point (applies full matrix including translation).
|
|
77
|
+
* Column-major: x = e[0]*vx + e[4]*vy + e[8]*vz + e[12]
|
|
78
|
+
*/
|
|
79
|
+
transformPoint(v: Vector3): Vector3;
|
|
80
|
+
/**
|
|
81
|
+
* Transform a direction vector (no translation applied).
|
|
82
|
+
*/
|
|
83
|
+
transformDirection(v: Vector3): Vector3;
|
|
84
|
+
/**
|
|
85
|
+
* Transform a normal vector by the inverse transpose of the upper-left 3x3.
|
|
86
|
+
* Result is normalized.
|
|
87
|
+
*/
|
|
88
|
+
transformNormal(v: Vector3): Vector3;
|
|
89
|
+
/**
|
|
90
|
+
* Transform an array of points.
|
|
91
|
+
*/
|
|
92
|
+
transformPoints(points: Vector3[]): Vector3[];
|
|
93
|
+
/**
|
|
94
|
+
* 4x4 determinant computed via cofactor expansion.
|
|
95
|
+
*/
|
|
96
|
+
determinant(): number;
|
|
97
|
+
/**
|
|
98
|
+
* Compute the inverse. Returns null if the matrix is singular (determinant ~ 0).
|
|
99
|
+
*/
|
|
100
|
+
inverse(): Matrix4 | null;
|
|
101
|
+
/**
|
|
102
|
+
* Transpose this matrix (swap rows and columns).
|
|
103
|
+
*/
|
|
104
|
+
transpose(): Matrix4;
|
|
105
|
+
/**
|
|
106
|
+
* Extract the translation component.
|
|
107
|
+
*/
|
|
108
|
+
getTranslation(): Vector3;
|
|
109
|
+
/**
|
|
110
|
+
* Extract the scale by computing the length of each column.
|
|
111
|
+
*/
|
|
112
|
+
getScale(): Vector3;
|
|
113
|
+
/**
|
|
114
|
+
* Extract the rotation matrix (scale removed, translation zeroed).
|
|
115
|
+
*/
|
|
116
|
+
getRotationMatrix(): Matrix4;
|
|
117
|
+
/**
|
|
118
|
+
* Decompose into translation, scale, and rotation components.
|
|
119
|
+
*/
|
|
120
|
+
decompose(): {
|
|
121
|
+
translation: Vector3;
|
|
122
|
+
scale: Vector3;
|
|
123
|
+
rotation: Matrix4;
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* Element-wise linear interpolation between this and other.
|
|
127
|
+
*/
|
|
128
|
+
lerp(other: Matrix4, t: number): Matrix4;
|
|
129
|
+
/**
|
|
130
|
+
* Element-wise equality check with optional epsilon.
|
|
131
|
+
*/
|
|
132
|
+
equals(other: Matrix4, epsilon?: number): boolean;
|
|
133
|
+
/**
|
|
134
|
+
* Return a copy of the elements array.
|
|
135
|
+
*/
|
|
136
|
+
toArray(): number[];
|
|
137
|
+
/**
|
|
138
|
+
* String representation with 4 decimal places.
|
|
139
|
+
*/
|
|
140
|
+
toString(): string;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* 3x3 matrix using row-major storage.
|
|
144
|
+
*
|
|
145
|
+
* Layout:
|
|
146
|
+
* | e[0] e[1] e[2] |
|
|
147
|
+
* | e[3] e[4] e[5] |
|
|
148
|
+
* | e[6] e[7] e[8] |
|
|
149
|
+
*/
|
|
150
|
+
export declare class Matrix3 {
|
|
151
|
+
elements: number[];
|
|
152
|
+
constructor(elements?: number[]);
|
|
153
|
+
static identity(): Matrix3;
|
|
154
|
+
/**
|
|
155
|
+
* Extract the upper-left 3x3 from a column-major Matrix4 into a row-major Matrix3.
|
|
156
|
+
*
|
|
157
|
+
* Mapping:
|
|
158
|
+
* m3[0]=m4[0], m3[1]=m4[4], m3[2]=m4[8]
|
|
159
|
+
* m3[3]=m4[1], m3[4]=m4[5], m3[5]=m4[9]
|
|
160
|
+
* m3[6]=m4[2], m3[7]=m4[6], m3[8]=m4[10]
|
|
161
|
+
*/
|
|
162
|
+
static fromMatrix4(m4: Matrix4): Matrix3;
|
|
163
|
+
clone(): Matrix3;
|
|
164
|
+
/**
|
|
165
|
+
* Row-major 3x3 multiplication: this * other.
|
|
166
|
+
*/
|
|
167
|
+
multiply(other: Matrix3): Matrix3;
|
|
168
|
+
/**
|
|
169
|
+
* Transform a Vector3 using row-major convention:
|
|
170
|
+
* x = e[0]*vx + e[1]*vy + e[2]*vz
|
|
171
|
+
*/
|
|
172
|
+
transformVector(v: Vector3): Vector3;
|
|
173
|
+
/**
|
|
174
|
+
* 3x3 determinant.
|
|
175
|
+
*/
|
|
176
|
+
determinant(): number;
|
|
177
|
+
/**
|
|
178
|
+
* Compute the inverse. Returns null if the matrix is singular.
|
|
179
|
+
*/
|
|
180
|
+
inverse(): Matrix3 | null;
|
|
181
|
+
/**
|
|
182
|
+
* Transpose the 3x3 matrix.
|
|
183
|
+
*/
|
|
184
|
+
transpose(): Matrix3;
|
|
8
185
|
}
|
|
9
186
|
//# sourceMappingURL=Matrix4.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Matrix4.d.ts","sourceRoot":"","sources":["../../src/math/Matrix4.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,qBAAa,OAAO;
|
|
1
|
+
{"version":3,"file":"Matrix4.d.ts","sourceRoot":"","sources":["../../src/math/Matrix4.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;;;;;;GAQG;AACH,qBAAa,OAAO;IACX,QAAQ,EAAE,MAAM,EAAE,CAAC;gBAEd,QAAQ,CAAC,EAAE,MAAM,EAAE;IAiB/B,MAAM,CAAC,QAAQ,IAAI,OAAO;IAS1B,MA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