@series-inc/rundot-syncplay 6.0.0-rc.2 → 6.0.0-rc.21
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 +133 -0
- package/core/deterministic-math.d.ts +75 -1
- package/core/native/instance_ledger.hpp +1095 -0
- package/core/native/legacy_checkpoint_ids.hpp +107 -0
- package/core/native/physics/abi.cpp +39 -211
- package/core/native/physics/abi.hpp +2 -6
- package/core/native/physics/articulation.cpp +1434 -0
- package/core/native/physics/articulation.hpp +279 -0
- package/core/native/physics/buoyancy.cpp +1588 -0
- package/core/native/physics/buoyancy.hpp +254 -0
- package/core/native/physics/capsule_triangle.cpp +168 -0
- package/core/native/physics/capsule_triangle.hpp +40 -0
- package/core/native/physics/capsule_triangle_native.inc +291 -0
- package/core/native/physics/certified_sum.hpp +218 -0
- package/core/native/physics/character.cpp +638 -0
- package/core/native/physics/character.hpp +169 -0
- package/core/native/physics/checkpoint_schema.hpp +379 -0
- package/core/native/physics/cloth.cpp +1401 -0
- package/core/native/physics/cloth.hpp +357 -0
- package/core/native/physics/constraint_rows.cpp +363 -2
- package/core/native/physics/constraint_rows.hpp +72 -1
- package/core/native/physics/deformable_query.cpp +1630 -0
- package/core/native/physics/deformable_query.hpp +578 -0
- package/core/native/physics/distance.cpp +1166 -0
- package/core/native/physics/distance.hpp +151 -0
- package/core/native/physics/exact/exact-applied.cpp +101 -0
- package/core/native/physics/exact/exact-applied.hpp +112 -0
- package/core/native/physics/exact/exact-dyadic.cpp +691 -0
- package/core/native/physics/exact/exact-dyadic.hpp +58 -0
- package/core/native/physics/exact/exact-operation.hpp +51 -0
- package/core/native/physics/exact/word-core.hpp +262 -0
- package/core/native/physics/extended_abi.cpp +1242 -0
- package/core/native/physics/extended_abi.hpp +355 -0
- package/core/native/physics/extended_abi_characters.cpp +261 -0
- package/core/native/physics/extended_abi_characters.hpp +434 -0
- package/core/native/physics/extended_abi_core_features.cpp +713 -0
- package/core/native/physics/extended_abi_core_features.hpp +226 -0
- package/core/native/physics/extended_abi_deformables.cpp +448 -0
- package/core/native/physics/extended_abi_deformables.hpp +867 -0
- package/core/native/physics/extended_abi_vehicles.cpp +411 -0
- package/core/native/physics/extended_abi_vehicles.hpp +222 -0
- package/core/native/physics/fracture.cpp +1981 -0
- package/core/native/physics/fracture.hpp +460 -0
- package/core/native/physics/gear.cpp +563 -0
- package/core/native/physics/gear.hpp +158 -0
- package/core/native/physics/geometry_memory.hpp +476 -0
- package/core/native/physics/geometry_store.cpp +547 -0
- package/core/native/physics/geometry_store.hpp +134 -0
- package/core/native/physics/lag_compensation.cpp +1626 -0
- package/core/native/physics/lag_compensation.hpp +405 -0
- package/core/native/physics/mass_properties.cpp +449 -0
- package/core/native/physics/mass_properties.hpp +23 -0
- package/core/native/physics/material_pose.hpp +988 -0
- package/core/native/physics/particles.cpp +1065 -0
- package/core/native/physics/particles.hpp +261 -0
- package/core/native/physics/path_joint.cpp +781 -0
- package/core/native/physics/path_joint.hpp +154 -0
- package/core/native/physics/physics.cpp +13043 -1065
- package/core/native/physics/physics.hpp +184 -8
- package/core/native/physics/planar_deformable.cpp +2433 -0
- package/core/native/physics/planar_deformable.hpp +889 -0
- package/core/native/physics/platformer_2d.cpp +1353 -0
- package/core/native/physics/platformer_2d.hpp +340 -0
- package/core/native/physics/powered_ragdoll.cpp +1100 -0
- package/core/native/physics/powered_ragdoll.hpp +279 -0
- package/core/native/physics/powertrain.cpp +586 -0
- package/core/native/physics/powertrain.hpp +180 -0
- package/core/native/physics/pulley.cpp +311 -0
- package/core/native/physics/pulley.hpp +121 -0
- package/core/native/physics/ragdoll.cpp +586 -0
- package/core/native/physics/ragdoll.hpp +221 -0
- package/core/native/physics/rope.cpp +692 -0
- package/core/native/physics/rope.hpp +215 -0
- package/core/native/physics/rounded_convex.cpp +1229 -0
- package/core/native/physics/rounded_convex.hpp +287 -0
- package/core/native/physics/sdf_geometry.cpp +1821 -0
- package/core/native/physics/sdf_geometry.hpp +474 -0
- package/core/native/physics/soft_body.cpp +1449 -0
- package/core/native/physics/soft_body.hpp +328 -0
- package/core/native/physics/soft_collision.cpp +1862 -0
- package/core/native/physics/soft_collision.hpp +561 -0
- package/core/native/physics/surface_velocity.cpp +366 -0
- package/core/native/physics/surface_velocity.hpp +243 -0
- package/core/native/physics/topology.cpp +357 -39
- package/core/native/physics/topology.hpp +97 -6
- package/core/native/physics/tracks.cpp +1179 -0
- package/core/native/physics/tracks.hpp +404 -0
- package/core/native/physics/vehicle.cpp +629 -0
- package/core/native/physics/vehicle.hpp +191 -0
- package/core/native/physics/voxel_cooking.cpp +1929 -0
- package/core/native/physics/voxel_cooking.hpp +395 -0
- package/core/native/physics/world.cpp +5290 -854
- package/core/native/physics/world.hpp +796 -24
- package/core/native/physics/world_abi.cpp +3840 -306
- package/core/native/physics/world_abi.hpp +530 -10
- package/core/native/physics/world_digest_visitor.hpp +277 -0
- package/core/native/physics/world_strong_digest.hpp +557 -0
- package/core/native/physics2d/ccd.cpp +1302 -0
- package/core/native/physics2d/ccd.hpp +141 -0
- package/core/native/physics2d/checkpoint_memory.hpp +349 -0
- package/core/native/physics2d/clock_primitives.hpp +138 -0
- package/core/native/physics2d/commands.cpp +174 -28
- package/core/native/physics2d/commands.hpp +3 -1
- package/core/native/physics2d/compound.cpp +581 -0
- package/core/native/physics2d/compound.hpp +248 -0
- package/core/native/physics2d/contour.cpp +325 -0
- package/core/native/physics2d/contour.hpp +143 -0
- package/core/native/physics2d/frame_scope.hpp +124 -0
- package/core/native/physics2d/joint_phases.hpp +93 -0
- package/core/native/physics2d/joints.cpp +587 -150
- package/core/native/physics2d/joints.hpp +5 -0
- package/core/native/physics2d/memory_private.hpp +125 -0
- package/core/native/physics2d/owned_abi.cpp +1354 -879
- package/core/native/physics2d/owned_abi.hpp +190 -52
- package/core/native/physics2d/phase_test_hooks.hpp +17 -0
- package/core/native/physics2d/physics2d.cpp +2073 -120
- package/core/native/physics2d/physics2d.hpp +154 -2
- package/core/native/physics2d/queries.cpp +1055 -79
- package/core/native/physics2d/queries.hpp +71 -5
- package/core/native/physics2d/world.cpp +1313 -353
- package/core/native/physics2d/world.hpp +124 -13
- package/core/native/sha256/sha256_compress_unsigned.hpp +68 -0
- package/core/native/sha256/sha256_fips_constants.hpp +24 -0
- package/core/native/sha256/sha256_length.hpp +56 -0
- package/core/native/sha256/sha256_memo.hpp +48 -0
- package/core/native/sha256/sha256_sink.hpp +234 -0
- package/core/physics2d-owned.d.ts +466 -126
- package/core/runtime.d.ts +192 -19
- package/core/scripts/build-native.mjs +34 -0
- package/core/scripts/build-wasm-physics.mjs +272 -23
- package/core/scripts/extended-physics-profile.mjs +634 -0
- package/core/scripts/generate-physics2d-vectors.mjs +59 -0
- package/core/src/kinetix-deterministic-math.d.ts +2 -0
- package/core/src/kinetix-deterministic-math.mjs +513 -27
- package/core/src/kinetix-owned-runtime-adapter.mjs +788 -0
- package/core/src/kinetix-runtime-adapter-utils.mjs +54 -6
- package/core/src/kinetix-runtime-contract.mjs +55 -9
- package/core/src/kinetix-runtime-identity.mjs +12 -1
- package/core/src/kinetix-session-config.mjs +7 -2
- package/core/src/kinetix-state-report.mjs +36 -0
- package/core/src/physics/abi-constants.mjs +5 -4
- package/core/src/physics/articulation.d.mts +194 -0
- package/core/src/physics/articulation.mjs +1141 -0
- package/core/src/physics/buoyancy.d.mts +143 -0
- package/core/src/physics/buoyancy.mjs +268 -0
- package/core/src/physics/cloth.d.mts +314 -0
- package/core/src/physics/cloth.mjs +1156 -0
- package/core/src/physics/deformable-query.d.mts +217 -0
- package/core/src/physics/deformable-query.mjs +1412 -0
- package/core/src/physics/distance.d.mts +160 -0
- package/core/src/physics/distance.mjs +175 -0
- package/core/src/physics/extended-wasm-instance.d.mts +5 -0
- package/core/src/physics/extended-wasm-instance.mjs +48 -0
- package/core/src/physics/feature-api.d.mts +74 -0
- package/core/src/physics/feature-api.mjs +98 -0
- package/core/src/physics/fracture.d.mts +133 -0
- package/core/src/physics/fracture.mjs +1324 -0
- package/core/src/physics/gear.d.mts +585 -0
- package/core/src/physics/gear.mjs +955 -0
- package/core/src/physics/lag-compensation.d.mts +101 -0
- package/core/src/physics/lag-compensation.mjs +1100 -0
- package/core/src/physics/mass-properties.d.mts +114 -0
- package/core/src/physics/mass-properties.mjs +137 -468
- package/core/src/physics/particles.d.mts +177 -0
- package/core/src/physics/particles.mjs +758 -0
- package/core/src/physics/path-joint.d.mts +171 -0
- package/core/src/physics/path-joint.mjs +1231 -0
- package/core/src/physics/physics-extended-wasm-module.generated.mjs +13 -0
- package/core/src/physics/physics-profile-wasm-module.generated.mjs +48 -0
- package/core/src/physics/physics-wasm-module.generated.mjs +34 -5
- package/core/src/physics/powered-ragdoll.d.mts +188 -0
- package/core/src/physics/powered-ragdoll.mjs +1043 -0
- package/core/src/physics/powertrain.d.mts +260 -0
- package/core/src/physics/powertrain.mjs +621 -0
- package/core/src/physics/pulley.d.mts +98 -0
- package/core/src/physics/pulley.mjs +686 -0
- package/core/src/physics/ragdoll.d.mts +289 -0
- package/core/src/physics/ragdoll.mjs +1323 -0
- package/core/src/physics/rope.d.mts +241 -0
- package/core/src/physics/rope.mjs +319 -0
- package/core/src/physics/rounded-convex.d.mts +328 -0
- package/core/src/physics/rounded-convex.mjs +1404 -0
- package/core/src/physics/sdf-geometry.d.mts +117 -0
- package/core/src/physics/sdf-geometry.mjs +1204 -0
- package/core/src/physics/soft-body.d.mts +144 -0
- package/core/src/physics/soft-body.mjs +1285 -0
- package/core/src/physics/soft-collision.d.mts +651 -0
- package/core/src/physics/soft-collision.mjs +1883 -0
- package/core/src/physics/surface-velocity.d.mts +156 -0
- package/core/src/physics/surface-velocity.mjs +722 -0
- package/core/src/physics/tracks.d.mts +411 -0
- package/core/src/physics/tracks.mjs +1074 -0
- package/core/src/physics/vehicle.d.mts +3 -0
- package/core/src/physics/vehicle.mjs +172 -0
- package/core/src/physics/voxel-cooking.d.mts +219 -0
- package/core/src/physics/voxel-cooking.mjs +1499 -0
- package/core/src/physics/voxel-swept-quad.mjs +110 -0
- package/core/src/physics/wasm-instance.mjs +160 -23
- package/core/src/physics/world.d.mts +62 -0
- package/core/src/physics/world.mjs +1947 -152
- package/core/src/physics2d/body-state.mjs +218 -15
- package/core/src/physics2d/collision.d.mts +52 -0
- package/core/src/physics2d/collision.mjs +234 -0
- package/core/src/physics2d/compound.mjs +454 -0
- package/core/src/physics2d/contour-state.mjs +771 -0
- package/core/src/physics2d/feature-api.d.mts +211 -0
- package/core/src/physics2d/feature-api.mjs +3 -0
- package/core/src/physics2d/fluid-state.mjs +145 -0
- package/core/src/physics2d/joint-state.mjs +1 -1
- package/core/src/physics2d/owned-queries.mjs +3 -1
- package/core/src/physics2d/owned-transport.mjs +268 -122
- package/core/src/physics2d/owned-world.mjs +353 -230
- package/core/src/physics2d/particle-fluid.d.mts +152 -0
- package/core/src/physics2d/particle-fluid.mjs +233 -0
- package/core/src/physics2d/physics2d-wasm-module.generated.mjs +27 -10
- package/core/src/physics2d/query-codec.mjs +61 -13
- package/core/src/physics2d/submerged-geometry.d.mts +51 -0
- package/core/src/physics2d/submerged-geometry.mjs +186 -0
- package/core/src/runtime.mjs +23 -0
- package/core/src/shared/bytes.d.mts +2 -0
- package/core/src/shared/bytes.mjs +33 -0
- package/core/src/shared/sha256.d.mts +3 -0
- package/core/src/shared/sha256.mjs +72 -22
- package/core/units.d.ts +50 -0
- package/core/world.d.ts +253 -5
- package/dist/authority-room.d.ts +9 -0
- package/dist/authority-room.js +45 -16
- package/dist/browser.d.ts +6 -5
- package/dist/browser.js +4 -3
- package/dist/cadence.d.ts +7 -0
- package/dist/cadence.js +19 -0
- package/dist/canonical.d.ts +1 -0
- package/dist/canonical.js +3 -0
- package/dist/checksum-policy.d.ts +10 -0
- package/dist/checksum-policy.js +14 -0
- package/dist/collider-cooking-hull.d.ts +18 -0
- package/dist/collider-cooking-hull.js +248 -0
- package/dist/collider-cooking.d.ts +140 -0
- package/dist/collider-cooking.js +794 -0
- package/dist/compat/v5.d.ts +121 -0
- package/dist/compat/v5.js +479 -0
- package/dist/creator.d.ts +7 -6
- package/dist/creator.js +4 -3
- package/dist/game-byte-section.d.ts +36 -0
- package/dist/game-byte-section.js +350 -0
- package/dist/index.d.ts +13 -6
- package/dist/index.js +9 -4
- package/dist/instant-replay.d.ts +27 -2
- package/dist/instant-replay.js +91 -16
- package/dist/lag-compensation3d.js +11 -10
- package/dist/match-log.d.ts +21 -4
- package/dist/match-log.js +92 -9
- package/dist/math.d.ts +2 -0
- package/dist/math.js +1 -0
- package/dist/modules/character-3d.d.ts +16 -1
- package/dist/modules/character-3d.js +42 -5
- package/dist/modules/combat.js +6 -5
- package/dist/movement3d-revision1.d.ts +2 -0
- package/dist/movement3d-revision1.js +973 -0
- package/dist/movement3d.d.ts +53 -3
- package/dist/movement3d.js +917 -247
- package/dist/networked-client.d.ts +15 -0
- package/dist/networked-client.js +378 -105
- package/dist/node.d.ts +3 -2
- package/dist/node.js +2 -1
- package/dist/physics/2d.d.ts +38 -4
- package/dist/physics/2d.js +57 -36
- package/dist/physics/3d.d.ts +755 -111
- package/dist/physics/3d.js +2355 -158
- package/dist/physics/edit-result-graph.d.ts +36 -0
- package/dist/physics/edit-result-graph.js +141 -0
- package/dist/physics/game-codec3d.d.ts +41 -0
- package/dist/physics/game-codec3d.js +544 -0
- package/dist/physics/installed-checkpoint3d.d.ts +13 -0
- package/dist/physics/installed-checkpoint3d.js +120 -0
- package/dist/physics/installed-runtime3d.d.ts +51 -0
- package/dist/physics/installed-runtime3d.js +372 -0
- package/dist/physics/installed-state-commitment3d.d.ts +2 -0
- package/dist/physics/installed-state-commitment3d.js +24 -0
- package/dist/physics/units.d.ts +38 -0
- package/dist/physics/units.js +56 -0
- package/dist/physics/vehicle-state3d.d.ts +93 -0
- package/dist/physics/vehicle-state3d.js +1191 -0
- package/dist/physics/voxel-body-state.d.ts +61 -0
- package/dist/physics/voxel-body-state.js +410 -0
- package/dist/r3f-render-adapter.d.ts +59 -1
- package/dist/r3f-render-adapter.js +137 -2
- package/dist/replay.d.ts +13 -0
- package/dist/replay.js +95 -70
- package/dist/run-room-transport.js +5 -1
- package/dist/runner.d.ts +17 -2
- package/dist/runner.js +472 -84
- package/dist/runtime-cleanup.d.ts +54 -0
- package/dist/runtime-cleanup.js +266 -0
- package/dist/runtime-lease.d.ts +11 -1
- package/dist/runtime-lease.js +23 -10
- package/dist/runtime-room-metadata.d.ts +2 -8
- package/dist/runtime-room-metadata.js +11 -14
- package/dist/runtime-session.d.ts +8 -0
- package/dist/runtime-session.js +222 -58
- package/dist/schema-codegen.js +3 -0
- package/dist/schema-dsl-binary.d.ts +10 -4
- package/dist/schema-dsl-binary.js +375 -76
- package/dist/scratch-pool.d.ts +32 -0
- package/dist/scratch-pool.js +60 -0
- package/dist/sdk-session.d.ts +1 -0
- package/dist/sdk-session.js +4 -0
- package/dist/secret-config.js +2 -60
- package/dist/secret-crypto.js +70 -36
- package/dist/session-snapshot.d.ts +15 -4
- package/dist/session-snapshot.js +35 -33
- package/dist/session-wire.js +14 -22
- package/dist/sparse-set.d.ts +1 -0
- package/dist/sparse-set.js +22 -0
- package/dist/spatial/spatial-grid-3d.d.ts +41 -0
- package/dist/spatial/spatial-grid-3d.js +115 -0
- package/dist/synctest.d.ts +9 -0
- package/dist/synctest.js +106 -17
- package/dist/testing-network.d.ts +2 -0
- package/dist/testing-network.js +122 -18
- package/dist/testing.d.ts +27 -6
- package/dist/testing.js +297 -56
- package/dist/tools/index.d.ts +3 -2
- package/dist/tools/index.js +3 -2
- package/dist/tools/module-certification.d.ts +6 -0
- package/dist/tools/module-certification.js +26 -2
- package/package.json +18 -5
- package/core/scripts/run-box3d-benchmark.mjs +0 -350
- package/core/src/physics/index.mjs +0 -3169
|
@@ -4,62 +4,204 @@ import { mkdirSync, readFileSync, realpathSync, renameSync, writeFileSync } from
|
|
|
4
4
|
import { dirname, join } from 'node:path';
|
|
5
5
|
import { fileURLToPath } from 'node:url';
|
|
6
6
|
|
|
7
|
+
import {
|
|
8
|
+
extendedPhysicsCompileSources,
|
|
9
|
+
extendedPhysicsExportedFunctions,
|
|
10
|
+
extendedPhysicsSources,
|
|
11
|
+
} from './extended-physics-profile.mjs';
|
|
12
|
+
|
|
7
13
|
const root = join(import.meta.dirname, '..');
|
|
8
14
|
const buildDirectory = join(root, 'build');
|
|
9
15
|
const profilingFunctions = process.env.SYNCPLAY_WASM_PROFILING_FUNCTIONS === '1';
|
|
10
|
-
const commonSources = ['native/deterministic_math.hpp', 'native/deterministic_math.cpp', 'native/wasm_runtime.cpp'];
|
|
16
|
+
const commonSources = ['native/instance_ledger.hpp', 'native/legacy_checkpoint_ids.hpp', 'native/deterministic_math.hpp', 'native/deterministic_math.cpp', 'native/wasm_runtime.cpp'];
|
|
11
17
|
const profiles = {
|
|
12
18
|
physics3d: {
|
|
13
19
|
exceptionFlag: '-fwasm-exceptions',
|
|
20
|
+
extraFlags: [
|
|
21
|
+
'-D_LIBCPP_VERBOSE_ABORT(...)=__builtin_trap()',
|
|
22
|
+
'-Icore/native',
|
|
23
|
+
'-Inative',
|
|
24
|
+
'-Wl,--allow-multiple-definition',
|
|
25
|
+
'-sSTACK_SIZE=1048576',
|
|
26
|
+
],
|
|
14
27
|
wasmName: 'physics.wasm',
|
|
15
28
|
generatedPath: ['src', 'physics', 'physics-wasm-module.generated.mjs'],
|
|
16
29
|
metadataExport: 'physicsWasmMetadata',
|
|
17
30
|
base64Export: 'physicsWasmModuleBase64',
|
|
18
31
|
sources: [
|
|
19
32
|
'native/physics/physics.hpp', 'native/physics/physics.cpp',
|
|
33
|
+
'native/physics/capsule_triangle.hpp', 'native/physics/capsule_triangle.cpp',
|
|
34
|
+
'native/physics/geometry_store.hpp', 'native/physics/geometry_store.cpp',
|
|
35
|
+
'native/physics/voxel_cooking.hpp', 'native/physics/voxel_cooking.cpp',
|
|
36
|
+
'native/physics/buoyancy.hpp', 'native/physics/buoyancy.cpp',
|
|
37
|
+
'native/physics/geometry_memory.hpp',
|
|
38
|
+
'native/physics/material_pose.hpp',
|
|
39
|
+
'native/physics/capsule_triangle_native.inc', 'native/physics/certified_sum.hpp',
|
|
40
|
+
'native/physics/exact/exact-applied.hpp', 'native/physics/exact/exact-applied.cpp',
|
|
41
|
+
'native/physics/exact/exact-dyadic.hpp', 'native/physics/exact/exact-dyadic.cpp',
|
|
42
|
+
'native/physics/exact/exact-operation.hpp', 'native/physics/exact/word-core.hpp',
|
|
20
43
|
'native/physics/constraint_rows.hpp', 'native/physics/constraint_rows.cpp',
|
|
21
44
|
'native/physics/topology.hpp', 'native/physics/topology.cpp',
|
|
22
|
-
'native/physics/world.hpp', 'native/physics/world.cpp',
|
|
45
|
+
'native/physics/world.hpp', 'native/physics/world_digest_visitor.hpp', 'native/physics/world.cpp',
|
|
23
46
|
'native/physics/world_abi.hpp', 'native/physics/world_abi.cpp',
|
|
24
|
-
'native/physics/
|
|
47
|
+
'native/physics/checkpoint_schema.hpp',
|
|
48
|
+
'native/physics/world_strong_digest.hpp',
|
|
49
|
+
'native/sha256/sha256_sink.hpp',
|
|
50
|
+
'native/sha256/sha256_memo.hpp',
|
|
51
|
+
'native/sha256/sha256_compress_unsigned.hpp',
|
|
52
|
+
'native/sha256/sha256_fips_constants.hpp',
|
|
53
|
+
'native/sha256/sha256_length.hpp',
|
|
54
|
+
|
|
55
|
+
'native/physics/abi.hpp', 'native/physics/abi.cpp',
|
|
56
|
+
'scripts/extended-physics-profile.mjs', ...extendedPhysicsSources, ...commonSources,
|
|
25
57
|
],
|
|
26
58
|
compileSources: [
|
|
27
59
|
'native/physics/physics.cpp',
|
|
60
|
+
'native/physics/capsule_triangle.cpp',
|
|
61
|
+
'native/physics/geometry_store.cpp',
|
|
62
|
+
'native/physics/voxel_cooking.cpp',
|
|
63
|
+
'native/physics/buoyancy.cpp',
|
|
64
|
+
'native/physics/exact/exact-applied.cpp',
|
|
65
|
+
'native/physics/exact/exact-dyadic.cpp',
|
|
28
66
|
'native/physics/constraint_rows.cpp',
|
|
29
67
|
'native/physics/topology.cpp',
|
|
30
68
|
'native/physics/world.cpp', 'native/physics/world_abi.cpp',
|
|
31
|
-
'native/physics/abi.cpp',
|
|
69
|
+
'native/physics/abi.cpp', ...extendedPhysicsCompileSources,
|
|
70
|
+
'native/deterministic_math.cpp', 'native/wasm_runtime.cpp',
|
|
32
71
|
],
|
|
33
72
|
exportedFunctions: [
|
|
34
73
|
'_malloc', '_free',
|
|
35
|
-
'
|
|
74
|
+
'_rundot_kinetix_ext_voxel_abi_version',
|
|
75
|
+
'_rundot_kinetix_ext_voxel_child_stride',
|
|
76
|
+
'_rundot_kinetix_ext_voxel_stats_stride',
|
|
77
|
+
'_rundot_kinetix_ext_voxel_subchunk_stride',
|
|
78
|
+
'_rundot_kinetix_ext_voxel_ray_hit_stride',
|
|
79
|
+
'_rundot_kinetix_ext_voxel_seam_result_stride',
|
|
80
|
+
'_rundot_kinetix_ext_voxel_mass_properties_stride',
|
|
81
|
+
'_rundot_kinetix_ext_voxel_mass_properties',
|
|
82
|
+
'_rundot_kinetix_ext_voxel_scratch_size',
|
|
83
|
+
'_rundot_kinetix_ext_voxel_cook_chunk',
|
|
84
|
+
'_rundot_kinetix_ext_voxel_carve',
|
|
85
|
+
'_rundot_kinetix_ext_voxel_incremental_cook',
|
|
86
|
+
'_rundot_kinetix_ext_voxel_split_components',
|
|
87
|
+
'_rundot_kinetix_ext_voxel_incremental_slice',
|
|
88
|
+
'_rundot_kinetix_ext_voxel_raycast_dda',
|
|
89
|
+
'_rundot_kinetix_ext_voxel_seam_query',
|
|
90
|
+
'_rundot_kinetix_world_abi_version', '_rundot_kinetix_numeric_environment_valid',
|
|
36
91
|
'_rundot_kinetix_world_joint_warm_state_stride',
|
|
37
92
|
'_rundot_kinetix_world_topology_abi_version',
|
|
93
|
+
'_rundot_kinetix_world_topology_geometry_abi_version',
|
|
94
|
+
'_rundot_kinetix_world_topology_geometry_command_stride',
|
|
38
95
|
'_rundot_kinetix_world_topology_command_stride',
|
|
39
96
|
'_rundot_kinetix_world_topology_result_stride',
|
|
40
97
|
'_rundot_kinetix_world_topology_info_stride',
|
|
41
98
|
'_rundot_kinetix_world_topology_max_commands',
|
|
42
99
|
'_rundot_kinetix_world_topology_body_id_stride',
|
|
43
100
|
'_rundot_kinetix_world_topology_joint_identity_stride',
|
|
101
|
+
'_rundot_kinetix_world_topology_fluid_id_stride',
|
|
44
102
|
'_rundot_kinetix_world_apply_topology_batch',
|
|
103
|
+
'_rundot_kinetix_world_apply_topology_geometry_batch',
|
|
104
|
+
'_rundot_kinetix_world_prepare_topology_edit',
|
|
105
|
+
'_rundot_kinetix_world_copy_topology_edit_removed',
|
|
106
|
+
'_rundot_kinetix_world_commit_topology_edit',
|
|
107
|
+
'_rundot_kinetix_world_abandon_topology_edit',
|
|
108
|
+
'_rundot_kinetix_world_body_geometry_info',
|
|
109
|
+
'_rundot_kinetix_world_copy_body_geometry',
|
|
45
110
|
'_rundot_kinetix_world_topology_info',
|
|
46
111
|
'_rundot_kinetix_world_copy_topology',
|
|
47
112
|
'_rundot_kinetix_world_body_exists',
|
|
48
113
|
'_rundot_kinetix_world_joint_exists',
|
|
114
|
+
'_rundot_kinetix_world_fluid_exists',
|
|
49
115
|
'_rundot_kinetix_world_read_body',
|
|
50
116
|
'_rundot_kinetix_world_read_joint',
|
|
117
|
+
'_rundot_kinetix_world_read_fluid',
|
|
51
118
|
'_rundot_kinetix_world_contact_output_info',
|
|
52
119
|
'_rundot_kinetix_world_copy_contact_output',
|
|
120
|
+
'_rundot_kinetix_world_joint_output_info',
|
|
121
|
+
'_rundot_kinetix_world_copy_joint_output',
|
|
122
|
+
'_rundot_kinetix_world_fluid_interaction_info',
|
|
123
|
+
'_rundot_kinetix_world_copy_fluid_interactions',
|
|
53
124
|
'_rundot_kinetix_world_max_handles',
|
|
54
125
|
'_rundot_kinetix_world_buffer_allocate',
|
|
55
126
|
'_rundot_kinetix_world_buffer_free',
|
|
56
127
|
'_rundot_kinetix_world_create',
|
|
128
|
+
'_rundot_kinetix_instance_ledger_info',
|
|
129
|
+
'_rundot_kinetix_instance_ledger_metadata',
|
|
130
|
+
'_rundot_kinetix_instance_ledger_classes',
|
|
131
|
+
'_rundot_kinetix_instance_ledger_reset_high_water',
|
|
132
|
+
'_rundot_kinetix_world_attach',
|
|
133
|
+
'_rundot_kinetix_world_capture_cache_bytes',
|
|
134
|
+
'_rundot_kinetix_world_checkpoint_capacity',
|
|
135
|
+
'_rundot_kinetix_world_checkpoint_capture_snapshot_token',
|
|
136
|
+
'_rundot_kinetix_world_checkpoint_capture_token',
|
|
137
|
+
'_rundot_kinetix_world_checkpoint_legacy_preflight',
|
|
138
|
+
'_rundot_kinetix_world_checkpoint_live_count',
|
|
139
|
+
'_rundot_kinetix_world_checkpoint_preflight',
|
|
140
|
+
'_rundot_kinetix_world_checkpoint_release_token',
|
|
141
|
+
'_rundot_kinetix_world_checkpoint_restore_token',
|
|
142
|
+
'_rundot_kinetix_world_create_with_checkpoint_capacity',
|
|
143
|
+
'_rundot_kinetix_world_detach',
|
|
144
|
+
'_rundot_kinetix_world_import_snapshot_attached',
|
|
145
|
+
'_rundot_kinetix_world_ownership_counts',
|
|
146
|
+
'_rundot_kinetix_world_revision',
|
|
57
147
|
'_rundot_kinetix_world_destroy',
|
|
58
148
|
'_rundot_kinetix_world_digest',
|
|
149
|
+
'_rundot_kinetix_world_digest_algorithm_revision',
|
|
150
|
+
'_rundot_kinetix_world_checkpoint_digest',
|
|
151
|
+
'_rundot_kinetix_world_checkpoint_strong_digest',
|
|
152
|
+
'_rundot_kinetix_world_checkpoint_strong_digest_token',
|
|
153
|
+
'_rundot_kinetix_world_strong_digest_algorithm_revision',
|
|
154
|
+
'_rundot_kinetix_world_checkpoint_digest_token',
|
|
155
|
+
'_rundot_kinetix_world_checkpoint_view_info',
|
|
156
|
+
'_rundot_kinetix_world_checkpoint_view_info_token',
|
|
157
|
+
'_rundot_kinetix_world_checkpoint_write_body_motion_into',
|
|
158
|
+
'_rundot_kinetix_world_checkpoint_write_body_motion_into_token',
|
|
159
|
+
'_rundot_kinetix_world_checkpoint_copy_latest_output',
|
|
160
|
+
'_rundot_kinetix_world_checkpoint_copy_latest_output_token',
|
|
161
|
+
'_rundot_kinetix_world_checkpoint_import',
|
|
162
|
+
'_rundot_kinetix_world_checkpoint_import_token',
|
|
163
|
+
'_rundot_kinetix_world_frame',
|
|
59
164
|
'_rundot_kinetix_world_replace_state',
|
|
60
165
|
'_rundot_kinetix_world_step',
|
|
61
166
|
'_rundot_kinetix_world_apply_impulse',
|
|
167
|
+
'_rundot_kinetix_world_set_body_force',
|
|
168
|
+
'_rundot_kinetix_world_apply_force',
|
|
169
|
+
'_rundot_kinetix_world_apply_force_at_point',
|
|
170
|
+
'_rundot_kinetix_world_clear_body_force',
|
|
171
|
+
'_rundot_kinetix_world_set_body_surface_velocity',
|
|
172
|
+
'_rundot_kinetix_world_max_support_records',
|
|
173
|
+
'_rundot_kinetix_world_apply_support',
|
|
174
|
+
'_rundot_kinetix_world_read_surface_velocity',
|
|
175
|
+
'_rundot_kinetix_world_read_body_mobility',
|
|
176
|
+
'_rundot_kinetix_world_read_pending_support_impulse',
|
|
177
|
+
'_rundot_kinetix_world_set_body_linear_velocity',
|
|
178
|
+
'_rundot_kinetix_world_set_body_angular_velocity',
|
|
179
|
+
'_rundot_kinetix_world_set_body_transform',
|
|
180
|
+
'_rundot_kinetix_world_set_body_linear_damping',
|
|
181
|
+
'_rundot_kinetix_world_wake_body',
|
|
182
|
+
'_rundot_kinetix_world_write_body_motion',
|
|
183
|
+
'_rundot_kinetix_world_motion_pose_stride',
|
|
184
|
+
'_rundot_kinetix_world_motion_velocity_stride',
|
|
185
|
+
'_rundot_kinetix_world_motion_status_version',
|
|
186
|
+
'_rundot_kinetix_world_motion_pose_value_limit',
|
|
187
|
+
'_rundot_kinetix_world_motion_velocity_value_limit',
|
|
188
|
+
'_rundot_kinetix_world_motion_id_word_limit',
|
|
189
|
+
'_rundot_kinetix_world_motion_status_byte_limit',
|
|
190
|
+
'_rundot_kinetix_physics_buoyancy',
|
|
191
|
+
'_rundot_kinetix_physics_voxel_buoyancy',
|
|
192
|
+
'_rundot_kinetix_physics_buoyancy_abi_version',
|
|
193
|
+
'_rundot_kinetix_physics_buoyancy_input_stride',
|
|
194
|
+
'_rundot_kinetix_physics_buoyancy_output_stride',
|
|
195
|
+
'_rundot_kinetix_physics_fluid_abi_version',
|
|
196
|
+
'_rundot_kinetix_physics_fluid_forces_input_stride',
|
|
197
|
+
'_rundot_kinetix_physics_fluid_forces_output_stride',
|
|
198
|
+
'_rundot_kinetix_physics_fluid_volume_input_stride',
|
|
199
|
+
'_rundot_kinetix_physics_fluid_state_forces_input_stride',
|
|
200
|
+
'_rundot_kinetix_physics_fluid_forces',
|
|
201
|
+
'_rundot_kinetix_physics_fluid_state_forces',
|
|
202
|
+
'_rundot_kinetix_physics_voxel_fluid_forces',
|
|
62
203
|
'_rundot_kinetix_world_query',
|
|
204
|
+
'_rundot_kinetix_world_query_body_ray',
|
|
63
205
|
'_rundot_kinetix_world_state_info',
|
|
64
206
|
'_rundot_kinetix_world_copy_state',
|
|
65
207
|
'_rundot_kinetix_world_capture_snapshot',
|
|
@@ -94,23 +236,31 @@ const profiles = {
|
|
|
94
236
|
'_rundot_kinetix_physics_raycast',
|
|
95
237
|
'_rundot_kinetix_physics_overlap',
|
|
96
238
|
'_rundot_kinetix_physics_shape_cast',
|
|
239
|
+
...extendedPhysicsExportedFunctions,
|
|
97
240
|
],
|
|
98
241
|
metadata: {
|
|
99
|
-
abiVersion:
|
|
242
|
+
abiVersion: 21, bodyStride: 44, jointStride: 50, worldAbiVersion: 13, strongDigestAlgorithmRevision: 1, worldSnapshotVersion: 16, worldSnapshotVersions: [14, 15, 16], digestAlgorithmRevision: 2, jointWarmStateStride: 160,
|
|
100
243
|
contactTelemetryStride: 9, jointTelemetryStride: 11,
|
|
101
244
|
queryInputStride: 21, queryResultStride: 9,
|
|
102
245
|
},
|
|
103
246
|
},
|
|
104
247
|
physics2d: {
|
|
105
248
|
exceptionFlag: '-fno-exceptions',
|
|
249
|
+
extraFlags: ['-D_LIBCPP_VERBOSE_ABORT(...)=__builtin_trap()'],
|
|
106
250
|
wasmName: 'physics2d.wasm',
|
|
107
251
|
generatedPath: ['src', 'physics2d', 'physics2d-wasm-module.generated.mjs'],
|
|
108
252
|
metadataExport: 'physics2dWasmMetadata',
|
|
109
253
|
base64Export: 'physics2dWasmModuleBase64',
|
|
110
254
|
sources: [
|
|
111
255
|
'native/physics2d/physics2d.hpp', 'native/physics2d/physics2d.cpp',
|
|
256
|
+
'native/physics2d/contour.hpp', 'native/physics2d/contour.cpp',
|
|
257
|
+
'native/physics2d/ccd.hpp', 'native/physics2d/ccd.cpp',
|
|
258
|
+
'native/physics2d/compound.hpp', 'native/physics2d/compound.cpp',
|
|
112
259
|
'native/physics2d/fluid.hpp', 'native/physics2d/fluid.cpp',
|
|
113
260
|
'native/physics2d/joints.hpp', 'native/physics2d/joints.cpp',
|
|
261
|
+
'native/physics2d/joint_phases.hpp', 'native/physics2d/phase_test_hooks.hpp',
|
|
262
|
+
'native/physics2d/clock_primitives.hpp',
|
|
263
|
+
'native/physics2d/frame_scope.hpp', 'native/physics2d/memory_private.hpp', 'native/physics2d/checkpoint_memory.hpp',
|
|
114
264
|
'native/physics2d/queries.hpp', 'native/physics2d/queries.cpp',
|
|
115
265
|
'native/physics2d/world.hpp', 'native/physics2d/world.cpp',
|
|
116
266
|
'native/physics2d/commands.hpp', 'native/physics2d/commands.cpp',
|
|
@@ -119,7 +269,9 @@ const profiles = {
|
|
|
119
269
|
...commonSources,
|
|
120
270
|
],
|
|
121
271
|
compileSources: [
|
|
122
|
-
'native/physics2d/physics2d.cpp', 'native/physics2d/
|
|
272
|
+
'native/physics2d/physics2d.cpp', 'native/physics2d/contour.cpp', 'native/physics2d/ccd.cpp',
|
|
273
|
+
'native/physics2d/compound.cpp',
|
|
274
|
+
'native/physics2d/buoyancy.cpp',
|
|
123
275
|
'native/physics2d/fluid.cpp', 'native/physics2d/joints.cpp',
|
|
124
276
|
'native/physics2d/queries.cpp',
|
|
125
277
|
'native/physics2d/world.cpp',
|
|
@@ -130,13 +282,32 @@ const profiles = {
|
|
|
130
282
|
exportedFunctions: [
|
|
131
283
|
'_malloc', '_free',
|
|
132
284
|
'_rundot_physics2d_owned_c_abi_version',
|
|
285
|
+
'_rundot_physics2d_owned_checkpoint_token_size',
|
|
286
|
+
'_rundot_physics2d_owned_instance_ledger_info',
|
|
287
|
+
'_rundot_physics2d_owned_instance_ledger_reset',
|
|
288
|
+
'_rundot_physics2d_owned_world_attach',
|
|
289
|
+
'_rundot_physics2d_owned_world_checkpoint_capacity',
|
|
290
|
+
'_rundot_physics2d_owned_world_checkpoint_capture_size_token',
|
|
291
|
+
'_rundot_physics2d_owned_world_checkpoint_capture_snapshot_token',
|
|
292
|
+
'_rundot_physics2d_owned_world_checkpoint_capture_token',
|
|
293
|
+
'_rundot_physics2d_owned_world_checkpoint_live_count',
|
|
294
|
+
'_rundot_physics2d_owned_world_checkpoint_preflight',
|
|
295
|
+
'_rundot_physics2d_owned_world_checkpoint_release_token',
|
|
296
|
+
'_rundot_physics2d_owned_world_checkpoint_restore_token',
|
|
297
|
+
'_rundot_physics2d_owned_world_detach',
|
|
298
|
+
'_rundot_physics2d_owned_world_restore_authorized',
|
|
299
|
+
'_rundot_physics2d_owned_world_revision',
|
|
300
|
+
'_rundot_physics2d_owned_world_sample_fluid_medium',
|
|
133
301
|
'_rundot_physics2d_owned_world_storage_abi_version',
|
|
134
302
|
'_rundot_physics2d_owned_snapshot_version',
|
|
135
303
|
'_rundot_physics2d_owned_required_settings_abi_version',
|
|
136
304
|
'_rundot_physics2d_owned_physics_profile',
|
|
137
|
-
'_rundot_physics2d_owned_registry_size',
|
|
138
|
-
'_rundot_physics2d_owned_registry_alignment',
|
|
139
305
|
'_rundot_physics2d_owned_max_worlds_per_registry',
|
|
306
|
+
'_rundot_physics2d_owned_max_registries',
|
|
307
|
+
'_rundot_physics2d_owned_registry_create',
|
|
308
|
+
'_rundot_physics2d_owned_registry_destroy',
|
|
309
|
+
'_rundot_physics2d_owned_buffer_allocate',
|
|
310
|
+
'_rundot_physics2d_owned_buffer_free',
|
|
140
311
|
'_rundot_physics2d_owned_world_key_size',
|
|
141
312
|
'_rundot_physics2d_owned_world_capacity_size',
|
|
142
313
|
'_rundot_physics2d_owned_world_settings_size',
|
|
@@ -147,8 +318,7 @@ const profiles = {
|
|
|
147
318
|
'_rundot_physics2d_owned_entity_handle_size',
|
|
148
319
|
'_rundot_physics2d_owned_removed_identity_size',
|
|
149
320
|
'_rundot_physics2d_owned_body_payload_size',
|
|
150
|
-
'
|
|
151
|
-
'_rundot_physics2d_owned_registry_deinit',
|
|
321
|
+
'_rundot_physics2d_owned_contact_event_size',
|
|
152
322
|
'_rundot_physics2d_owned_world_create',
|
|
153
323
|
'_rundot_physics2d_owned_world_destroy',
|
|
154
324
|
'_rundot_physics2d_owned_world_info',
|
|
@@ -161,6 +331,7 @@ const profiles = {
|
|
|
161
331
|
'_rundot_physics2d_owned_world_read_body',
|
|
162
332
|
'_rundot_physics2d_owned_world_read_joint',
|
|
163
333
|
'_rundot_physics2d_owned_world_read_fluid',
|
|
334
|
+
'_rundot_physics2d_owned_world_read_contour_edges',
|
|
164
335
|
'_rundot_physics2d_owned_world_copy_latest_outputs',
|
|
165
336
|
'_rundot_physics2d_owned_world_capture',
|
|
166
337
|
'_rundot_physics2d_owned_world_restore',
|
|
@@ -172,6 +343,7 @@ const profiles = {
|
|
|
172
343
|
'_rundot_physics2d_owned_world_checkpoint_capture_snapshot',
|
|
173
344
|
'_rundot_physics2d_owned_world_raycast',
|
|
174
345
|
'_rundot_physics2d_owned_world_overlap',
|
|
346
|
+
'_rundot_physics2d_owned_world_overlap_contacts',
|
|
175
347
|
'_rundot_physics2d_owned_world_shape_cast',
|
|
176
348
|
'_rundot_physics2d_owned_world_closest_points',
|
|
177
349
|
'_rundot_physics2d_abi_version',
|
|
@@ -184,7 +356,13 @@ const profiles = {
|
|
|
184
356
|
'_rundot_physics2d_max_velocity_iterations',
|
|
185
357
|
'_rundot_physics2d_polygon_geometry_size',
|
|
186
358
|
'_rundot_physics2d_polygon_mass_properties_size',
|
|
359
|
+
'_rundot_physics2d_set_polygon_geometry',
|
|
360
|
+
'_rundot_physics2d_set_contour_geometry',
|
|
187
361
|
'_rundot_physics2d_polygon_mass_properties',
|
|
362
|
+
'_rundot_physics2d_collide',
|
|
363
|
+
'_rundot_physics2d_ccd_abi_version',
|
|
364
|
+
'_rundot_physics2d_ccd_time_of_impact',
|
|
365
|
+
'_rundot_physics2d_ccd_time_of_impact_ex',
|
|
188
366
|
'_rundot_physics2d_max_polygon_vertices',
|
|
189
367
|
'_rundot_physics2d_fluid_abi_version',
|
|
190
368
|
'_rundot_physics2d_fluid_region_size',
|
|
@@ -212,15 +390,35 @@ const profiles = {
|
|
|
212
390
|
'_rundot_physics2d_cast_hit_size',
|
|
213
391
|
'_rundot_physics2d_closest_point_hit_size',
|
|
214
392
|
'_rundot_physics2d_overlap_hit_size',
|
|
393
|
+
'_rundot_physics2d_overlap_contact_hit_size',
|
|
394
|
+
'_rundot_physics2d_overlap_contacts',
|
|
215
395
|
'_rundot_physics2d_submerged_geometry_abi_version',
|
|
216
396
|
'_rundot_physics2d_submerged_geometry_input_size',
|
|
217
397
|
'_rundot_physics2d_submerged_geometry_output_size',
|
|
218
398
|
'_rundot_physics2d_submerged_geometry_max_vertices',
|
|
219
399
|
'_rundot_physics2d_submerged_geometry_max_queries',
|
|
400
|
+
'_rundot_physics2d_submerged_geometry',
|
|
401
|
+
'_rundot_physics2d_compound_abi_version',
|
|
402
|
+
'_rundot_physics2d_compound_child_size',
|
|
403
|
+
'_rundot_physics2d_compound_body_size',
|
|
404
|
+
'_rundot_physics2d_compound_compute_mass',
|
|
405
|
+
'_rundot_physics2d_compound_collide',
|
|
406
|
+
'_rundot_physics2d_owned_particle_fluid_abi_version',
|
|
407
|
+
'_rundot_physics2d_owned_particle_fluid_state_size',
|
|
408
|
+
'_rundot_physics2d_owned_particle_fluid_config_size',
|
|
409
|
+
'_rundot_physics2d_owned_particle_fluid_particle_size',
|
|
410
|
+
'_rundot_physics2d_owned_particle_fluid_max_particles',
|
|
411
|
+
'_rundot_physics2d_owned_particle_fluid_init_grid',
|
|
412
|
+
'_rundot_physics2d_owned_particle_fluid_emit',
|
|
413
|
+
'_rundot_physics2d_owned_particle_fluid_step',
|
|
414
|
+
'_rundot_physics2d_owned_particle_fluid_sample',
|
|
415
|
+
'_rundot_physics2d_owned_particle_fluid_total_mass',
|
|
416
|
+
'_rundot_physics2d_owned_particle_fluid_volume',
|
|
417
|
+
'_rundot_physics2d_owned_particle_fluid_validate',
|
|
220
418
|
],
|
|
221
419
|
metadata: {
|
|
222
|
-
abiVersion:
|
|
223
|
-
ownedCAbiVersion:
|
|
420
|
+
abiVersion: 5, bodyBytes: 160, manifoldBytes: 104, stepOptionsBytes: 32,
|
|
421
|
+
ownedCAbiVersion: 6, worldAbiVersion: 7, worldSnapshotVersion: 6,
|
|
224
422
|
worldSettingsAbiVersion: 1, worldPhysicsProfile: 1,
|
|
225
423
|
polygonGeometryBytes: 136, polygonMassPropertiesBytes: 32, maxPolygonVertices: 8,
|
|
226
424
|
maxBodies: 4096, maxCandidatePairs: 1 << 18,
|
|
@@ -230,14 +428,25 @@ const profiles = {
|
|
|
230
428
|
fluidAbiVersion: 1, fluidRegionBytes: 112, fluidStateBytes: 7176, maxFluidRegions: 64,
|
|
231
429
|
jointAbiVersion: 2, jointRecordBytes: 160, jointStateBytes: 128, jointTelemetryBytes: 80,
|
|
232
430
|
jointBreakEventBytes: 16, gearReactionBytes: 64, maxGearReactionEntries: 16384, maxJoints: 4096, maxJointWarmRows: 8, maxJointEvents: 4096,
|
|
233
|
-
queryAbiVersion:
|
|
431
|
+
queryAbiVersion: 3, queryShapeBytes: 160, raycastQueryBytes: 48,
|
|
234
432
|
overlapQueryBytes: 192, shapeCastQueryBytes: 216, closestPointsQueryBytes: 24,
|
|
235
|
-
queryFilterBytes:
|
|
433
|
+
queryFilterBytes: 16, castHitBytes: 64, closestPointHitBytes: 40, overlapHitBytes: 8,
|
|
236
434
|
},
|
|
237
435
|
},
|
|
238
436
|
|
|
239
437
|
};
|
|
240
438
|
|
|
439
|
+
const physicsProfile = {
|
|
440
|
+
...profiles.physics3d,
|
|
441
|
+
profilingFunctions: true,
|
|
442
|
+
wasmName: 'physics-profile.wasm',
|
|
443
|
+
generatedPath: ['src', 'physics', 'physics-profile-wasm-module.generated.mjs'],
|
|
444
|
+
metadataExport: 'physicsProfileWasmMetadata',
|
|
445
|
+
base64Export: 'physicsProfileWasmModuleBase64',
|
|
446
|
+
assetPath: ['assets', 'physics-profile.wasm'],
|
|
447
|
+
assetMetadataPath: ['assets', 'physics-profile.metadata.json'],
|
|
448
|
+
};
|
|
449
|
+
|
|
241
450
|
function probeCompiler() {
|
|
242
451
|
for (const candidate of ['em++', 'emcc']) {
|
|
243
452
|
const probe = spawnSync(candidate, ['--version'], { encoding: 'utf8' });
|
|
@@ -264,7 +473,7 @@ function compilerFlags(profile) {
|
|
|
264
473
|
'--no-entry', '-sSTANDALONE_WASM=1', '-sALLOW_MEMORY_GROWTH=1',
|
|
265
474
|
'-sABORTING_MALLOC=0',
|
|
266
475
|
'-sERROR_ON_UNDEFINED_SYMBOLS=1',
|
|
267
|
-
...(profilingFunctions ? ['--profiling-funcs'] : []),
|
|
476
|
+
...(profile.profilingFunctions ? ['--profiling-funcs'] : []),
|
|
268
477
|
...(profile.extraFlags ?? []),
|
|
269
478
|
`-sEXPORTED_FUNCTIONS=[${profile.exportedFunctions.map((name) => JSON.stringify(name)).join(',')}]`,
|
|
270
479
|
];
|
|
@@ -277,6 +486,7 @@ function compileWasm(profile, compiler, wasmPath) {
|
|
|
277
486
|
...profile.compileSources.map((source) => join(root, source)),
|
|
278
487
|
'-o', wasmPath,
|
|
279
488
|
], {
|
|
489
|
+
cwd: root,
|
|
280
490
|
encoding: 'utf8',
|
|
281
491
|
env: { ...process.env, EM_CACHE: join(buildDirectory, 'em-cache') },
|
|
282
492
|
});
|
|
@@ -334,6 +544,11 @@ function buildProfile(profile, { check = false } = {}) {
|
|
|
334
544
|
compilerVersion: compiler.version,
|
|
335
545
|
sourceHash: expectedSourceHash,
|
|
336
546
|
wasmSha256: createHash('sha256').update(wasmBytes).digest('hex'),
|
|
547
|
+
artifact: profile.profilingFunctions ? 'profile' : 'production',
|
|
548
|
+
packageVersion: JSON.parse(readFileSync(join(root, '..', 'package.json'), 'utf8')).version,
|
|
549
|
+
compilerFlags: compilerFlags(profile),
|
|
550
|
+
simulationSourceHash: profile.profilingFunctions
|
|
551
|
+
? sourceHash(profiles.physics3d) : expectedSourceHash,
|
|
337
552
|
};
|
|
338
553
|
const generated = renderGenerated(profile, metadata, wasmBytes);
|
|
339
554
|
if (check) {
|
|
@@ -342,11 +557,28 @@ function buildProfile(profile, { check = false } = {}) {
|
|
|
342
557
|
if (JSON.stringify(current.metadata) !== JSON.stringify(rebuilt.metadata) || current.base64 !== rebuilt.base64) {
|
|
343
558
|
throw new Error(`KINETIX_WASM_GENERATED_DRIFT ${generatedModulePath}`);
|
|
344
559
|
}
|
|
560
|
+
if (profile.assetPath) {
|
|
561
|
+
const assetPath = join(root, ...profile.assetPath);
|
|
562
|
+
const assetMetadataPath = join(root, ...profile.assetMetadataPath);
|
|
563
|
+
if (!readFileSync(assetPath).equals(wasmBytes)
|
|
564
|
+
|| readFileSync(assetMetadataPath, 'utf8') !== `${JSON.stringify(metadata, null, 2)}\n`) {
|
|
565
|
+
throw new Error(`KINETIX_WASM_PROFILE_ASSET_DRIFT ${assetPath}`);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
345
568
|
} else {
|
|
346
569
|
mkdirSync(dirname(generatedModulePath), { recursive: true });
|
|
347
570
|
const stagingPath = `${generatedModulePath}.${process.pid}.tmp`;
|
|
348
571
|
writeFileSync(stagingPath, generated, 'utf8');
|
|
349
572
|
renameSync(stagingPath, generatedModulePath);
|
|
573
|
+
if (profile.assetPath) {
|
|
574
|
+
const assetPath = join(root, ...profile.assetPath);
|
|
575
|
+
const assetMetadataPath = join(root, ...profile.assetMetadataPath);
|
|
576
|
+
mkdirSync(dirname(assetPath), { recursive: true });
|
|
577
|
+
writeFileSync(`${assetPath}.${process.pid}.tmp`, wasmBytes);
|
|
578
|
+
renameSync(`${assetPath}.${process.pid}.tmp`, assetPath);
|
|
579
|
+
writeFileSync(`${assetMetadataPath}.${process.pid}.tmp`, `${JSON.stringify(metadata, null, 2)}\n`);
|
|
580
|
+
renameSync(`${assetMetadataPath}.${process.pid}.tmp`, assetMetadataPath);
|
|
581
|
+
}
|
|
350
582
|
}
|
|
351
583
|
return { metadata, wasmPath, generatedModulePath };
|
|
352
584
|
}
|
|
@@ -362,7 +594,11 @@ function invokedDirectly() {
|
|
|
362
594
|
}
|
|
363
595
|
|
|
364
596
|
export function buildWasmPhysics(options = {}) {
|
|
365
|
-
|
|
597
|
+
const artifact = options.artifact ?? (profilingFunctions ? 'profile' : 'production');
|
|
598
|
+
if (artifact !== 'production' && artifact !== 'profile') {
|
|
599
|
+
throw new Error('KINETIX_WASM_ARTIFACT_INVALID artifact must be production or profile');
|
|
600
|
+
}
|
|
601
|
+
return buildProfile(artifact === 'profile' ? physicsProfile : profiles.physics3d, options);
|
|
366
602
|
}
|
|
367
603
|
|
|
368
604
|
export function buildWasmPhysics2D(options = {}) {
|
|
@@ -370,7 +606,8 @@ export function buildWasmPhysics2D(options = {}) {
|
|
|
370
606
|
}
|
|
371
607
|
|
|
372
608
|
export function getWasmPhysicsSourceHashes() {
|
|
373
|
-
return Object.fromEntries(Object.entries(profiles)
|
|
609
|
+
return Object.fromEntries([...Object.entries(profiles), ['physics3dProfile', physicsProfile]]
|
|
610
|
+
.map(([name, profile]) => [name, sourceHash(profile)]));
|
|
374
611
|
}
|
|
375
612
|
|
|
376
613
|
/**
|
|
@@ -380,7 +617,7 @@ export function getWasmPhysicsSourceHashes() {
|
|
|
380
617
|
*/
|
|
381
618
|
export function getWasmNumericProfile({ all = false } = {}) {
|
|
382
619
|
const targetProfiles = all
|
|
383
|
-
? Object.entries(profiles)
|
|
620
|
+
? [...Object.entries(profiles), ['physics3dProfile', physicsProfile]]
|
|
384
621
|
: Object.entries(profiles).filter(([name]) => name === 'physics3d' || name === 'physics2d');
|
|
385
622
|
return Object.freeze(targetProfiles.map(([name, profile]) => Object.freeze({
|
|
386
623
|
artifact: name,
|
|
@@ -391,9 +628,21 @@ export function getWasmNumericProfile({ all = false } = {}) {
|
|
|
391
628
|
|
|
392
629
|
if (invokedDirectly()) {
|
|
393
630
|
const check = process.argv.includes('--check');
|
|
394
|
-
const
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
]
|
|
631
|
+
const profileArg = process.argv.find((arg) => arg.startsWith('--profile='));
|
|
632
|
+
const profileName = profileArg ? profileArg.split('=')[1]
|
|
633
|
+
: profilingFunctions ? 'physics3d-profile' : null;
|
|
634
|
+
if (profileName !== null && !['physics3d', 'physics3d-profile', 'physics2d'].includes(profileName)) {
|
|
635
|
+
throw new Error(`KINETIX_WASM_PROFILE_INVALID ${profileName}`);
|
|
636
|
+
}
|
|
637
|
+
const results = [];
|
|
638
|
+
if (!profileName || profileName === 'physics3d') {
|
|
639
|
+
results.push(buildWasmPhysics({ check, artifact: 'production' }));
|
|
640
|
+
}
|
|
641
|
+
if (profileName === 'physics3d-profile') {
|
|
642
|
+
results.push(buildWasmPhysics({ check, artifact: 'profile' }));
|
|
643
|
+
}
|
|
644
|
+
if (!profileName || profileName === 'physics2d') {
|
|
645
|
+
results.push(buildWasmPhysics2D({ check }));
|
|
646
|
+
}
|
|
398
647
|
for (const result of results) console.log(`KINETIX_WASM_BUILD_OK ${result.wasmPath}`);
|
|
399
648
|
}
|