@aura3d/physics 1.5.1 → 2.0.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/ArcadeCharacterController.d.ts +53 -0
- package/dist/ArcadeCharacterController.d.ts.map +1 -0
- package/dist/ArcadeCharacterController.js +98 -0
- package/dist/ArcadeCharacterController.js.map +1 -0
- package/dist/ArcadeVehicleTelemetry.d.ts +162 -0
- package/dist/ArcadeVehicleTelemetry.d.ts.map +1 -0
- package/dist/ArcadeVehicleTelemetry.js +363 -0
- package/dist/ArcadeVehicleTelemetry.js.map +1 -0
- package/dist/CharacterController.d.ts +52 -0
- package/dist/CharacterController.d.ts.map +1 -1
- package/dist/CharacterController.js +380 -7
- package/dist/CharacterController.js.map +1 -1
- package/dist/Constraint.d.ts +20 -4
- package/dist/Constraint.d.ts.map +1 -1
- package/dist/Constraint.js +34 -60
- package/dist/Constraint.js.map +1 -1
- package/dist/FightingCharacterController.d.ts +32 -0
- package/dist/FightingCharacterController.d.ts.map +1 -0
- package/dist/FightingCharacterController.js +76 -0
- package/dist/FightingCharacterController.js.map +1 -0
- package/dist/MeshBVH.d.ts +72 -0
- package/dist/MeshBVH.d.ts.map +1 -0
- package/dist/MeshBVH.js +244 -0
- package/dist/MeshBVH.js.map +1 -0
- package/dist/PathFollowDriver.d.ts +162 -0
- package/dist/PathFollowDriver.d.ts.map +1 -0
- package/dist/PathFollowDriver.js +163 -0
- package/dist/PathFollowDriver.js.map +1 -0
- package/dist/PhysicsDebugDraw.d.ts +40 -1
- package/dist/PhysicsDebugDraw.d.ts.map +1 -1
- package/dist/PhysicsDebugDraw.js +87 -17
- package/dist/PhysicsDebugDraw.js.map +1 -1
- package/dist/PhysicsWorld.d.ts +37 -18
- package/dist/PhysicsWorld.d.ts.map +1 -1
- package/dist/PhysicsWorld.js +231 -630
- package/dist/PhysicsWorld.js.map +1 -1
- package/dist/RacingLineProfile.d.ts +116 -0
- package/dist/RacingLineProfile.d.ts.map +1 -0
- package/dist/RacingLineProfile.js +181 -0
- package/dist/RacingLineProfile.js.map +1 -0
- package/dist/Raycast.d.ts +11 -0
- package/dist/Raycast.d.ts.map +1 -1
- package/dist/Raycast.js +62 -8
- package/dist/Raycast.js.map +1 -1
- package/dist/RigidBody.d.ts +16 -9
- package/dist/RigidBody.d.ts.map +1 -1
- package/dist/RigidBody.js +23 -75
- package/dist/RigidBody.js.map +1 -1
- package/dist/SurfaceQuery.d.ts +72 -0
- package/dist/SurfaceQuery.d.ts.map +1 -0
- package/dist/SurfaceQuery.js +89 -0
- package/dist/SurfaceQuery.js.map +1 -0
- package/dist/VehicleDynamics.d.ts +10 -0
- package/dist/VehicleDynamics.d.ts.map +1 -1
- package/dist/VehicleDynamics.js +31 -3
- package/dist/VehicleDynamics.js.map +1 -1
- package/dist/VehicleMotion.d.ts +125 -0
- package/dist/VehicleMotion.d.ts.map +1 -0
- package/dist/VehicleMotion.js +373 -0
- package/dist/VehicleMotion.js.map +1 -0
- package/dist/index.d.ts +62 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +70 -17
- package/dist/index.js.map +1 -1
- package/dist/solverless-entry.d.ts +41 -0
- package/dist/solverless-entry.d.ts.map +1 -0
- package/dist/solverless-entry.js +40 -0
- package/dist/solverless-entry.js.map +1 -0
- package/dist/solverless.d.ts +37 -0
- package/dist/solverless.d.ts.map +1 -0
- package/dist/solverless.js +36 -0
- package/dist/solverless.js.map +1 -0
- package/dist/world-entry.d.ts +31 -0
- package/dist/world-entry.d.ts.map +1 -0
- package/dist/world-entry.js +30 -0
- package/dist/world-entry.js.map +1 -0
- package/dist/world.d.ts +18 -0
- package/dist/world.d.ts.map +1 -0
- package/dist/world.js +17 -0
- package/dist/world.js.map +1 -0
- package/package.json +10 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solverless-entry.d.ts","sourceRoot":"","sources":["../../../../packages/physics/src/solverless-entry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAC5J,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,YAAY,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,YAAY,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAMvD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAChF,YAAY,EAAE,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACjG,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,YAAY,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WS-2.2 — the parts of `@aura3d/physics` that do NOT reach the rigid-body solver.
|
|
3
|
+
*
|
|
4
|
+
* ## Why this exists
|
|
5
|
+
*
|
|
6
|
+
* `createAuraApp` needs a handful of physics values at module scope: `Shape` to translate a declared
|
|
7
|
+
* collider, `PhysicsStepper` to drive a fixed timestep, `ScenePhysicsBridge` to push transforms, and
|
|
8
|
+
* `PhysicsDebugDraw` to draw colliders. Every one of those files is **cannon-free** — they import
|
|
9
|
+
* `PhysicsWorld` as a *type* only.
|
|
10
|
+
*
|
|
11
|
+
* But they were reached through `@aura3d/physics`, whose barrel is a chain of `export *`, and one of
|
|
12
|
+
* those re-exports is `PhysicsWorld` — which imports `cannon-es`. So a scene with **no bodies at all**
|
|
13
|
+
* downloaded the whole solver. Measured on scenario 1 (one cube, no physics): a **77,081-byte gzip
|
|
14
|
+
* chunk** on the critical path, of which `cannon-es` is 83,869 bytes raw.
|
|
15
|
+
*
|
|
16
|
+
* This is *not* the same defect as eager construction. `createAuraApp` already constructs its world
|
|
17
|
+
* lazily and carries a comment recording that eager construction cost 85 KB — that fix was correct and
|
|
18
|
+
* insufficient, because a lazy `new` still leaves a static `import`. A bundler keeps the module either
|
|
19
|
+
* way. Deferring the *import* is what actually removes the bytes.
|
|
20
|
+
*
|
|
21
|
+
* ## What is deliberately absent
|
|
22
|
+
*
|
|
23
|
+
* `PhysicsWorld`, `NarrowPhase`, `CharacterController`, `HitboxWorld`, `VehicleDynamics` and the
|
|
24
|
+
* fixture modules. Anything that simulates. `@aura3d/physics` still exports all of them, and
|
|
25
|
+
* `createAuraApp` loads the world through `await import("@aura3d/physics")` when a scene actually
|
|
26
|
+
* declares a body — so behaviour is unchanged and only the download moves.
|
|
27
|
+
*/
|
|
28
|
+
export { Shape } from "./Shape.js";
|
|
29
|
+
export { EPSILON, vec3 } from "./Shape.js";
|
|
30
|
+
export { PhysicsStepper } from "./PhysicsStepper.js";
|
|
31
|
+
export { ScenePhysicsBridge } from "./ScenePhysicsBridge.js";
|
|
32
|
+
export { PhysicsDebugDraw } from "./PhysicsDebugDraw.js";
|
|
33
|
+
/*
|
|
34
|
+
* Mesh queries are geometry, not simulation. `MeshBVH` and `SurfaceQuery` import only `Shape`'s
|
|
35
|
+
* types, so grounding a vehicle or a character on a real mesh needs no solver — which is also WS-4.5's
|
|
36
|
+
* point about MeshBVH having responsibilities beyond physics contact.
|
|
37
|
+
*/
|
|
38
|
+
export { buildMeshBVH, raycastMesh, raycastMeshBruteForce } from "./MeshBVH.js";
|
|
39
|
+
export { createMeshSurfaceQuery } from "./SurfaceQuery.js";
|
|
40
|
+
//# sourceMappingURL=solverless-entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solverless-entry.js","sourceRoot":"","sources":["../../../../packages/physics/src/solverless-entry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAEhF,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WS-2.2 — the parts of `@aura3d/physics` that do NOT reach the rigid-body solver.
|
|
3
|
+
*
|
|
4
|
+
* ## Why this exists
|
|
5
|
+
*
|
|
6
|
+
* `createAuraApp` needs a handful of physics values at module scope: `Shape` to translate a declared
|
|
7
|
+
* collider, `PhysicsStepper` to drive a fixed timestep, `ScenePhysicsBridge` to push transforms, and
|
|
8
|
+
* `PhysicsDebugDraw` to draw colliders. These files import `PhysicsWorld` as a *type* only.
|
|
9
|
+
*
|
|
10
|
+
* But they were reached through `@aura3d/physics`, whose barrel is a chain of `export *`, and one of
|
|
11
|
+
* those re-exports is `PhysicsWorld`, which reaches the selected Rapier adapter. A scene with no
|
|
12
|
+
* physical bodies must not download or initialize that solver.
|
|
13
|
+
*
|
|
14
|
+
* This is *not* the same defect as eager construction. `createAuraApp` already constructs its world
|
|
15
|
+
* lazily and carries a comment recording that eager construction cost 85 KB — that fix was correct and
|
|
16
|
+
* insufficient, because a lazy `new` still leaves a static `import`. A bundler keeps the module either
|
|
17
|
+
* way. Deferring the *import* is what actually removes the bytes.
|
|
18
|
+
*
|
|
19
|
+
* ## What is deliberately absent
|
|
20
|
+
*
|
|
21
|
+
* `PhysicsWorld`, physical controllers, `HitboxWorld`, arcade vehicle telemetry, and fixture
|
|
22
|
+
* modules. This entry owns geometry/query helpers only; physical simulation uses `./world`.
|
|
23
|
+
*/
|
|
24
|
+
export { Shape } from "./Shape.js";
|
|
25
|
+
export type { BoxShape, Bounds, CapsuleShape, ConvexHullShape, HeightfieldShape, MeshShape, PhysicsShape, PlaneShape, SphereShape, Vec3 } from "./Shape.js";
|
|
26
|
+
export { EPSILON, vec3 } from "./Shape.js";
|
|
27
|
+
export { PhysicsStepper } from "./PhysicsStepper.js";
|
|
28
|
+
export type { PhysicsStepperResult } from "./PhysicsStepper.js";
|
|
29
|
+
export { ScenePhysicsBridge } from "./ScenePhysicsBridge.js";
|
|
30
|
+
export type { ScenePhysicsBinding, ScenePhysicsNode } from "./ScenePhysicsBridge.js";
|
|
31
|
+
export { PhysicsDebugDraw } from "./PhysicsDebugDraw.js";
|
|
32
|
+
export type { DebugLine } from "./PhysicsDebugDraw.js";
|
|
33
|
+
export { buildMeshBVH, raycastMesh, raycastMeshBruteForce } from "./MeshBVH.js";
|
|
34
|
+
export type { MeshBVH, MeshBVHBuildOptions, MeshRayHit, RaycastMeshOptions } from "./MeshBVH.js";
|
|
35
|
+
export { createMeshSurfaceQuery } from "./SurfaceQuery.js";
|
|
36
|
+
export type { MeshSurfaceQuery, MeshSurfaceQueryOptions, SurfaceSample } from "./SurfaceQuery.js";
|
|
37
|
+
//# sourceMappingURL=solverless.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solverless.d.ts","sourceRoot":"","sources":["../../../../packages/physics/src/solverless.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAC5J,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,YAAY,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,YAAY,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAMvD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAChF,YAAY,EAAE,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACjG,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,YAAY,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WS-2.2 — the parts of `@aura3d/physics` that do NOT reach the rigid-body solver.
|
|
3
|
+
*
|
|
4
|
+
* ## Why this exists
|
|
5
|
+
*
|
|
6
|
+
* `createAuraApp` needs a handful of physics values at module scope: `Shape` to translate a declared
|
|
7
|
+
* collider, `PhysicsStepper` to drive a fixed timestep, `ScenePhysicsBridge` to push transforms, and
|
|
8
|
+
* `PhysicsDebugDraw` to draw colliders. These files import `PhysicsWorld` as a *type* only.
|
|
9
|
+
*
|
|
10
|
+
* But they were reached through `@aura3d/physics`, whose barrel is a chain of `export *`, and one of
|
|
11
|
+
* those re-exports is `PhysicsWorld`, which reaches the selected Rapier adapter. A scene with no
|
|
12
|
+
* physical bodies must not download or initialize that solver.
|
|
13
|
+
*
|
|
14
|
+
* This is *not* the same defect as eager construction. `createAuraApp` already constructs its world
|
|
15
|
+
* lazily and carries a comment recording that eager construction cost 85 KB — that fix was correct and
|
|
16
|
+
* insufficient, because a lazy `new` still leaves a static `import`. A bundler keeps the module either
|
|
17
|
+
* way. Deferring the *import* is what actually removes the bytes.
|
|
18
|
+
*
|
|
19
|
+
* ## What is deliberately absent
|
|
20
|
+
*
|
|
21
|
+
* `PhysicsWorld`, physical controllers, `HitboxWorld`, arcade vehicle telemetry, and fixture
|
|
22
|
+
* modules. This entry owns geometry/query helpers only; physical simulation uses `./world`.
|
|
23
|
+
*/
|
|
24
|
+
export { Shape } from "./Shape.js";
|
|
25
|
+
export { EPSILON, vec3 } from "./Shape.js";
|
|
26
|
+
export { PhysicsStepper } from "./PhysicsStepper.js";
|
|
27
|
+
export { ScenePhysicsBridge } from "./ScenePhysicsBridge.js";
|
|
28
|
+
export { PhysicsDebugDraw } from "./PhysicsDebugDraw.js";
|
|
29
|
+
/*
|
|
30
|
+
* Mesh queries are geometry, not simulation. `MeshBVH` and `SurfaceQuery` import only `Shape`'s
|
|
31
|
+
* types, so grounding a vehicle or a character on a real mesh needs no solver — which is also WS-4.5's
|
|
32
|
+
* point about MeshBVH having responsibilities beyond physics contact.
|
|
33
|
+
*/
|
|
34
|
+
export { buildMeshBVH, raycastMesh, raycastMeshBruteForce } from "./MeshBVH.js";
|
|
35
|
+
export { createMeshSurfaceQuery } from "./SurfaceQuery.js";
|
|
36
|
+
//# sourceMappingURL=solverless.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solverless.js","sourceRoot":"","sources":["../../../../packages/physics/src/solverless.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAEhF,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WS-2.2 — `PhysicsWorld` and the solver, as a narrow entry point.
|
|
3
|
+
*
|
|
4
|
+
* ## Why this exists rather than importing the barrel
|
|
5
|
+
*
|
|
6
|
+
* `app.physics` is documented and tested as being live **synchronously** for every app
|
|
7
|
+
* (`tests/unit/agent-api/lazy-physics-world.test.ts`), so `createAuraApp` must be able to construct a
|
|
8
|
+
* world without awaiting. That rules out loading the solver with `await import()` — R7 forbids breaking
|
|
9
|
+
* working semantics to chase a byte count, and an async-only `app.physics` would break every existing
|
|
10
|
+
* caller.
|
|
11
|
+
*
|
|
12
|
+
* So the solver is imported statically, but from **here** rather than from `@aura3d/physics`. The
|
|
13
|
+
* barrel is a chain of `export *` covering `HitboxWorld`, `CharacterController`, `KinematicBody`,
|
|
14
|
+
* `VehicleDynamics`, `NarrowPhase` and six fixture modules; importing it to get one class dragged all
|
|
15
|
+
* of them in. This entry exposes the solver and nothing else.
|
|
16
|
+
*
|
|
17
|
+
* Measured on scenario 1 (one cube, no bodies), the eager physics chunk:
|
|
18
|
+
*
|
|
19
|
+
* via the barrel 77,081 B gzip (cannon-es 83,869 raw + HitboxWorld 14,379 + KinematicBody
|
|
20
|
+
* 8,975 + CharacterController 8,531 + NarrowPhase 8,488 +
|
|
21
|
+
* VehicleDynamics 8,125 + PhysicsSandboxFixtures 7,687 + ...)
|
|
22
|
+
* via this entry the solver only
|
|
23
|
+
*
|
|
24
|
+
* `cannon-es` itself stays on the critical path, and that is the honest remaining cost of a synchronous
|
|
25
|
+
* `app.physics`. Removing it requires deciding whether the public contract may become async — which is
|
|
26
|
+
* a **P4** question, not a P2 one, and one the physics bake-off has to answer anyway because Rapier is
|
|
27
|
+
* WASM and therefore asynchronous by construction.
|
|
28
|
+
*/
|
|
29
|
+
export { PhysicsWorld } from "./PhysicsWorld.js";
|
|
30
|
+
export type { PhysicsBackend, PhysicsBackendPreference, PhysicsBackendSelection, PhysicsContinuousCollisionDescriptor, PhysicsContinuousCollisionSelection, PhysicsSnapshot, PhysicsStepStats, PhysicsWorldDescriptor } from "./PhysicsWorld.js";
|
|
31
|
+
//# sourceMappingURL=world-entry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"world-entry.d.ts","sourceRoot":"","sources":["../../../../packages/physics/src/world-entry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EACV,cAAc,EACd,wBAAwB,EACxB,uBAAuB,EACvB,oCAAoC,EACpC,mCAAmC,EACnC,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACvB,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WS-2.2 — `PhysicsWorld` and the solver, as a narrow entry point.
|
|
3
|
+
*
|
|
4
|
+
* ## Why this exists rather than importing the barrel
|
|
5
|
+
*
|
|
6
|
+
* `app.physics` is documented and tested as being live **synchronously** for every app
|
|
7
|
+
* (`tests/unit/agent-api/lazy-physics-world.test.ts`), so `createAuraApp` must be able to construct a
|
|
8
|
+
* world without awaiting. That rules out loading the solver with `await import()` — R7 forbids breaking
|
|
9
|
+
* working semantics to chase a byte count, and an async-only `app.physics` would break every existing
|
|
10
|
+
* caller.
|
|
11
|
+
*
|
|
12
|
+
* So the solver is imported statically, but from **here** rather than from `@aura3d/physics`. The
|
|
13
|
+
* barrel is a chain of `export *` covering `HitboxWorld`, `CharacterController`, `KinematicBody`,
|
|
14
|
+
* `VehicleDynamics`, `NarrowPhase` and six fixture modules; importing it to get one class dragged all
|
|
15
|
+
* of them in. This entry exposes the solver and nothing else.
|
|
16
|
+
*
|
|
17
|
+
* Measured on scenario 1 (one cube, no bodies), the eager physics chunk:
|
|
18
|
+
*
|
|
19
|
+
* via the barrel 77,081 B gzip (cannon-es 83,869 raw + HitboxWorld 14,379 + KinematicBody
|
|
20
|
+
* 8,975 + CharacterController 8,531 + NarrowPhase 8,488 +
|
|
21
|
+
* VehicleDynamics 8,125 + PhysicsSandboxFixtures 7,687 + ...)
|
|
22
|
+
* via this entry the solver only
|
|
23
|
+
*
|
|
24
|
+
* `cannon-es` itself stays on the critical path, and that is the honest remaining cost of a synchronous
|
|
25
|
+
* `app.physics`. Removing it requires deciding whether the public contract may become async — which is
|
|
26
|
+
* a **P4** question, not a P2 one, and one the physics bake-off has to answer anyway because Rapier is
|
|
27
|
+
* WASM and therefore asynchronous by construction.
|
|
28
|
+
*/
|
|
29
|
+
export { PhysicsWorld } from "./PhysicsWorld.js";
|
|
30
|
+
//# sourceMappingURL=world-entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"world-entry.js","sourceRoot":"","sources":["../../../../packages/physics/src/world-entry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/world.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WS-2.2 — `PhysicsWorld` and the solver, as a narrow entry point.
|
|
3
|
+
*
|
|
4
|
+
* ## Why this exists rather than importing the barrel
|
|
5
|
+
*
|
|
6
|
+
* `app.physics` is documented and tested as being live **synchronously** for every app
|
|
7
|
+
* (`tests/unit/agent-api/lazy-physics-world.test.ts`), so `createAuraApp` must be able to construct a
|
|
8
|
+
* world without awaiting. That rules out loading the solver with `await import()` — R7 forbids breaking
|
|
9
|
+
* working semantics to chase a byte count, and an async-only `app.physics` would break every existing
|
|
10
|
+
* caller.
|
|
11
|
+
*
|
|
12
|
+
* The selected Rapier solver is imported statically from this narrow entry instead of the
|
|
13
|
+
* compatibility barrel. This preserves synchronous `app.physics` construction after the
|
|
14
|
+
* adapter module's one-time WASM initialization without pulling unrelated arcade or query APIs.
|
|
15
|
+
*/
|
|
16
|
+
export { PhysicsWorld } from "./PhysicsWorld.js";
|
|
17
|
+
export type { PhysicsBackend, PhysicsBackendPreference, PhysicsBackendSelection, PhysicsContinuousCollisionDescriptor, PhysicsContinuousCollisionSelection, PhysicsSnapshot, PhysicsStepStats, PhysicsWorldDescriptor } from "./PhysicsWorld.js";
|
|
18
|
+
//# sourceMappingURL=world.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"world.d.ts","sourceRoot":"","sources":["../../../../packages/physics/src/world.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EACV,cAAc,EACd,wBAAwB,EACxB,uBAAuB,EACvB,oCAAoC,EACpC,mCAAmC,EACnC,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACvB,MAAM,mBAAmB,CAAC"}
|
package/dist/world.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WS-2.2 — `PhysicsWorld` and the solver, as a narrow entry point.
|
|
3
|
+
*
|
|
4
|
+
* ## Why this exists rather than importing the barrel
|
|
5
|
+
*
|
|
6
|
+
* `app.physics` is documented and tested as being live **synchronously** for every app
|
|
7
|
+
* (`tests/unit/agent-api/lazy-physics-world.test.ts`), so `createAuraApp` must be able to construct a
|
|
8
|
+
* world without awaiting. That rules out loading the solver with `await import()` — R7 forbids breaking
|
|
9
|
+
* working semantics to chase a byte count, and an async-only `app.physics` would break every existing
|
|
10
|
+
* caller.
|
|
11
|
+
*
|
|
12
|
+
* The selected Rapier solver is imported statically from this narrow entry instead of the
|
|
13
|
+
* compatibility barrel. This preserves synchronous `app.physics` construction after the
|
|
14
|
+
* adapter module's one-time WASM initialization without pulling unrelated arcade or query APIs.
|
|
15
|
+
*/
|
|
16
|
+
export { PhysicsWorld } from "./PhysicsWorld.js";
|
|
17
|
+
//# sourceMappingURL=world.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"world.js","sourceRoot":"","sources":["../../../../packages/physics/src/world.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aura3d/physics",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"sideEffects": false,
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"
|
|
9
|
+
"@aura3d/physics-rapier": "2.0.0"
|
|
10
10
|
},
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
13
|
"types": "./dist/index.d.ts",
|
|
14
14
|
"import": "./dist/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./solverless": {
|
|
17
|
+
"types": "./dist/solverless.d.ts",
|
|
18
|
+
"import": "./dist/solverless.js"
|
|
19
|
+
},
|
|
20
|
+
"./world": {
|
|
21
|
+
"types": "./dist/world.d.ts",
|
|
22
|
+
"import": "./dist/world.js"
|
|
15
23
|
}
|
|
16
24
|
},
|
|
17
25
|
"description": "Deterministic rigid-body simulation, collision shapes, contacts, constraints, raycasts, fixed stepping, scene/ECS bridges, and debug draw extraction.",
|