@flighthq/physics2d 0.5.1-next.904.b545d9c → 0.5.1-next.905.5fbf787

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 CHANGED
@@ -13,5 +13,5 @@ Import the supported application-facing API from `@flighthq/physics2d`. The `@fl
13
13
  This package is part of the locked-version Flight SDK graph. Applications may instead install and import `@flighthq/sdk` when package-level tree shaking is sufficient.
14
14
 
15
15
  - [Flight project](https://github.com/flighthq/flight)
16
- - [Source for @flighthq/physics2d@0.5.1-next.904.b545d9c](https://github.com/flighthq/flight/tree/b545d9cfe622400923a81685c78547f2be54eff5/packages/physics2d)
17
- - [License](https://github.com/flighthq/flight/blob/b545d9cfe622400923a81685c78547f2be54eff5/LICENSE.md)
16
+ - [Source for @flighthq/physics2d@0.5.1-next.905.5fbf787](https://github.com/flighthq/flight/tree/5fbf7874064c384307542d68b4dcb6a895ff0dcf/packages/physics2d)
17
+ - [License](https://github.com/flighthq/flight/blob/5fbf7874064c384307542d68b4dcb6a895ff0dcf/LICENSE.md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flighthq/physics2d",
3
- "version": "0.5.1-next.904.b545d9c",
3
+ "version": "0.5.1-next.905.5fbf787",
4
4
  "author": "Joshua Granick and other contributors",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -38,13 +38,13 @@
38
38
  "clean:dist": "tsx ../../scripts/clean-package-dist.ts"
39
39
  },
40
40
  "dependencies": {
41
- "@flighthq/collision": "0.5.1-next.904.b545d9c",
42
- "@flighthq/entity": "0.5.1-next.904.b545d9c",
43
- "@flighthq/log": "0.5.1-next.904.b545d9c",
44
- "@flighthq/math": "0.5.1-next.904.b545d9c",
45
- "@flighthq/node": "0.5.1-next.904.b545d9c",
46
- "@flighthq/spatial": "0.5.1-next.904.b545d9c",
47
- "@flighthq/types": "0.5.1-next.904.b545d9c"
41
+ "@flighthq/collision": "0.5.1-next.905.5fbf787",
42
+ "@flighthq/entity": "0.5.1-next.905.5fbf787",
43
+ "@flighthq/log": "0.5.1-next.905.5fbf787",
44
+ "@flighthq/math": "0.5.1-next.905.5fbf787",
45
+ "@flighthq/node": "0.5.1-next.905.5fbf787",
46
+ "@flighthq/spatial": "0.5.1-next.905.5fbf787",
47
+ "@flighthq/types": "0.5.1-next.905.5fbf787"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@flighthq/scene2d": "*",
@@ -4,6 +4,12 @@ import { describe, expect, it } from 'vitest';
4
4
 
5
5
  import {
6
6
  createPhysics2DColliderWorldShape,
7
+ initializeCollisionCapsule2D,
8
+ initializeCollisionCircle2D,
9
+ initializeCollisionObb2D,
10
+ initializeCollisionPoint2D,
11
+ initializeCollisionPolygon2D,
12
+ initializeCollisionSegment2D,
7
13
  updatePhysics2DColliderWorldShape,
8
14
  writePhysics2DColliderBounds,
9
15
  } from './colliderTransform';
@@ -35,6 +41,41 @@ describe('createPhysics2DColliderWorldShape', () => {
35
41
  });
36
42
  });
37
43
 
44
+ describe('initializeCollisionCapsule2D', () => {
45
+ it('is the construction initializer of createCollisionCapsule2D', () => {
46
+ expect(typeof initializeCollisionCapsule2D).toBe('function');
47
+ });
48
+ });
49
+
50
+ describe('initializeCollisionCircle2D', () => {
51
+ it('is the construction initializer of createCollisionCircle2D', () => {
52
+ expect(typeof initializeCollisionCircle2D).toBe('function');
53
+ });
54
+ });
55
+ describe('initializeCollisionObb2D', () => {
56
+ it('is the construction initializer of createCollisionObb2D', () => {
57
+ expect(typeof initializeCollisionObb2D).toBe('function');
58
+ });
59
+ });
60
+
61
+ describe('initializeCollisionPoint2D', () => {
62
+ it('is the construction initializer of createCollisionPoint2D', () => {
63
+ expect(typeof initializeCollisionPoint2D).toBe('function');
64
+ });
65
+ });
66
+
67
+ describe('initializeCollisionPolygon2D', () => {
68
+ it('is the construction initializer of createCollisionPolygon2D', () => {
69
+ expect(typeof initializeCollisionPolygon2D).toBe('function');
70
+ });
71
+ });
72
+
73
+ describe('initializeCollisionSegment2D', () => {
74
+ it('is the construction initializer of createCollisionSegment2D', () => {
75
+ expect(typeof initializeCollisionSegment2D).toBe('function');
76
+ });
77
+ });
78
+
38
79
  describe('updatePhysics2DColliderWorldShape', () => {
39
80
  it('carries a capsule by its endpoints and leaves its radius alone', () => {
40
81
  // Unlike an axis-aligned box, a capsule does not promote to another kind under rotation: a rotation
@@ -4,7 +4,11 @@ import { EntityRuntimeKey } from '@flighthq/types/contract';
4
4
  import { describe, expect, it } from 'vitest';
5
5
 
6
6
  import { updatePhysics2DColliderWorldShape } from './colliderTransform';
7
- import { createPhysics2DDebugGeometry, writePhysics2DDebugGeometry } from './debugGeometry';
7
+ import {
8
+ createPhysics2DDebugGeometry,
9
+ initializePhysics2DDebugGeometry,
10
+ writePhysics2DDebugGeometry,
11
+ } from './debugGeometry';
8
12
  import { addPhysics2DJoint } from './jointRegistry';
9
13
  import { addPhysics2DBody, createPhysics2DCollider, createPhysics2DWorld, createRigidBody2D } from './world';
10
14
 
@@ -51,6 +55,11 @@ describe('createPhysics2DDebugGeometry', () => {
51
55
  });
52
56
  });
53
57
 
58
+ describe('initializePhysics2DDebugGeometry', () => {
59
+ it('is the construction initializer of createPhysics2DDebugGeometry', () => {
60
+ expect(typeof initializePhysics2DDebugGeometry).toBe('function');
61
+ });
62
+ });
54
63
  describe('writePhysics2DDebugGeometry', () => {
55
64
  it('draws a capsule as two end discs and the two lines tangent to them', () => {
56
65
  // Its actual silhouette. Two circles alone would leave the straight sides missing, and a single
@@ -11,6 +11,15 @@ import {
11
11
  createPhysics2DRopeJoint,
12
12
  createPhysics2DWeldJoint,
13
13
  createPhysics2DWheelJoint,
14
+ initializePhysics2DDistanceJoint,
15
+ initializePhysics2DGearJoint,
16
+ initializePhysics2DMouseJoint,
17
+ initializePhysics2DPrismaticJoint,
18
+ initializePhysics2DPulleyJoint,
19
+ initializePhysics2DRevoluteJoint,
20
+ initializePhysics2DRopeJoint,
21
+ initializePhysics2DWeldJoint,
22
+ initializePhysics2DWheelJoint,
14
23
  } from './jointFactories';
15
24
 
16
25
  describe('createPhysics2DDistanceJoint', () => {
@@ -154,3 +163,56 @@ describe('createPhysics2DWheelJoint', () => {
154
163
  });
155
164
  });
156
165
  });
166
+ describe('initializePhysics2DDistanceJoint', () => {
167
+ it('is the construction initializer of createPhysics2DDistanceJoint', () => {
168
+ expect(typeof initializePhysics2DDistanceJoint).toBe('function');
169
+ });
170
+ });
171
+
172
+ describe('initializePhysics2DGearJoint', () => {
173
+ it('is the construction initializer of createPhysics2DGearJoint', () => {
174
+ expect(typeof initializePhysics2DGearJoint).toBe('function');
175
+ });
176
+ });
177
+
178
+ describe('initializePhysics2DMouseJoint', () => {
179
+ it('is the construction initializer of createPhysics2DMouseJoint', () => {
180
+ expect(typeof initializePhysics2DMouseJoint).toBe('function');
181
+ });
182
+ });
183
+
184
+ describe('initializePhysics2DPrismaticJoint', () => {
185
+ it('is the construction initializer of createPhysics2DPrismaticJoint', () => {
186
+ expect(typeof initializePhysics2DPrismaticJoint).toBe('function');
187
+ });
188
+ });
189
+
190
+ describe('initializePhysics2DPulleyJoint', () => {
191
+ it('is the construction initializer of createPhysics2DPulleyJoint', () => {
192
+ expect(typeof initializePhysics2DPulleyJoint).toBe('function');
193
+ });
194
+ });
195
+
196
+ describe('initializePhysics2DRevoluteJoint', () => {
197
+ it('is the construction initializer of createPhysics2DRevoluteJoint', () => {
198
+ expect(typeof initializePhysics2DRevoluteJoint).toBe('function');
199
+ });
200
+ });
201
+
202
+ describe('initializePhysics2DRopeJoint', () => {
203
+ it('is the construction initializer of createPhysics2DRopeJoint', () => {
204
+ expect(typeof initializePhysics2DRopeJoint).toBe('function');
205
+ });
206
+ });
207
+
208
+ describe('initializePhysics2DWeldJoint', () => {
209
+ it('is the construction initializer of createPhysics2DWeldJoint', () => {
210
+ expect(typeof initializePhysics2DWeldJoint).toBe('function');
211
+ });
212
+ });
213
+
214
+ describe('initializePhysics2DWheelJoint', () => {
215
+ it('is the construction initializer of createPhysics2DWheelJoint', () => {
216
+ expect(typeof initializePhysics2DWheelJoint).toBe('function');
217
+ });
218
+ });
@@ -3,7 +3,11 @@ import type { Physics2DJoint, Physics2DJointReaction, Physics2DWorld, RigidBody2
3
3
  import { EntityRuntimeKey } from '@flighthq/types/contract';
4
4
  import { describe, expect, it } from 'vitest';
5
5
 
6
- import { createPhysics2DJointReaction, writePhysics2DJointReaction } from './jointReactions';
6
+ import {
7
+ createPhysics2DJointReaction,
8
+ initializePhysics2DJointReaction,
9
+ writePhysics2DJointReaction,
10
+ } from './jointReactions';
7
11
  import { addPhysics2DJoint } from './jointRegistry';
8
12
  import {
9
13
  Physics2DDistanceJointKind,
@@ -91,6 +95,11 @@ describe('createPhysics2DJointReaction', () => {
91
95
  });
92
96
  });
93
97
 
98
+ describe('initializePhysics2DJointReaction', () => {
99
+ it('is the construction initializer of createPhysics2DJointReaction', () => {
100
+ expect(typeof initializePhysics2DJointReaction).toBe('function');
101
+ });
102
+ });
94
103
  describe('writePhysics2DJointReaction', () => {
95
104
  it('reports a hanging weight for every kind that carries one along its axis', () => {
96
105
  // Five kinds, one law. Each holds the same bob against the same gravity by a different mechanism —
package/src/world.test.ts CHANGED
@@ -5,6 +5,7 @@ import { describe, expect, it } from 'vitest';
5
5
  import { addPhysics2DJoint, registerPhysics2DJointSolver } from './jointRegistry';
6
6
  import { stepPhysics2D } from './step';
7
7
  import {
8
+ Physics2DWorldVersion,
8
9
  addPhysics2DBody,
9
10
  addPhysics2DCollider,
10
11
  applyPhysics2DForce,
@@ -12,22 +13,24 @@ import {
12
13
  applyPhysics2DLinearImpulse,
13
14
  applyPhysics2DLinearImpulseAtPoint,
14
15
  applyPhysics2DTorque,
15
- findPhysics2DBody,
16
16
  createPhysics2DCollider,
17
17
  createPhysics2DSolverConfig,
18
18
  createPhysics2DWorld,
19
19
  createRigidBody2D,
20
+ findPhysics2DBody,
20
21
  hydratePhysics2DWorld,
22
+ initializePhysics2DCollider,
23
+ initializePhysics2DWorld,
24
+ initializeRigidBody2D,
21
25
  invalidatePhysics2DCollider,
22
26
  isPhysics2DPairOrdered,
23
27
  removePhysics2DBody,
24
28
  removePhysics2DCollider,
25
- setPhysics2DBodyFixedRotation,
26
29
  setPhysics2DBodyBullet,
30
+ setPhysics2DBodyFixedRotation,
27
31
  setPhysics2DBodySleepEnabled,
28
32
  setPhysics2DBodyTransform,
29
33
  setPhysics2DBodyType,
30
- Physics2DWorldVersion,
31
34
  } from './world';
32
35
 
33
36
  const STONE = { density: 1, friction: 0.3, restitution: 0 };
@@ -387,6 +390,24 @@ describe('hydratePhysics2DWorld', () => {
387
390
  });
388
391
  });
389
392
 
393
+ describe('initializePhysics2DCollider', () => {
394
+ it('is the construction initializer of createPhysics2DCollider', () => {
395
+ expect(typeof initializePhysics2DCollider).toBe('function');
396
+ });
397
+ });
398
+
399
+ describe('initializePhysics2DWorld', () => {
400
+ it('is the construction initializer of createPhysics2DWorld', () => {
401
+ expect(typeof initializePhysics2DWorld).toBe('function');
402
+ });
403
+ });
404
+
405
+ describe('initializeRigidBody2D', () => {
406
+ it('is the construction initializer of createRigidBody2D', () => {
407
+ expect(typeof initializeRigidBody2D).toBe('function');
408
+ });
409
+ });
410
+
390
411
  describe('invalidatePhysics2DCollider', () => {
391
412
  it('rebuilds changed shape storage, mass data, and broadphase bounds', () => {
392
413
  const world = createPhysics2DWorld(0, 0);
@@ -649,7 +670,6 @@ describe('setPhysics2DBodyFixedRotation', () => {
649
670
  expect(setPhysics2DBodyFixedRotation(createPhysics2DWorld(), boxBody(0, 0), true)).toBe(false);
650
671
  });
651
672
  });
652
-
653
673
  describe('setPhysics2DBodySleepEnabled', () => {
654
674
  it('wakes on either transition and requires a new stillness interval when re-enabled', () => {
655
675
  const world = createPhysics2DWorld(0, 0);
@@ -7,6 +7,9 @@ import {
7
7
  createPhysics2DQueryResult,
8
8
  createPhysics2DRayResult,
9
9
  createPhysics2DShapeCastResult,
10
+ initializePhysics2DQueryResult,
11
+ initializePhysics2DRayResult,
12
+ initializePhysics2DShapeCastResult,
10
13
  queryPhysics2DPoint,
11
14
  queryPhysics2DRay,
12
15
  queryPhysics2DRayClosest,
@@ -63,6 +66,24 @@ describe('createPhysics2DShapeCastResult', () => {
63
66
  });
64
67
  });
65
68
 
69
+ describe('initializePhysics2DQueryResult', () => {
70
+ it('is the construction initializer of createPhysics2DQueryResult', () => {
71
+ expect(typeof initializePhysics2DQueryResult).toBe('function');
72
+ });
73
+ });
74
+
75
+ describe('initializePhysics2DRayResult', () => {
76
+ it('is the construction initializer of createPhysics2DRayResult', () => {
77
+ expect(typeof initializePhysics2DRayResult).toBe('function');
78
+ });
79
+ });
80
+
81
+ describe('initializePhysics2DShapeCastResult', () => {
82
+ it('is the construction initializer of createPhysics2DShapeCastResult', () => {
83
+ expect(typeof initializePhysics2DShapeCastResult).toBe('function');
84
+ });
85
+ });
86
+
66
87
  describe('queryPhysics2DPoint', () => {
67
88
  it('keeps broadphase candidates isolated when a filter getter starts a nested query', () => {
68
89
  const world = createPhysics2DWorld(0, 0);
@@ -254,7 +275,6 @@ describe('queryPhysics2DRay', () => {
254
275
  expect(out.hits[0]).toMatchObject({ body, fraction: 0, normalX: 0, normalY: 0, x: 3, y: 4 });
255
276
  });
256
277
  });
257
-
258
278
  describe('queryPhysics2DRayClosest', () => {
259
279
  it('writes only the deterministic nearest filtered hit and reuses its retained record', () => {
260
280
  const world = createPhysics2DWorld(0, 0);