@flighthq/geometry 0.5.1-next.973.788d3d7 → 0.6.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/README.md +2 -2
- package/dist/.tsbuildinfo.contract +1 -0
- package/dist/.tsbuildinfo.runtime +1 -0
- package/dist/aabb.d.ts +2 -1
- package/dist/aabb.d.ts.map +1 -1
- package/dist/aabb.js +3 -3
- package/dist/aabb.js.map +1 -1
- package/dist/boundingSphere.d.ts +2 -1
- package/dist/boundingSphere.d.ts.map +1 -1
- package/dist/boundingSphere.js +3 -3
- package/dist/boundingSphere.js.map +1 -1
- package/dist/capsule.d.ts +2 -1
- package/dist/capsule.d.ts.map +1 -1
- package/dist/capsule.js +2 -2
- package/dist/capsule.js.map +1 -1
- package/dist/contract.d.ts +2 -44
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.geometry-types.d.ts +2 -0
- package/dist/contract.geometry-types.d.ts.map +1 -0
- package/dist/contract.geometry-types.js +4 -0
- package/dist/contract.geometry-types.js.map +1 -0
- package/dist/contract.js +2 -44
- package/dist/contract.js.map +1 -1
- package/dist/enableGeometryPoolGuards.d.ts +10 -1
- package/dist/enableGeometryPoolGuards.d.ts.map +1 -1
- package/dist/enableGeometryPoolGuards.js +56 -23
- package/dist/enableGeometryPoolGuards.js.map +1 -1
- package/dist/frustum.d.ts +2 -1
- package/dist/frustum.d.ts.map +1 -1
- package/dist/frustum.js +3 -3
- package/dist/frustum.js.map +1 -1
- package/dist/geometryPoolGuards.d.ts +3 -3
- package/dist/geometryPoolGuards.d.ts.map +1 -1
- package/dist/geometryPoolGuards.js +3 -0
- package/dist/geometryPoolGuards.js.map +1 -1
- package/dist/index.d.ts +28 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +27 -1
- package/dist/index.js.map +1 -1
- package/dist/matrix.d.ts +3 -1
- package/dist/matrix.d.ts.map +1 -1
- package/dist/matrix.js +3 -2
- package/dist/matrix.js.map +1 -1
- package/dist/matrix3.d.ts +6 -4
- package/dist/matrix3.d.ts.map +1 -1
- package/dist/matrix3.js +13 -27
- package/dist/matrix3.js.map +1 -1
- package/dist/matrix3Pool.d.ts +1 -1
- package/dist/matrix3Pool.d.ts.map +1 -1
- package/dist/matrix3Pool.js +4 -4
- package/dist/matrix3Pool.js.map +1 -1
- package/dist/matrix4.d.ts +5 -3
- package/dist/matrix4.d.ts.map +1 -1
- package/dist/matrix4.js +12 -40
- package/dist/matrix4.js.map +1 -1
- package/dist/matrix4Pool.d.ts +1 -1
- package/dist/matrix4Pool.d.ts.map +1 -1
- package/dist/matrix4Pool.js +4 -4
- package/dist/matrix4Pool.js.map +1 -1
- package/dist/matrixPool.d.ts +1 -1
- package/dist/matrixPool.d.ts.map +1 -1
- package/dist/matrixPool.js +4 -4
- package/dist/matrixPool.js.map +1 -1
- package/dist/obb.d.ts +2 -1
- package/dist/obb.d.ts.map +1 -1
- package/dist/obb.js +2 -2
- package/dist/obb.js.map +1 -1
- package/dist/plane.d.ts +2 -1
- package/dist/plane.d.ts.map +1 -1
- package/dist/plane.js +2 -2
- package/dist/plane.js.map +1 -1
- package/dist/quaternion.d.ts +2 -1
- package/dist/quaternion.d.ts.map +1 -1
- package/dist/quaternion.js +2 -2
- package/dist/quaternion.js.map +1 -1
- package/dist/quaternionPool.d.ts +1 -1
- package/dist/quaternionPool.d.ts.map +1 -1
- package/dist/quaternionPool.js +4 -4
- package/dist/quaternionPool.js.map +1 -1
- package/dist/ray3d.d.ts +2 -1
- package/dist/ray3d.d.ts.map +1 -1
- package/dist/ray3d.js +3 -3
- package/dist/ray3d.js.map +1 -1
- package/dist/rectangle.d.ts +2 -1
- package/dist/rectangle.d.ts.map +1 -1
- package/dist/rectangle.js +2 -2
- package/dist/rectangle.js.map +1 -1
- package/dist/rectanglePool.d.ts +1 -1
- package/dist/rectanglePool.d.ts.map +1 -1
- package/dist/rectanglePool.js +4 -4
- package/dist/rectanglePool.js.map +1 -1
- package/dist/runtime.d.ts +29 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +29 -0
- package/dist/runtime.js.map +1 -0
- package/dist/transform2d.d.ts +2 -1
- package/dist/transform2d.d.ts.map +1 -1
- package/dist/transform2d.js +2 -2
- package/dist/transform2d.js.map +1 -1
- package/dist/transform3d.d.ts +2 -1
- package/dist/transform3d.d.ts.map +1 -1
- package/dist/transform3d.js +5 -5
- package/dist/transform3d.js.map +1 -1
- package/dist/types.d.ts +145 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/vector2.d.ts +2 -1
- package/dist/vector2.d.ts.map +1 -1
- package/dist/vector2.js +2 -2
- package/dist/vector2.js.map +1 -1
- package/dist/vector2Pool.d.ts +1 -1
- package/dist/vector2Pool.d.ts.map +1 -1
- package/dist/vector2Pool.js +4 -4
- package/dist/vector2Pool.js.map +1 -1
- package/dist/vector3.d.ts +2 -1
- package/dist/vector3.d.ts.map +1 -1
- package/dist/vector3.js +2 -2
- package/dist/vector3.js.map +1 -1
- package/dist/vector3Pool.d.ts +1 -1
- package/dist/vector3Pool.d.ts.map +1 -1
- package/dist/vector3Pool.js +4 -4
- package/dist/vector3Pool.js.map +1 -1
- package/dist/vector4.d.ts +2 -1
- package/dist/vector4.d.ts.map +1 -1
- package/dist/vector4.js +2 -2
- package/dist/vector4.js.map +1 -1
- package/dist/vector4Pool.d.ts +1 -1
- package/dist/vector4Pool.d.ts.map +1 -1
- package/dist/vector4Pool.js +4 -4
- package/dist/vector4Pool.js.map +1 -1
- package/package.json +7 -6
- package/src/aabb.test.ts +3 -2
- package/src/boundingSphere.test.ts +4 -3
- package/src/capsule.test.ts +1 -1
- package/src/enableGeometryPoolGuards.test.ts +31 -24
- package/src/frustum.test.ts +5 -4
- package/src/geometryPoolGuards.test.ts +14 -1
- package/src/matrix.test.ts +2 -2
- package/src/matrix3.test.ts +59 -63
- package/src/matrix3Pool.test.ts +2 -2
- package/src/matrix4.test.ts +42 -51
- package/src/matrix4Pool.test.ts +2 -2
- package/src/matrixPool.test.ts +2 -2
- package/src/obb.test.ts +7 -5
- package/src/plane.test.ts +1 -1
- package/src/quaternion.test.ts +2 -2
- package/src/ray3d.test.ts +8 -8
- package/src/rectangle.test.ts +2 -2
- package/src/rectanglePool.test.ts +2 -2
- package/src/transform2d.test.ts +2 -2
- package/src/transform3d.test.ts +4 -4
- package/src/typedarray.test.ts +1 -1
- package/src/vector2.test.ts +2 -2
- package/src/vector2Pool.test.ts +2 -2
- package/src/vector3.test.ts +2 -2
- package/src/vector3Pool.test.ts +2 -2
- package/src/vector4.test.ts +2 -2
- package/src/vector4Pool.test.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flighthq/geometry",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"author": "Joshua Granick and other contributors",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -32,19 +32,20 @@
|
|
|
32
32
|
"scripts": {
|
|
33
33
|
"build": "tsc -b",
|
|
34
34
|
"clean": "tsc -b --clean",
|
|
35
|
+
"generate": "tsx ../../scripts/generate-rust-package.ts --crate flight-geometry --package geometry",
|
|
36
|
+
"generate:check": "tsx ../../scripts/generate-rust-package.ts --crate flight-geometry --package geometry --check",
|
|
35
37
|
"test": "vitest run --config vitest.config.ts",
|
|
36
38
|
"test:watch": "vitest --watch --config vitest.config.ts",
|
|
37
39
|
"prepack": "npm run clean && npm run clean:dist && npm run build",
|
|
38
40
|
"clean:dist": "tsx ../../scripts/clean-package-dist.ts"
|
|
39
41
|
},
|
|
40
42
|
"dependencies": {
|
|
41
|
-
"@flighthq/entity": "0.
|
|
42
|
-
"@flighthq/log": "0.
|
|
43
|
-
"@flighthq/math": "0.
|
|
44
|
-
"@flighthq/types": "0.5.1-next.973.788d3d7"
|
|
43
|
+
"@flighthq/entity": "0.6.0",
|
|
44
|
+
"@flighthq/log": "0.6.0",
|
|
45
|
+
"@flighthq/math": "0.6.0"
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|
|
47
|
-
"typescript": "^
|
|
48
|
+
"typescript": "^7.0.2"
|
|
48
49
|
},
|
|
49
50
|
"description": "2D/3D math primitives: vectors, matrices, rectangles, and object pools",
|
|
50
51
|
"sideEffects": false
|
package/src/aabb.test.ts
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
createAabb,
|
|
5
5
|
createBoundingSphere,
|
|
6
6
|
createMatrix4,
|
|
7
|
+
createMatrix4FromValues,
|
|
7
8
|
createVector3,
|
|
8
9
|
expandAabbByPoint,
|
|
9
10
|
expandAabbBySphere,
|
|
@@ -22,7 +23,7 @@ import {
|
|
|
22
23
|
unionAabb,
|
|
23
24
|
} from '@flighthq/geometry/contract';
|
|
24
25
|
|
|
25
|
-
import { initializeAabb } from './aabb';
|
|
26
|
+
import { initializeAabb } from './aabb.ts';
|
|
26
27
|
|
|
27
28
|
describe('cloneAabb', () => {
|
|
28
29
|
it('creates an independent copy with independent corner vectors', () => {
|
|
@@ -351,7 +352,7 @@ describe('transformAabbByMatrix4', () => {
|
|
|
351
352
|
const a = createAabb(-1, -1, -1, 1, 1, 1);
|
|
352
353
|
// Column-major 45-degree z rotation.
|
|
353
354
|
const c = Math.SQRT1_2;
|
|
354
|
-
const m =
|
|
355
|
+
const m = createMatrix4FromValues(c, c, 0, 0, -c, c, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
|
|
355
356
|
const out = createAabb();
|
|
356
357
|
transformAabbByMatrix4(out, a, m);
|
|
357
358
|
// Rotated unit box spans +/- sqrt(2) in x and y.
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
createAabb,
|
|
5
5
|
createBoundingSphere,
|
|
6
6
|
createMatrix4,
|
|
7
|
+
createMatrix4FromValues,
|
|
7
8
|
createVector3,
|
|
8
9
|
containsBoundingSpherePoint,
|
|
9
10
|
getClosestPointOnBoundingSphere,
|
|
@@ -15,7 +16,7 @@ import {
|
|
|
15
16
|
transformBoundingSphereByMatrix4,
|
|
16
17
|
} from '@flighthq/geometry/contract';
|
|
17
18
|
|
|
18
|
-
import { initializeBoundingSphere } from './boundingSphere';
|
|
19
|
+
import { initializeBoundingSphere } from './boundingSphere.ts';
|
|
19
20
|
|
|
20
21
|
describe('cloneBoundingSphere', () => {
|
|
21
22
|
it('creates an independent copy with an independent center', () => {
|
|
@@ -264,7 +265,7 @@ describe('transformBoundingSphereByMatrix4', () => {
|
|
|
264
265
|
it('scales the radius by the largest axis scale', () => {
|
|
265
266
|
const s = createBoundingSphere(0, 0, 0, 1);
|
|
266
267
|
// Column-major non-uniform scale diag(2,3,4).
|
|
267
|
-
const m =
|
|
268
|
+
const m = createMatrix4FromValues(2, 0, 0, 0, 0, 3, 0, 0, 0, 0, 4, 0, 0, 0, 0, 1);
|
|
268
269
|
const out = createBoundingSphere();
|
|
269
270
|
transformBoundingSphereByMatrix4(out, s, m);
|
|
270
271
|
expect(out.radius).toBeCloseTo(4, 6);
|
|
@@ -285,7 +286,7 @@ describe('transformBoundingSphereByMatrix4', () => {
|
|
|
285
286
|
// move it further from zero and, under a scale below 1, could carry it up past zero into a
|
|
286
287
|
// real sphere that was never there.
|
|
287
288
|
const empty = createBoundingSphere(0, 0, 0, -1);
|
|
288
|
-
const m =
|
|
289
|
+
const m = createMatrix4FromValues(3, 0, 0, 0, 0, 3, 0, 0, 0, 0, 3, 0, 0, 0, 0, 1);
|
|
289
290
|
const out = createBoundingSphere();
|
|
290
291
|
transformBoundingSphereByMatrix4(out, empty, m);
|
|
291
292
|
expect(out.radius).toBe(-1);
|
package/src/capsule.test.ts
CHANGED
|
@@ -1,35 +1,40 @@
|
|
|
1
|
+
import type { LogState } from '@flighthq/log/contract';
|
|
1
2
|
import {
|
|
2
3
|
addLogSink,
|
|
3
|
-
|
|
4
|
+
clearMemoryLogSink,
|
|
5
|
+
createLogState,
|
|
4
6
|
createMemoryLogSink,
|
|
5
7
|
getMemoryLogSinkEntries,
|
|
6
|
-
removeLogSink,
|
|
7
8
|
} from '@flighthq/log/contract';
|
|
8
|
-
import type { LogEntry } from '@flighthq/
|
|
9
|
+
import type { LogEntry } from '@flighthq/log/contract';
|
|
9
10
|
|
|
10
11
|
import {
|
|
11
12
|
areGeometryPoolGuardsEnabled,
|
|
12
13
|
disableGeometryPoolGuards,
|
|
13
14
|
enableGeometryPoolGuards,
|
|
14
|
-
} from './enableGeometryPoolGuards';
|
|
15
|
-
import { acquireMatrix3, clearMatrix3Pool, releaseMatrix3 } from './matrix3Pool';
|
|
16
|
-
import { acquireMatrix4, clearMatrix4Pool, releaseMatrix4 } from './matrix4Pool';
|
|
17
|
-
import { acquireMatrix, clearMatrixPool, releaseMatrix } from './matrixPool';
|
|
18
|
-
import { acquireQuaternion, clearQuaternionPool, releaseQuaternion } from './quaternionPool';
|
|
19
|
-
import { acquireRectangle, clearRectanglePool, releaseRectangle } from './rectanglePool';
|
|
20
|
-
import { acquireVector2, clearVector2Pool, releaseVector2 } from './vector2Pool';
|
|
21
|
-
import { acquireVector3, clearVector3Pool, releaseVector3 } from './vector3Pool';
|
|
22
|
-
import { acquireVector4, clearVector4Pool, releaseVector4 } from './vector4Pool';
|
|
15
|
+
} from './enableGeometryPoolGuards.ts';
|
|
16
|
+
import { acquireMatrix3, clearMatrix3Pool, releaseMatrix3 } from './matrix3Pool.ts';
|
|
17
|
+
import { acquireMatrix4, clearMatrix4Pool, releaseMatrix4 } from './matrix4Pool.ts';
|
|
18
|
+
import { acquireMatrix, clearMatrixPool, releaseMatrix } from './matrixPool.ts';
|
|
19
|
+
import { acquireQuaternion, clearQuaternionPool, releaseQuaternion } from './quaternionPool.ts';
|
|
20
|
+
import { acquireRectangle, clearRectanglePool, releaseRectangle } from './rectanglePool.ts';
|
|
21
|
+
import { acquireVector2, clearVector2Pool, releaseVector2 } from './vector2Pool.ts';
|
|
22
|
+
import { acquireVector3, clearVector3Pool, releaseVector3 } from './vector3Pool.ts';
|
|
23
|
+
import { acquireVector4, clearVector4Pool, releaseVector4 } from './vector4Pool.ts';
|
|
23
24
|
|
|
25
|
+
// Each test gets its own caller-owned log state, so once-keys never leak between tests.
|
|
24
26
|
function captureLog(run: () => void): readonly LogEntry[] {
|
|
25
27
|
const sink = createMemoryLogSink(16);
|
|
26
|
-
addLogSink(sink.sink);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
addLogSink(logState, sink.sink);
|
|
29
|
+
run();
|
|
30
|
+
const entries: LogEntry[] = [];
|
|
31
|
+
getMemoryLogSinkEntries(entries, sink);
|
|
32
|
+
clearMemoryLogSink(sink);
|
|
33
|
+
return entries;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function clock(): number {
|
|
37
|
+
return 0;
|
|
33
38
|
}
|
|
34
39
|
|
|
35
40
|
function clearPools(): void {
|
|
@@ -55,7 +60,7 @@ function messageOf(entry: Readonly<LogEntry>): string {
|
|
|
55
60
|
}
|
|
56
61
|
|
|
57
62
|
beforeEach(() => {
|
|
58
|
-
|
|
63
|
+
logState = createLogState();
|
|
59
64
|
clearPools();
|
|
60
65
|
});
|
|
61
66
|
|
|
@@ -67,7 +72,7 @@ afterEach(() => {
|
|
|
67
72
|
describe('areGeometryPoolGuardsEnabled', () => {
|
|
68
73
|
it('reports whether the pool release diagnostic is installed', () => {
|
|
69
74
|
expect(areGeometryPoolGuardsEnabled()).toBe(false);
|
|
70
|
-
enableGeometryPoolGuards();
|
|
75
|
+
enableGeometryPoolGuards(logState, clock);
|
|
71
76
|
expect(areGeometryPoolGuardsEnabled()).toBe(true);
|
|
72
77
|
disableGeometryPoolGuards();
|
|
73
78
|
expect(areGeometryPoolGuardsEnabled()).toBe(false);
|
|
@@ -76,7 +81,7 @@ describe('areGeometryPoolGuardsEnabled', () => {
|
|
|
76
81
|
|
|
77
82
|
describe('disableGeometryPoolGuards', () => {
|
|
78
83
|
it('restores the production-default silent release path', () => {
|
|
79
|
-
enableGeometryPoolGuards();
|
|
84
|
+
enableGeometryPoolGuards(logState, clock);
|
|
80
85
|
disableGeometryPoolGuards();
|
|
81
86
|
const entries = captureLog(() => doubleRelease(acquireVector2, releaseVector2));
|
|
82
87
|
expect(entries).toHaveLength(0);
|
|
@@ -84,9 +89,9 @@ describe('disableGeometryPoolGuards', () => {
|
|
|
84
89
|
});
|
|
85
90
|
|
|
86
91
|
describe('enableGeometryPoolGuards', () => {
|
|
87
|
-
// ONE firing test deliberately consumes all eight
|
|
92
|
+
// ONE firing test deliberately consumes all eight logOnce keys of this test's log state.
|
|
88
93
|
it('warns once for a double release from every geometry pool and stays silent for valid brackets', () => {
|
|
89
|
-
enableGeometryPoolGuards();
|
|
94
|
+
enableGeometryPoolGuards(logState, clock);
|
|
90
95
|
|
|
91
96
|
const pairedEntries = captureLog(() => {
|
|
92
97
|
releaseMatrix(acquireMatrix());
|
|
@@ -128,3 +133,5 @@ describe('enableGeometryPoolGuards', () => {
|
|
|
128
133
|
}
|
|
129
134
|
});
|
|
130
135
|
});
|
|
136
|
+
|
|
137
|
+
let logState: LogState = createLogState();
|
package/src/frustum.test.ts
CHANGED
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
createBoundingSphere,
|
|
4
4
|
createFrustum,
|
|
5
5
|
createMatrix4,
|
|
6
|
+
createMatrix4FromValues,
|
|
6
7
|
createPerspectiveMatrix4,
|
|
7
8
|
createVector3,
|
|
8
9
|
getFrustumCorners,
|
|
@@ -16,9 +17,9 @@ import {
|
|
|
16
17
|
setFrustumFromMatrix4,
|
|
17
18
|
setMatrix4LookAt,
|
|
18
19
|
} from '@flighthq/geometry/contract';
|
|
19
|
-
import type { Matrix4 } from '@flighthq/types/contract';
|
|
20
20
|
|
|
21
|
-
import { initializeFrustum } from './frustum';
|
|
21
|
+
import { initializeFrustum } from './frustum.ts';
|
|
22
|
+
import type { Matrix4 } from './types.ts';
|
|
22
23
|
|
|
23
24
|
// View-projection for a camera at (0,0,5) looking toward the origin down -z.
|
|
24
25
|
function createTestViewProjection(): Matrix4 {
|
|
@@ -89,7 +90,7 @@ describe('getFrustumCorners', () => {
|
|
|
89
90
|
// point at infinity. Passing the coordinates through undivided keeps the corner finite, so a
|
|
90
91
|
// caller fitting bounds around these corners gets a wrong box rather than an infinite one.
|
|
91
92
|
const corners = Array.from({ length: 8 }, () => createVector3());
|
|
92
|
-
getFrustumCorners(corners,
|
|
93
|
+
getFrustumCorners(corners, createMatrix4FromValues(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0));
|
|
93
94
|
for (const corner of corners) {
|
|
94
95
|
expect(Number.isFinite(corner.x)).toBe(true);
|
|
95
96
|
expect(Number.isFinite(corner.y)).toBe(true);
|
|
@@ -219,7 +220,7 @@ describe('setFrustumFromMatrix4', () => {
|
|
|
219
220
|
// culls against this frustum gets consistent rejections instead of NaN comparisons, which are
|
|
220
221
|
// false in both directions and would let a box pass and fail the same test.
|
|
221
222
|
const f = createFrustum();
|
|
222
|
-
setFrustumFromMatrix4(f,
|
|
223
|
+
setFrustumFromMatrix4(f, createMatrix4FromValues(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
|
|
223
224
|
for (const plane of [f.near, f.far, f.left, f.right, f.top, f.bottom]) {
|
|
224
225
|
expect(Number.isFinite(plane.a)).toBe(true);
|
|
225
226
|
expect(Number.isFinite(plane.b)).toBe(true);
|
|
@@ -1,9 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
geometryPoolReleaseGuard,
|
|
3
|
+
getGeometryPoolReleaseGuard,
|
|
4
|
+
setGeometryPoolReleaseGuard,
|
|
5
|
+
} from './geometryPoolGuards.ts';
|
|
2
6
|
|
|
3
7
|
afterEach(() => {
|
|
4
8
|
setGeometryPoolReleaseGuard(null);
|
|
5
9
|
});
|
|
6
10
|
|
|
11
|
+
describe('getGeometryPoolReleaseGuard', () => {
|
|
12
|
+
it('reads the installed release callback, or null when none is installed', () => {
|
|
13
|
+
expect(getGeometryPoolReleaseGuard()).toBeNull();
|
|
14
|
+
const guard = (): void => {};
|
|
15
|
+
setGeometryPoolReleaseGuard(guard);
|
|
16
|
+
expect(getGeometryPoolReleaseGuard()).toBe(guard);
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
7
20
|
describe('setGeometryPoolReleaseGuard', () => {
|
|
8
21
|
it('installs and removes the internal release callback', () => {
|
|
9
22
|
const guard = (): void => {};
|
package/src/matrix.test.ts
CHANGED
|
@@ -41,9 +41,9 @@ import {
|
|
|
41
41
|
translateMatrixByVectorXY,
|
|
42
42
|
writeMatrixToFloat32Array,
|
|
43
43
|
} from '@flighthq/geometry/contract';
|
|
44
|
-
import type { Matrix, Matrix3Like, Matrix4Like } from '@flighthq/types/contract';
|
|
45
44
|
|
|
46
|
-
import { initializeMatrix } from './matrix';
|
|
45
|
+
import { initializeMatrix } from './matrix.ts';
|
|
46
|
+
import type { Matrix, Matrix3Like, Matrix4Like } from './types.ts';
|
|
47
47
|
|
|
48
48
|
describe('cloneMatrix', () => {
|
|
49
49
|
it('should clone the matrix3x2 correctly', () => {
|