@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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { defaultChecksum } from './canonical.js';
|
|
2
|
+
import { meters } from './physics/units.js';
|
|
2
3
|
export function runDeterministicLagCompensation3DFixture(physicsWorld, players = 128, frames = 512, seed = 71) {
|
|
3
4
|
const primary = simulateLagCompensation3D(physicsWorld, players, frames, seed);
|
|
4
5
|
const restored = simulateLagCompensation3D(physicsWorld, players, frames, seed);
|
|
@@ -163,7 +164,7 @@ export function runDeterministicLagCompensation3DApiFixture(physicsWorld) {
|
|
|
163
164
|
x: 8,
|
|
164
165
|
y: 1.4,
|
|
165
166
|
z: 0,
|
|
166
|
-
shape: { type: 'box', halfX: 0.25, halfY: 2, halfZ: 2 },
|
|
167
|
+
shape: { type: 'box', halfX: meters(0.25), halfY: meters(2), halfZ: meters(2) },
|
|
167
168
|
layer: 2,
|
|
168
169
|
mask: 3,
|
|
169
170
|
}], hitShot);
|
|
@@ -380,13 +381,13 @@ function pelletDirectionMatchesShot(shotDirection, pelletDirection) {
|
|
|
380
381
|
}
|
|
381
382
|
function validatePellet(physicsWorld, bodyIds, shot, pelletDirection) {
|
|
382
383
|
const hit = physicsWorld.raycast({
|
|
383
|
-
x: shot.x,
|
|
384
|
-
y: shot.y,
|
|
385
|
-
z: shot.z,
|
|
384
|
+
x: meters(shot.x),
|
|
385
|
+
y: meters(shot.y),
|
|
386
|
+
z: meters(shot.z),
|
|
386
387
|
dx: pelletDirection.x,
|
|
387
388
|
dy: pelletDirection.y,
|
|
388
389
|
dz: pelletDirection.z,
|
|
389
|
-
maxDistance: shot.maxDistance,
|
|
390
|
+
maxDistance: meters(shot.maxDistance),
|
|
390
391
|
layerMask: 3,
|
|
391
392
|
})[0];
|
|
392
393
|
if (hit === undefined) {
|
|
@@ -424,7 +425,7 @@ function withLagCompensationBodies(physicsWorld, bodies, query) {
|
|
|
424
425
|
const handles = physicsWorld.edit((edit) => bodies.map((body) => edit.createBody({
|
|
425
426
|
kind: 'static',
|
|
426
427
|
shape: body.shape,
|
|
427
|
-
position: { x: body.x, y: body.y, z: body.z },
|
|
428
|
+
position: { x: meters(body.x), y: meters(body.y), z: meters(body.z) },
|
|
428
429
|
layer: body.layer,
|
|
429
430
|
mask: body.mask,
|
|
430
431
|
}))).created;
|
|
@@ -469,8 +470,8 @@ function buildHitboxProxies(history, rewindFrame, shooterSlot) {
|
|
|
469
470
|
const headOffset = snapshot.pose === 'crouching' ? 0.85 : 1.35;
|
|
470
471
|
const interpolationMarker = isInterpolatedLagCompensatedTarget3D(snapshot) ? '.interpolated' : '';
|
|
471
472
|
return [
|
|
472
|
-
hitboxProxy(`${snapshot.targetId}${interpolationMarker}.chest`, snapshot.x, snapshot.y + 0.45, snapshot.z, { type: 'capsule', radius: snapshot.radius, halfHeight: 0.55 }),
|
|
473
|
-
hitboxProxy(`${snapshot.targetId}${interpolationMarker}.head`, snapshot.x, snapshot.y + headOffset, snapshot.z, { type: 'sphere', radius: 0.28 }),
|
|
473
|
+
hitboxProxy(`${snapshot.targetId}${interpolationMarker}.chest`, snapshot.x, snapshot.y + 0.45, snapshot.z, { type: 'capsule', radius: meters(snapshot.radius), halfHeight: meters(0.55) }),
|
|
474
|
+
hitboxProxy(`${snapshot.targetId}${interpolationMarker}.head`, snapshot.x, snapshot.y + headOffset, snapshot.z, { type: 'sphere', radius: meters(0.28) }),
|
|
474
475
|
];
|
|
475
476
|
});
|
|
476
477
|
}
|
|
@@ -608,7 +609,7 @@ function buildStaticOccluders() {
|
|
|
608
609
|
x: 0,
|
|
609
610
|
y: 1.2,
|
|
610
611
|
z: 0,
|
|
611
|
-
shape: { type: 'box', halfX: 0.2, halfY: 2, halfZ: 18 },
|
|
612
|
+
shape: { type: 'box', halfX: meters(0.2), halfY: meters(2), halfZ: meters(18) },
|
|
612
613
|
layer: 2,
|
|
613
614
|
mask: 3,
|
|
614
615
|
},
|
|
@@ -618,7 +619,7 @@ function buildStaticOccluders() {
|
|
|
618
619
|
x: -7,
|
|
619
620
|
y: 1.2,
|
|
620
621
|
z: 4,
|
|
621
|
-
shape: { type: 'box', halfX: 0.8, halfY: 2, halfZ: 0.8 },
|
|
622
|
+
shape: { type: 'box', halfX: meters(0.8), halfY: meters(2), halfZ: meters(0.8) },
|
|
622
623
|
layer: 2,
|
|
623
624
|
mask: 3,
|
|
624
625
|
},
|
package/dist/match-log.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ConfirmedInputFrame, EncodedInput } from './input-authority.js';
|
|
2
2
|
import type { RuntimeSession } from './runtime-session.js';
|
|
3
|
+
import type { RuntimeFactoryResult } from './runtime-lease.js';
|
|
3
4
|
import { type SyncplaySecretCommand } from './secret-protocol.js';
|
|
4
5
|
/**
|
|
5
6
|
* Server-ordered match logs + offline re-simulation verification (G3).
|
|
@@ -47,15 +48,27 @@ export interface ScoredMatchLogVerificationConfig<State, Input> {
|
|
|
47
48
|
/** Game-supplied: read the canonical score out of the final state. */
|
|
48
49
|
readonly extractScore: (finalState: State) => number;
|
|
49
50
|
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
* either a desynced match or a non-deterministic game build.
|
|
51
|
+
* Wire checksum from a checksum-report at `confirmedThrough`.
|
|
52
|
+
* That report stores `getWireStateChecksum(tick + 1)`.
|
|
53
|
+
* A mismatch means the server log and the clients' sim disagree.
|
|
54
54
|
*/
|
|
55
55
|
readonly expectedFinalChecksum?: string;
|
|
56
56
|
readonly expectedAuthorityId?: string;
|
|
57
57
|
readonly verifyAuthorityCommand?: (command: SyncplaySecretCommand, expectedAuthorityId: string) => boolean;
|
|
58
58
|
}
|
|
59
|
+
export interface ScoredMatchLogVerificationConfigAsync<State, Input> {
|
|
60
|
+
readonly log: SyncplayMatchLog;
|
|
61
|
+
readonly createSession: (params: {
|
|
62
|
+
seed: number;
|
|
63
|
+
playerCount: number;
|
|
64
|
+
}) => RuntimeFactoryResult<RuntimeSession<State, Input>> | PromiseLike<RuntimeFactoryResult<RuntimeSession<State, Input>>>;
|
|
65
|
+
readonly decodeInput: (encoded: EncodedInput) => Input;
|
|
66
|
+
readonly submittedScore: number;
|
|
67
|
+
readonly extractScore: (finalState: State) => number;
|
|
68
|
+
readonly expectedFinalChecksum?: string;
|
|
69
|
+
readonly expectedAuthorityId?: string;
|
|
70
|
+
readonly verifyAuthorityCommand?: (command: SyncplaySecretCommand, expectedAuthorityId: string) => boolean;
|
|
71
|
+
}
|
|
59
72
|
export type ScoredMatchLogRejection = 'log-not-contiguous' | 'checksum-mismatch' | 'authority-command-invalid' | 'score-mismatch';
|
|
60
73
|
export interface ScoredMatchLogVerdict {
|
|
61
74
|
readonly ok: boolean;
|
|
@@ -63,6 +76,10 @@ export interface ScoredMatchLogVerdict {
|
|
|
63
76
|
readonly replayScore?: number;
|
|
64
77
|
readonly submittedScore: number;
|
|
65
78
|
readonly framesReplayed: number;
|
|
79
|
+
/** Wire checksum at the final frame. This is the checksum-report value. */
|
|
66
80
|
readonly finalChecksum?: string;
|
|
81
|
+
/** Local simulation checksum. This is not the quorum value. */
|
|
82
|
+
readonly localChecksum?: string;
|
|
67
83
|
}
|
|
68
84
|
export declare function verifyScoredMatchLog<State, Input>(config: ScoredMatchLogVerificationConfig<State, Input>): ScoredMatchLogVerdict;
|
|
85
|
+
export declare function verifyScoredMatchLogAsync<State, Input>(config: ScoredMatchLogVerificationConfigAsync<State, Input>): Promise<ScoredMatchLogVerdict>;
|
package/dist/match-log.js
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
|
+
import { ensureDeterministicMathInstalled } from './math.js';
|
|
2
|
+
import { assertNotOwnedLease, runWithSessionAndLease, runWithSessionCleanup } from './runtime-cleanup.js';
|
|
1
3
|
import { hasSyncplaySecretCommandPrefix } from './secret-command-classification.js';
|
|
2
4
|
import { isSyncplaySecretCommand } from './secret-protocol.js';
|
|
5
|
+
function readFinalChecksums(session) {
|
|
6
|
+
return {
|
|
7
|
+
finalChecksum: session.getWireStateChecksum(session.currentFrame),
|
|
8
|
+
localChecksum: session.computeRecordedChecksum(session.currentFrame),
|
|
9
|
+
};
|
|
10
|
+
}
|
|
3
11
|
export function verifyScoredMatchLog(config) {
|
|
4
12
|
const { log } = config;
|
|
5
13
|
// The log must be the complete, gap-free tick 0..confirmedThrough sequence —
|
|
@@ -7,8 +15,10 @@ export function verifyScoredMatchLog(config) {
|
|
|
7
15
|
if (log.frames.length !== log.confirmedThrough + 1 || log.frames.some((frame, index) => frame.tick !== index)) {
|
|
8
16
|
return { ok: false, reason: 'log-not-contiguous', submittedScore: config.submittedScore, framesReplayed: 0 };
|
|
9
17
|
}
|
|
18
|
+
ensureDeterministicMathInstalled();
|
|
10
19
|
const session = config.createSession({ seed: log.seed, playerCount: log.playerCount });
|
|
11
|
-
|
|
20
|
+
assertNotOwnedLease(session, 'verifyScoredMatchLog', 'verifyScoredMatchLogAsync', true);
|
|
21
|
+
return runWithSessionCleanup(session, () => {
|
|
12
22
|
for (const frame of log.frames) {
|
|
13
23
|
const commands = frame.commands ?? [];
|
|
14
24
|
for (const command of commands) {
|
|
@@ -40,14 +50,15 @@ export function verifyScoredMatchLog(config) {
|
|
|
40
50
|
session.recordCommands(commands);
|
|
41
51
|
session.stepFrames(1);
|
|
42
52
|
}
|
|
43
|
-
const
|
|
44
|
-
if (config.expectedFinalChecksum !== undefined && finalChecksum !== config.expectedFinalChecksum) {
|
|
53
|
+
const checksums = readFinalChecksums(session);
|
|
54
|
+
if (config.expectedFinalChecksum !== undefined && checksums.finalChecksum !== config.expectedFinalChecksum) {
|
|
45
55
|
return {
|
|
46
56
|
ok: false,
|
|
47
57
|
reason: 'checksum-mismatch',
|
|
48
58
|
submittedScore: config.submittedScore,
|
|
49
59
|
framesReplayed: log.frames.length,
|
|
50
|
-
finalChecksum,
|
|
60
|
+
finalChecksum: checksums.finalChecksum,
|
|
61
|
+
localChecksum: checksums.localChecksum,
|
|
51
62
|
};
|
|
52
63
|
}
|
|
53
64
|
const replayScore = config.extractScore(session.getState());
|
|
@@ -58,7 +69,8 @@ export function verifyScoredMatchLog(config) {
|
|
|
58
69
|
replayScore,
|
|
59
70
|
submittedScore: config.submittedScore,
|
|
60
71
|
framesReplayed: log.frames.length,
|
|
61
|
-
finalChecksum,
|
|
72
|
+
finalChecksum: checksums.finalChecksum,
|
|
73
|
+
localChecksum: checksums.localChecksum,
|
|
62
74
|
};
|
|
63
75
|
}
|
|
64
76
|
return {
|
|
@@ -66,10 +78,81 @@ export function verifyScoredMatchLog(config) {
|
|
|
66
78
|
replayScore,
|
|
67
79
|
submittedScore: config.submittedScore,
|
|
68
80
|
framesReplayed: log.frames.length,
|
|
69
|
-
finalChecksum,
|
|
81
|
+
finalChecksum: checksums.finalChecksum,
|
|
82
|
+
localChecksum: checksums.localChecksum,
|
|
70
83
|
};
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
export async function verifyScoredMatchLogAsync(config) {
|
|
87
|
+
const { log } = config;
|
|
88
|
+
// The log must be the complete, gap-free tick 0..confirmedThrough sequence —
|
|
89
|
+
// a truncated or reordered log must never verify a score.
|
|
90
|
+
if (log.frames.length !== log.confirmedThrough + 1 || log.frames.some((frame, index) => frame.tick !== index)) {
|
|
91
|
+
return { ok: false, reason: 'log-not-contiguous', submittedScore: config.submittedScore, framesReplayed: 0 };
|
|
71
92
|
}
|
|
72
|
-
|
|
73
|
-
session
|
|
74
|
-
|
|
93
|
+
return runWithSessionAndLease(() => config.createSession({ seed: log.seed, playerCount: log.playerCount }), (session, registerSession) => {
|
|
94
|
+
registerSession(session);
|
|
95
|
+
for (const frame of log.frames) {
|
|
96
|
+
const commands = frame.commands ?? [];
|
|
97
|
+
for (const command of commands) {
|
|
98
|
+
if (!isSyncplaySecretCommand(command)) {
|
|
99
|
+
if (hasSyncplaySecretCommandPrefix(command)) {
|
|
100
|
+
return {
|
|
101
|
+
ok: false,
|
|
102
|
+
reason: 'authority-command-invalid',
|
|
103
|
+
submittedScore: config.submittedScore,
|
|
104
|
+
framesReplayed: frame.tick,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
if (config.expectedAuthorityId === undefined || config.verifyAuthorityCommand === undefined
|
|
110
|
+
|| command.authorityId !== config.expectedAuthorityId
|
|
111
|
+
|| !config.verifyAuthorityCommand(command, config.expectedAuthorityId)) {
|
|
112
|
+
return {
|
|
113
|
+
ok: false,
|
|
114
|
+
reason: 'authority-command-invalid',
|
|
115
|
+
submittedScore: config.submittedScore,
|
|
116
|
+
framesReplayed: frame.tick,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
for (let slot = 0; slot < log.playerCount; slot += 1) {
|
|
121
|
+
session.setInput(slot, config.decodeInput(frame.inputs[slot]));
|
|
122
|
+
}
|
|
123
|
+
session.recordCommands(commands);
|
|
124
|
+
session.stepFrames(1);
|
|
125
|
+
}
|
|
126
|
+
const checksums = readFinalChecksums(session);
|
|
127
|
+
if (config.expectedFinalChecksum !== undefined && checksums.finalChecksum !== config.expectedFinalChecksum) {
|
|
128
|
+
return {
|
|
129
|
+
ok: false,
|
|
130
|
+
reason: 'checksum-mismatch',
|
|
131
|
+
submittedScore: config.submittedScore,
|
|
132
|
+
framesReplayed: log.frames.length,
|
|
133
|
+
finalChecksum: checksums.finalChecksum,
|
|
134
|
+
localChecksum: checksums.localChecksum,
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
const replayScore = config.extractScore(session.getState());
|
|
138
|
+
if (replayScore !== config.submittedScore) {
|
|
139
|
+
return {
|
|
140
|
+
ok: false,
|
|
141
|
+
reason: 'score-mismatch',
|
|
142
|
+
replayScore,
|
|
143
|
+
submittedScore: config.submittedScore,
|
|
144
|
+
framesReplayed: log.frames.length,
|
|
145
|
+
finalChecksum: checksums.finalChecksum,
|
|
146
|
+
localChecksum: checksums.localChecksum,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
return {
|
|
150
|
+
ok: true,
|
|
151
|
+
replayScore,
|
|
152
|
+
submittedScore: config.submittedScore,
|
|
153
|
+
framesReplayed: log.frames.length,
|
|
154
|
+
finalChecksum: checksums.finalChecksum,
|
|
155
|
+
localChecksum: checksums.localChecksum,
|
|
156
|
+
};
|
|
157
|
+
});
|
|
75
158
|
}
|
package/dist/math.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export { DETERMINISTIC_MATH_PROFILE, DETERMINISTIC_MATH_VERSION, DETERMINISTIC_MATH_FUNCTIONS, DETERMINISTIC_MATH_KNOWN_ANSWERS, DeterministicMathConflictError, verifyDeterministicMathKnownAnswers, isDeterministicMathInstalled, installDeterministicMath, ensureDeterministicMathInstalled, createInitialStateWithDeterministicMath, } from '@series-inc/rundot-syncplay/core/runtime';
|
|
2
|
+
export type { DeterministicMathKnownAnswer, DeterministicMathConflictReason, DeterministicMathConflictErrorOptions, DeterministicMathCheckOptions, DeterministicMathInstallOptions, DeterministicMathAttestation, } from '@series-inc/rundot-syncplay/core/runtime';
|
|
1
3
|
export interface DeterministicMath {
|
|
2
4
|
readonly fixedScale: number;
|
|
3
5
|
readonly minFixed: number;
|
package/dist/math.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { DETERMINISTIC_MATH_PROFILE, DETERMINISTIC_MATH_VERSION, DETERMINISTIC_MATH_FUNCTIONS, DETERMINISTIC_MATH_KNOWN_ANSWERS, DeterministicMathConflictError, verifyDeterministicMathKnownAnswers, isDeterministicMathInstalled, installDeterministicMath, ensureDeterministicMathInstalled, createInitialStateWithDeterministicMath, } from '@series-inc/rundot-syncplay/core/runtime';
|
|
1
2
|
const DEFAULT_MIN_FIXED = -2_147_483_648;
|
|
2
3
|
const DEFAULT_MAX_FIXED = 2_147_483_647;
|
|
3
4
|
const MAX_CERTIFIED_FIXED_SCALE = 1_048_576;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DeterministicEventRecord } from '../events.js';
|
|
2
2
|
import { type DeterministicTopDownBounds } from '../movement.js';
|
|
3
|
-
import type { DeterministicKccBody3D, DeterministicKccWorld3D } from '../movement3d.js';
|
|
3
|
+
import type { DeterministicKccBehaviorRevision, DeterministicKccBody3D, DeterministicKccChecksumMode, DeterministicKccCollisionFilter3D, DeterministicKccExternalImpulse3D, DeterministicKccJumpTuning3D, DeterministicKccWorld3D, FrameGravity, PhysicsBodyId3D, PhysicsWorld3D } from '../movement3d.js';
|
|
4
4
|
import type { SyncplayModuleDefinition, SyncplayModuleStepContext, SyncplayModuleStepResult } from './component-model.js';
|
|
5
5
|
import { type SyncplayCharacterClip } from './module-contract.js';
|
|
6
6
|
export declare const character3DModuleApiStability: "stable";
|
|
@@ -23,8 +23,12 @@ export interface Character3DMovementConfig {
|
|
|
23
23
|
readonly dashSpeed: number;
|
|
24
24
|
readonly dashCooldownFrames: number;
|
|
25
25
|
readonly wallRunFrames: number;
|
|
26
|
+
readonly behaviorRevision?: DeterministicKccBehaviorRevision;
|
|
26
27
|
}
|
|
27
28
|
export declare const CHARACTER_3D_DEFAULT_CONFIG: Readonly<Character3DMovementConfig>;
|
|
29
|
+
/** Canonical recipe that binds KCC behavior revision 2. The default config stays revision 1. */
|
|
30
|
+
export declare const CHARACTER_3D_PHYSICS_RECIPE: Readonly<Character3DMovementConfig>;
|
|
31
|
+
export declare function character3DDeterministicVersion(config?: Readonly<Character3DMovementConfig>): string;
|
|
28
32
|
export interface Character3DActiveMovement {
|
|
29
33
|
readonly phase: Character3DMovementPhase;
|
|
30
34
|
readonly framesRemaining: number;
|
|
@@ -87,6 +91,17 @@ export interface Character3DContext extends SyncplayModuleStepContext {
|
|
|
87
91
|
readonly topDownBounds: DeterministicTopDownBounds;
|
|
88
92
|
readonly environment: Readonly<Character3DEnvironment>;
|
|
89
93
|
readonly config: Readonly<Character3DMovementConfig>;
|
|
94
|
+
readonly physics?: PhysicsWorld3D;
|
|
95
|
+
readonly behaviorRevision?: DeterministicKccBehaviorRevision;
|
|
96
|
+
readonly checksumMode?: DeterministicKccChecksumMode;
|
|
97
|
+
readonly gravityPerFrame?: FrameGravity;
|
|
98
|
+
readonly ignoredPhysicsBodyIds?: readonly PhysicsBodyId3D[];
|
|
99
|
+
readonly collisionFilters?: readonly DeterministicKccCollisionFilter3D[];
|
|
100
|
+
readonly externalImpulses?: readonly DeterministicKccExternalImpulse3D[];
|
|
101
|
+
readonly maxPushImpulse?: number;
|
|
102
|
+
readonly standOnDynamicBodies?: boolean;
|
|
103
|
+
readonly groundOnStaticBodies?: boolean;
|
|
104
|
+
readonly jump?: DeterministicKccJumpTuning3D;
|
|
90
105
|
}
|
|
91
106
|
export interface Character3DAnimationGraphParameters {
|
|
92
107
|
readonly speed: number;
|
|
@@ -14,6 +14,15 @@ export const CHARACTER_3D_DEFAULT_CONFIG = Object.freeze({
|
|
|
14
14
|
dashCooldownFrames: 30,
|
|
15
15
|
wallRunFrames: 20,
|
|
16
16
|
});
|
|
17
|
+
/** Canonical recipe that binds KCC behavior revision 2. The default config stays revision 1. */
|
|
18
|
+
export const CHARACTER_3D_PHYSICS_RECIPE = Object.freeze({
|
|
19
|
+
...CHARACTER_3D_DEFAULT_CONFIG,
|
|
20
|
+
behaviorRevision: 2,
|
|
21
|
+
});
|
|
22
|
+
export function character3DDeterministicVersion(config) {
|
|
23
|
+
const revision = config?.behaviorRevision ?? 1;
|
|
24
|
+
return `character.3d@${revision}`;
|
|
25
|
+
}
|
|
17
26
|
export function createCharacter3DSlice(initial = {}) {
|
|
18
27
|
if (initial === null || typeof initial !== 'object') {
|
|
19
28
|
throw new Error('SYNCPLAY_CHARACTER_3D_SLICE_INVALID');
|
|
@@ -165,6 +174,22 @@ function resolveMovementPhase(slice, input, context) {
|
|
|
165
174
|
}
|
|
166
175
|
return 'none';
|
|
167
176
|
}
|
|
177
|
+
function extractKccStepOptions(context) {
|
|
178
|
+
return {
|
|
179
|
+
frame: context.frame,
|
|
180
|
+
physics: context.physics,
|
|
181
|
+
behaviorRevision: context.config.behaviorRevision ?? context.behaviorRevision ?? 1,
|
|
182
|
+
checksumMode: context.checksumMode,
|
|
183
|
+
gravityPerFrame: context.gravityPerFrame,
|
|
184
|
+
ignoredPhysicsBodyIds: context.ignoredPhysicsBodyIds,
|
|
185
|
+
collisionFilters: context.collisionFilters,
|
|
186
|
+
externalImpulses: context.externalImpulses,
|
|
187
|
+
maxPushImpulse: context.maxPushImpulse,
|
|
188
|
+
standOnDynamicBodies: context.standOnDynamicBodies,
|
|
189
|
+
groundOnStaticBodies: context.groundOnStaticBodies,
|
|
190
|
+
jump: context.jump,
|
|
191
|
+
};
|
|
192
|
+
}
|
|
168
193
|
function stepResolvedMovement(slice, body, input, context, phase, startingPhase) {
|
|
169
194
|
if (phase === 'mantle') {
|
|
170
195
|
return stepMantle(slice, body, context, startingPhase);
|
|
@@ -187,8 +212,9 @@ function stepResolvedMovement(slice, body, input, context, phase, startingPhase)
|
|
|
187
212
|
});
|
|
188
213
|
}
|
|
189
214
|
const wallRunning = phase === 'wall-run';
|
|
215
|
+
const gravityAdjustment = -(context.gravityPerFrame ?? -1);
|
|
190
216
|
const preparedBody = wallRunning
|
|
191
|
-
? withRequiredGeometry({ ...body, vy: body.vy +
|
|
217
|
+
? withRequiredGeometry({ ...body, vy: body.vy + gravityAdjustment })
|
|
192
218
|
: body;
|
|
193
219
|
if (slice.controller === 'top-down') {
|
|
194
220
|
return Object.freeze({
|
|
@@ -201,7 +227,7 @@ function stepResolvedMovement(slice, body, input, context, phase, startingPhase)
|
|
|
201
227
|
moveX: input.moveX,
|
|
202
228
|
moveZ: input.moveZ,
|
|
203
229
|
jumpPressed: input.jumpPressed,
|
|
204
|
-
}, context.world,
|
|
230
|
+
}, context.world, extractKccStepOptions(context));
|
|
205
231
|
return Object.freeze({
|
|
206
232
|
body: withRequiredGeometry({
|
|
207
233
|
...result.body,
|
|
@@ -247,7 +273,7 @@ function stepLockedMovementBody(controller, body, direction, speed, context) {
|
|
|
247
273
|
const result = stepDeterministicKcc3D({ ...body, vx: 0, vz: 0 }, {
|
|
248
274
|
moveX: direction.directionX * speed,
|
|
249
275
|
moveZ: direction.directionZ * speed,
|
|
250
|
-
}, context.world,
|
|
276
|
+
}, context.world, extractKccStepOptions(context));
|
|
251
277
|
return Object.freeze({
|
|
252
278
|
body: withRequiredGeometry({
|
|
253
279
|
...result.body,
|
|
@@ -557,7 +583,8 @@ function assertConfig(config) {
|
|
|
557
583
|
|| !positiveSafeInteger(config.dashFrames)
|
|
558
584
|
|| !positiveFinite(config.dashSpeed)
|
|
559
585
|
|| !positiveSafeInteger(config.dashCooldownFrames)
|
|
560
|
-
|| !positiveSafeInteger(config.wallRunFrames)
|
|
586
|
+
|| !positiveSafeInteger(config.wallRunFrames)
|
|
587
|
+
|| (config.behaviorRevision !== undefined && config.behaviorRevision !== 1 && config.behaviorRevision !== 2)) {
|
|
561
588
|
throw new Error('SYNCPLAY_CHARACTER_3D_CONFIG_INVALID');
|
|
562
589
|
}
|
|
563
590
|
}
|
|
@@ -712,7 +739,17 @@ function validBody(body) {
|
|
|
712
739
|
&& nonNegativeSafeInteger(body.coyoteFrames)
|
|
713
740
|
&& nonNegativeSafeInteger(body.jumpBufferFrames)
|
|
714
741
|
&& (body.platformId === undefined
|
|
715
|
-
|| validIdentity(body.platformId))
|
|
742
|
+
|| validIdentity(body.platformId))
|
|
743
|
+
&& validSupport(body.support));
|
|
744
|
+
}
|
|
745
|
+
function validSupport(support) {
|
|
746
|
+
if (support === undefined || support.kind === 'none')
|
|
747
|
+
return true;
|
|
748
|
+
if (support.kind === 'analytic')
|
|
749
|
+
return validIdentity(support.id);
|
|
750
|
+
if (support.kind === 'physics')
|
|
751
|
+
return typeof support.bodyId === 'bigint';
|
|
752
|
+
return false;
|
|
716
753
|
}
|
|
717
754
|
function validActiveMovement(active) {
|
|
718
755
|
return (active !== null
|
package/dist/modules/combat.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defaultChecksum } from '../canonical.js';
|
|
2
2
|
import { stableSortedKeys } from '../collections.js';
|
|
3
3
|
import { validateDeterministicAuthoritativeLagCompensatedShot3D } from '../lag-compensation3d.js';
|
|
4
|
+
import { meters } from '../physics/units.js';
|
|
4
5
|
import { createSyncplayModuleEventRecord } from './module-event.js';
|
|
5
6
|
export const COMBAT_RESISTANCE_SCALE = 1_000;
|
|
6
7
|
export const combatModuleApiStability = 'stable';
|
|
@@ -321,14 +322,14 @@ export function stepProjectileCombat(slice, input, context) {
|
|
|
321
322
|
let hits;
|
|
322
323
|
try {
|
|
323
324
|
hits = context.physicsWorld.shapeCast({
|
|
324
|
-
shape: { type: 'sphere', radius },
|
|
325
|
-
x: position.x,
|
|
326
|
-
y: position.y,
|
|
327
|
-
z: position.z,
|
|
325
|
+
shape: { type: 'sphere', radius: meters(radius) },
|
|
326
|
+
x: meters(position.x),
|
|
327
|
+
y: meters(position.y),
|
|
328
|
+
z: meters(position.z),
|
|
328
329
|
dx: velocity.vx,
|
|
329
330
|
dy: velocity.vy,
|
|
330
331
|
dz: velocity.vz,
|
|
331
|
-
maxDistance: velocity.distance,
|
|
332
|
+
maxDistance: meters(velocity.distance),
|
|
332
333
|
hitTriggers: false,
|
|
333
334
|
hitSensors: false,
|
|
334
335
|
});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { DeterministicKccBody3D, DeterministicKccInput3D, DeterministicKccWorld3D, DeterministicKccStepResult3D, DeterministicKccStepOptions3D } from './movement3d.js';
|
|
2
|
+
export declare function stepDeterministicKccRevision1_3D(body: DeterministicKccBody3D, input: DeterministicKccInput3D, world: DeterministicKccWorld3D, options: DeterministicKccStepOptions3D, gravityPerFrame: number, checksumMode: 'required' | 'disabled'): DeterministicKccStepResult3D;
|