@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
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
#include "extended_abi_vehicles.hpp"
|
|
2
|
+
|
|
3
|
+
#include "tracks.hpp"
|
|
4
|
+
#include "platformer_2d.hpp"
|
|
5
|
+
|
|
6
|
+
#include <algorithm>
|
|
7
|
+
#include <array>
|
|
8
|
+
#include <cmath>
|
|
9
|
+
#include <cstdint>
|
|
10
|
+
#include <span>
|
|
11
|
+
|
|
12
|
+
namespace {
|
|
13
|
+
|
|
14
|
+
using namespace rundot::kinetix::physics::tracks;
|
|
15
|
+
using namespace rundot::kinetix::physics::platformer2d;
|
|
16
|
+
|
|
17
|
+
constexpr std::uint32_t kVehiclesAbiVersion = 1;
|
|
18
|
+
|
|
19
|
+
} // namespace
|
|
20
|
+
|
|
21
|
+
extern "C" {
|
|
22
|
+
|
|
23
|
+
// ---------------------------------------------------------------------------
|
|
24
|
+
// Module ABI Version
|
|
25
|
+
// ---------------------------------------------------------------------------
|
|
26
|
+
std::uint32_t rundot_kinetix_ext_vehicles_abi_version() {
|
|
27
|
+
return kVehiclesAbiVersion;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// ---------------------------------------------------------------------------
|
|
31
|
+
// Continuous Tracks & Differential Skid Steering (V05)
|
|
32
|
+
// ---------------------------------------------------------------------------
|
|
33
|
+
std::uint32_t rundot_kinetix_ext_tracks_abi_version() {
|
|
34
|
+
return kTracksAbiVersion;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
std::uint32_t rundot_kinetix_ext_tracks_wheel_stride() {
|
|
38
|
+
return kTrackWheelStride;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
std::uint32_t rundot_kinetix_ext_tracks_track_config_stride() {
|
|
42
|
+
return kTrackConfigStride;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
std::uint32_t rundot_kinetix_ext_tracks_vehicle_config_stride() {
|
|
46
|
+
return kTrackedVehicleConfigStride;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
std::uint32_t rundot_kinetix_ext_tracks_input_stride() {
|
|
50
|
+
return kTrackedVehicleInputStride;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
std::uint32_t rundot_kinetix_ext_tracks_state_stride() {
|
|
54
|
+
return kTrackedVehicleStateStride;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
std::uint32_t rundot_kinetix_ext_tracks_output_stride() {
|
|
58
|
+
return kTrackedVehicleOutputStride;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
std::uint32_t rundot_kinetix_ext_tracks_max_wheels_per_track() {
|
|
62
|
+
return kMaxRoadWheelsPerTrack;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
std::uint32_t rundot_kinetix_ext_tracks_max_tracks() {
|
|
66
|
+
return kMaxTracks;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
std::uint32_t rundot_kinetix_ext_tracks_stride() {
|
|
70
|
+
return kTrackedVehicleConfigStride;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
std::uint32_t rundot_kinetix_ext_tracks_size() {
|
|
74
|
+
return kTrackedVehicleConfigStride;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
std::int32_t rundot_kinetix_ext_tracks_step_vehicle(
|
|
78
|
+
const double* configData,
|
|
79
|
+
const double* stateData,
|
|
80
|
+
const double* inputData,
|
|
81
|
+
double groundElevation,
|
|
82
|
+
double dt,
|
|
83
|
+
double* outputData,
|
|
84
|
+
double* nextStateData) {
|
|
85
|
+
return rundot_kinetix_tracks_step_vehicle(
|
|
86
|
+
configData, stateData, inputData, groundElevation, dt, outputData, nextStateData);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
std::int32_t rundot_kinetix_ext_tracks_step(
|
|
90
|
+
const double* configData,
|
|
91
|
+
const double* stateData,
|
|
92
|
+
const double* inputData,
|
|
93
|
+
double groundElevation,
|
|
94
|
+
double dt,
|
|
95
|
+
double* outputData,
|
|
96
|
+
double* nextStateData) {
|
|
97
|
+
return rundot_kinetix_tracks_step_vehicle(
|
|
98
|
+
configData, stateData, inputData, groundElevation, dt, outputData, nextStateData);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
std::int32_t rundot_kinetix_ext_tracks_evaluate_friction(
|
|
102
|
+
double trackSpeed,
|
|
103
|
+
double contactVx,
|
|
104
|
+
double contactVz,
|
|
105
|
+
double normalForce,
|
|
106
|
+
double muLon,
|
|
107
|
+
double muLat,
|
|
108
|
+
double contactXOffset,
|
|
109
|
+
double* outForces) {
|
|
110
|
+
return rundot_kinetix_tracks_evaluate_friction(
|
|
111
|
+
trackSpeed, contactVx, contactVz, normalForce, muLon, muLat, contactXOffset, outForces);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
std::int32_t rundot_kinetix_ext_tracks_differential_steering(
|
|
115
|
+
double forwardInput,
|
|
116
|
+
double leftRatio,
|
|
117
|
+
double rightRatio,
|
|
118
|
+
double trackGauge,
|
|
119
|
+
double maxSpeed,
|
|
120
|
+
double currentForwardSpeed,
|
|
121
|
+
double* outSpeedsAndTorque) {
|
|
122
|
+
return rundot_kinetix_tracks_differential_steering(
|
|
123
|
+
forwardInput, leftRatio, rightRatio, trackGauge, maxSpeed, currentForwardSpeed, outSpeedsAndTorque);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// ---------------------------------------------------------------------------
|
|
127
|
+
// Motorcycle Balance, Lean Control & Countersteering (V05)
|
|
128
|
+
// ---------------------------------------------------------------------------
|
|
129
|
+
std::uint32_t rundot_kinetix_ext_motorcycle_abi_version() {
|
|
130
|
+
return kTracksAbiVersion;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
std::uint32_t rundot_kinetix_ext_motorcycle_config_stride() {
|
|
134
|
+
return kMotorcycleConfigStride;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
std::uint32_t rundot_kinetix_ext_motorcycle_input_stride() {
|
|
138
|
+
return kMotorcycleInputStride;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
std::uint32_t rundot_kinetix_ext_motorcycle_state_stride() {
|
|
142
|
+
return kMotorcycleStateStride;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
std::uint32_t rundot_kinetix_ext_motorcycle_output_stride() {
|
|
146
|
+
return kMotorcycleOutputStride;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
std::uint32_t rundot_kinetix_ext_motorcycle_stride() {
|
|
150
|
+
return kMotorcycleConfigStride;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
std::uint32_t rundot_kinetix_ext_motorcycle_size() {
|
|
154
|
+
return kMotorcycleConfigStride;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
std::int32_t rundot_kinetix_ext_motorcycle_step(
|
|
158
|
+
const double* configData,
|
|
159
|
+
const double* stateData,
|
|
160
|
+
const double* inputData,
|
|
161
|
+
double groundElevation,
|
|
162
|
+
double dt,
|
|
163
|
+
double* outputData,
|
|
164
|
+
double* nextStateData) {
|
|
165
|
+
return rundot_kinetix_motorcycle_step(
|
|
166
|
+
configData, stateData, inputData, groundElevation, dt, outputData, nextStateData);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
std::int32_t rundot_kinetix_ext_motorcycle_lean_stability(
|
|
170
|
+
const double* configData,
|
|
171
|
+
double currentLean,
|
|
172
|
+
double currentLeanRate,
|
|
173
|
+
double targetLean,
|
|
174
|
+
double leanIntegral,
|
|
175
|
+
double dt,
|
|
176
|
+
double* outTorque,
|
|
177
|
+
double* outNewIntegral) {
|
|
178
|
+
return rundot_kinetix_motorcycle_lean_stability(
|
|
179
|
+
configData, currentLean, currentLeanRate, targetLean, leanIntegral, dt, outTorque, outNewIntegral);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
std::int32_t rundot_kinetix_ext_motorcycle_countersteer(
|
|
183
|
+
double forwardSpeed,
|
|
184
|
+
double steerCommand,
|
|
185
|
+
double currentSteerAngle,
|
|
186
|
+
double currentLean,
|
|
187
|
+
double targetLean,
|
|
188
|
+
double wheelbase,
|
|
189
|
+
double rakeAngle,
|
|
190
|
+
double counterSteerFactor,
|
|
191
|
+
double maxSteerTorque,
|
|
192
|
+
double* outCounterSteerTorque,
|
|
193
|
+
double* outTargetSteerAngle) {
|
|
194
|
+
return rundot_kinetix_motorcycle_countersteer(
|
|
195
|
+
forwardSpeed, steerCommand, currentSteerAngle, currentLean, targetLean,
|
|
196
|
+
wheelbase, rakeAngle, counterSteerFactor, maxSteerTorque,
|
|
197
|
+
outCounterSteerTorque, outTargetSteerAngle);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// ---------------------------------------------------------------------------
|
|
201
|
+
// 2D Platformer Movement Controller & Legacy Migration (D20)
|
|
202
|
+
// ---------------------------------------------------------------------------
|
|
203
|
+
__attribute__((weak)) std::uint32_t rundot_kinetix_ext_platformer2d_abi_version() {
|
|
204
|
+
return kPlatformer2DAbiVersion;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
__attribute__((weak)) std::uint32_t rundot_kinetix_ext_platformer2d_state_stride() {
|
|
208
|
+
return kPlatformer2DStateStride;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
__attribute__((weak)) std::uint32_t rundot_kinetix_ext_platformer2d_input_stride() {
|
|
212
|
+
return kPlatformer2DInputStride;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
__attribute__((weak)) std::uint32_t rundot_kinetix_ext_platformer2d_config_stride() {
|
|
216
|
+
return kPlatformer2DConfigStride;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
__attribute__((weak)) std::uint32_t rundot_kinetix_ext_platformer2d_body_stride() {
|
|
220
|
+
return kPlatformer2DBodyStride;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
__attribute__((weak)) std::uint32_t rundot_kinetix_ext_platformer2d_event_stride() {
|
|
224
|
+
return kPlatformer2DEventStride;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
__attribute__((weak)) std::uint32_t rundot_kinetix_ext_platformer2d_max_events() {
|
|
228
|
+
return kPlatformer2DMaxEvents;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
__attribute__((weak)) std::uint32_t rundot_kinetix_ext_platformer2d_max_bodies() {
|
|
232
|
+
return kPlatformer2DMaxBodies;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
std::uint32_t rundot_kinetix_ext_platformer2d_max_slide_iterations() {
|
|
236
|
+
return kPlatformer2DMaxSlideIterations;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
std::uint32_t rundot_kinetix_ext_platformer2d_stride() {
|
|
240
|
+
return kPlatformer2DConfigStride;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
std::uint32_t rundot_kinetix_ext_platformer2d_size() {
|
|
244
|
+
return kPlatformer2DConfigStride;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
__attribute__((weak)) std::int32_t rundot_kinetix_ext_platformer2d_step(
|
|
248
|
+
double* stateData,
|
|
249
|
+
const double* inputData,
|
|
250
|
+
const double* configData,
|
|
251
|
+
const double* bodyData,
|
|
252
|
+
std::uint32_t bodyCount,
|
|
253
|
+
double* outEventsData,
|
|
254
|
+
std::uint32_t maxEvents,
|
|
255
|
+
std::uint32_t* outEventCount) {
|
|
256
|
+
if (stateData == nullptr || inputData == nullptr || configData == nullptr) {
|
|
257
|
+
return static_cast<std::int32_t>(Platformer2DStatus::InvalidInput);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
Platformer2DState state{};
|
|
261
|
+
unpackPlatformer2DState(stateData, state);
|
|
262
|
+
|
|
263
|
+
Platformer2DInput input{};
|
|
264
|
+
unpackPlatformer2DInput(inputData, input);
|
|
265
|
+
|
|
266
|
+
Platformer2DConfig config{};
|
|
267
|
+
unpackPlatformer2DConfig(configData, config);
|
|
268
|
+
|
|
269
|
+
std::array<PlatformerBody2D, kPlatformer2DMaxBodies> bodies{};
|
|
270
|
+
const std::uint32_t count = std::min(bodyCount, kPlatformer2DMaxBodies);
|
|
271
|
+
for (std::uint32_t i = 0; i < count; ++i) {
|
|
272
|
+
unpackPlatformer2DBody(bodyData + i * kPlatformer2DBodyStride, bodies[i]);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
std::array<Platformer2DEventRecord, kPlatformer2DMaxEvents> events{};
|
|
276
|
+
const std::uint32_t eventCap = std::min(maxEvents, kPlatformer2DMaxEvents);
|
|
277
|
+
std::uint32_t producedEvents = 0;
|
|
278
|
+
|
|
279
|
+
const Platformer2DStatus status = stepPlatformer2D(
|
|
280
|
+
state, input, config, bodies.data(), count, events.data(), eventCap, &producedEvents);
|
|
281
|
+
|
|
282
|
+
if (status != Platformer2DStatus::Success) {
|
|
283
|
+
return static_cast<std::int32_t>(status);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
packPlatformer2DState(state, stateData);
|
|
287
|
+
|
|
288
|
+
if (outEventsData != nullptr && producedEvents > 0) {
|
|
289
|
+
for (std::uint32_t i = 0; i < producedEvents; ++i) {
|
|
290
|
+
packPlatformer2DEvent(events[i], outEventsData + i * kPlatformer2DEventStride);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
if (outEventCount != nullptr) {
|
|
295
|
+
*outEventCount = producedEvents;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
return 0;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
__attribute__((weak)) std::int32_t rundot_kinetix_ext_platformer2d_step_legacy(
|
|
302
|
+
double* stateData,
|
|
303
|
+
const double* inputData,
|
|
304
|
+
const double* configData,
|
|
305
|
+
double worldMinX, double worldMaxX,
|
|
306
|
+
double worldMinY, double worldMaxY,
|
|
307
|
+
const double* walls, std::uint32_t wallCount,
|
|
308
|
+
const double* slopesData, std::uint32_t slopeCount,
|
|
309
|
+
const double* stepsData, std::uint32_t stepCount,
|
|
310
|
+
const double* movingPlatformsData, std::uint32_t movingPlatformCount,
|
|
311
|
+
const double* oneWayPlatformsData, std::uint32_t oneWayPlatformCount,
|
|
312
|
+
double* outEventsData,
|
|
313
|
+
std::uint32_t maxEvents,
|
|
314
|
+
std::uint32_t* outEventCount) {
|
|
315
|
+
if (stateData == nullptr || inputData == nullptr || configData == nullptr) {
|
|
316
|
+
return static_cast<std::int32_t>(Platformer2DStatus::InvalidInput);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
std::array<LegacySlope2D, 32> slopes{};
|
|
320
|
+
const std::uint32_t nSlopes = std::min(slopeCount, 32u);
|
|
321
|
+
for (std::uint32_t i = 0; i < nSlopes; ++i) {
|
|
322
|
+
slopes[i] = LegacySlope2D{
|
|
323
|
+
.id = static_cast<std::int32_t>(slopesData[i * 5 + 0]),
|
|
324
|
+
.minX = slopesData[i * 5 + 1],
|
|
325
|
+
.maxX = slopesData[i * 5 + 2],
|
|
326
|
+
.baseY = slopesData[i * 5 + 3],
|
|
327
|
+
.risePerUnit = slopesData[i * 5 + 4],
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
std::array<LegacyStep2D, 32> steps{};
|
|
332
|
+
const std::uint32_t nSteps = std::min(stepCount, 32u);
|
|
333
|
+
for (std::uint32_t i = 0; i < nSteps; ++i) {
|
|
334
|
+
steps[i] = LegacyStep2D{
|
|
335
|
+
.id = static_cast<std::int32_t>(stepsData[i * 3 + 0]),
|
|
336
|
+
.x = stepsData[i * 3 + 1],
|
|
337
|
+
.height = stepsData[i * 3 + 2],
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
std::array<LegacyMovingPlatform2D, 32> movingPlats{};
|
|
342
|
+
const std::uint32_t nMoving = std::min(movingPlatformCount, 32u);
|
|
343
|
+
for (std::uint32_t i = 0; i < nMoving; ++i) {
|
|
344
|
+
movingPlats[i] = LegacyMovingPlatform2D{
|
|
345
|
+
.id = static_cast<std::int32_t>(movingPlatformsData[i * 5 + 0]),
|
|
346
|
+
.minX = movingPlatformsData[i * 5 + 1],
|
|
347
|
+
.maxX = movingPlatformsData[i * 5 + 2],
|
|
348
|
+
.y = movingPlatformsData[i * 5 + 3],
|
|
349
|
+
.dxPerFrame = movingPlatformsData[i * 5 + 4],
|
|
350
|
+
.dyPerFrame = 0.0,
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
std::array<LegacyOneWayPlatform2D, 32> oneWays{};
|
|
355
|
+
const std::uint32_t nOneWay = std::min(oneWayPlatformCount, 32u);
|
|
356
|
+
for (std::uint32_t i = 0; i < nOneWay; ++i) {
|
|
357
|
+
oneWays[i] = LegacyOneWayPlatform2D{
|
|
358
|
+
.id = static_cast<std::int32_t>(oneWayPlatformsData[i * 4 + 0]),
|
|
359
|
+
.minX = oneWayPlatformsData[i * 4 + 1],
|
|
360
|
+
.maxX = oneWayPlatformsData[i * 4 + 2],
|
|
361
|
+
.y = oneWayPlatformsData[i * 4 + 3],
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
LegacyMovementWorld2D legacyWorld{
|
|
366
|
+
.minX = worldMinX,
|
|
367
|
+
.maxX = worldMaxX,
|
|
368
|
+
.minY = worldMinY,
|
|
369
|
+
.maxY = worldMaxY,
|
|
370
|
+
.walls = walls,
|
|
371
|
+
.wallCount = wallCount,
|
|
372
|
+
.slopes = slopes.data(),
|
|
373
|
+
.slopeCount = nSlopes,
|
|
374
|
+
.steps = steps.data(),
|
|
375
|
+
.stepCount = nSteps,
|
|
376
|
+
.movingPlatforms = movingPlats.data(),
|
|
377
|
+
.movingPlatformCount = nMoving,
|
|
378
|
+
.oneWayPlatforms = oneWays.data(),
|
|
379
|
+
.oneWayPlatformCount = nOneWay,
|
|
380
|
+
};
|
|
381
|
+
|
|
382
|
+
std::array<PlatformerBody2D, kPlatformer2DMaxBodies> bodies{};
|
|
383
|
+
const std::uint32_t bodyCount = convertLegacyWorldToBodies(legacyWorld, bodies.data(), kPlatformer2DMaxBodies);
|
|
384
|
+
|
|
385
|
+
std::array<double, kPlatformer2DMaxBodies * kPlatformer2DBodyStride> packedBodies{};
|
|
386
|
+
for (std::uint32_t i = 0; i < bodyCount; ++i) {
|
|
387
|
+
const auto& b = bodies[i];
|
|
388
|
+
double* d = packedBodies.data() + i * kPlatformer2DBodyStride;
|
|
389
|
+
d[0] = static_cast<double>(b.id);
|
|
390
|
+
d[1] = static_cast<double>(static_cast<std::uint32_t>(b.kind));
|
|
391
|
+
d[2] = static_cast<double>(static_cast<std::uint32_t>(b.shape));
|
|
392
|
+
d[3] = b.x;
|
|
393
|
+
d[4] = b.y;
|
|
394
|
+
d[5] = b.angle;
|
|
395
|
+
d[6] = b.vx;
|
|
396
|
+
d[7] = b.vy;
|
|
397
|
+
d[8] = b.halfX;
|
|
398
|
+
d[9] = b.halfY;
|
|
399
|
+
d[10] = b.friction;
|
|
400
|
+
d[11] = b.restitution;
|
|
401
|
+
d[12] = static_cast<double>(b.layer);
|
|
402
|
+
d[13] = static_cast<double>(b.mask);
|
|
403
|
+
d[14] = b.slopeRisePerUnit;
|
|
404
|
+
d[15] = 0.0;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
return rundot_kinetix_ext_platformer2d_step(
|
|
408
|
+
stateData, inputData, configData, packedBodies.data(), bodyCount, outEventsData, maxEvents, outEventCount);
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
} // extern "C"
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <cstdint>
|
|
4
|
+
|
|
5
|
+
extern "C" {
|
|
6
|
+
|
|
7
|
+
// ---------------------------------------------------------------------------
|
|
8
|
+
// Module ABI Version
|
|
9
|
+
// ---------------------------------------------------------------------------
|
|
10
|
+
std::uint32_t rundot_kinetix_ext_vehicles_abi_version();
|
|
11
|
+
|
|
12
|
+
// ---------------------------------------------------------------------------
|
|
13
|
+
// Continuous Tracks & Differential Skid Steering (V05)
|
|
14
|
+
// ---------------------------------------------------------------------------
|
|
15
|
+
std::uint32_t rundot_kinetix_ext_tracks_abi_version();
|
|
16
|
+
std::uint32_t rundot_kinetix_ext_tracks_wheel_stride();
|
|
17
|
+
std::uint32_t rundot_kinetix_ext_tracks_track_config_stride();
|
|
18
|
+
std::uint32_t rundot_kinetix_ext_tracks_vehicle_config_stride();
|
|
19
|
+
std::uint32_t rundot_kinetix_ext_tracks_input_stride();
|
|
20
|
+
std::uint32_t rundot_kinetix_ext_tracks_state_stride();
|
|
21
|
+
std::uint32_t rundot_kinetix_ext_tracks_output_stride();
|
|
22
|
+
std::uint32_t rundot_kinetix_ext_tracks_max_wheels_per_track();
|
|
23
|
+
std::uint32_t rundot_kinetix_ext_tracks_max_tracks();
|
|
24
|
+
std::uint32_t rundot_kinetix_ext_tracks_stride();
|
|
25
|
+
std::uint32_t rundot_kinetix_ext_tracks_size();
|
|
26
|
+
|
|
27
|
+
std::int32_t rundot_kinetix_ext_tracks_step_vehicle(
|
|
28
|
+
const double* configData,
|
|
29
|
+
const double* stateData,
|
|
30
|
+
const double* inputData,
|
|
31
|
+
double groundElevation,
|
|
32
|
+
double dt,
|
|
33
|
+
double* outputData,
|
|
34
|
+
double* nextStateData);
|
|
35
|
+
|
|
36
|
+
std::int32_t rundot_kinetix_ext_tracks_step(
|
|
37
|
+
const double* configData,
|
|
38
|
+
const double* stateData,
|
|
39
|
+
const double* inputData,
|
|
40
|
+
double groundElevation,
|
|
41
|
+
double dt,
|
|
42
|
+
double* outputData,
|
|
43
|
+
double* nextStateData);
|
|
44
|
+
|
|
45
|
+
std::int32_t rundot_kinetix_ext_tracks_evaluate_friction(
|
|
46
|
+
double trackSpeed,
|
|
47
|
+
double contactVx,
|
|
48
|
+
double contactVz,
|
|
49
|
+
double normalForce,
|
|
50
|
+
double muLon,
|
|
51
|
+
double muLat,
|
|
52
|
+
double contactXOffset,
|
|
53
|
+
double* outForces);
|
|
54
|
+
|
|
55
|
+
std::int32_t rundot_kinetix_ext_tracks_differential_steering(
|
|
56
|
+
double forwardInput,
|
|
57
|
+
double leftRatio,
|
|
58
|
+
double rightRatio,
|
|
59
|
+
double trackGauge,
|
|
60
|
+
double maxSpeed,
|
|
61
|
+
double currentForwardSpeed,
|
|
62
|
+
double* outSpeedsAndTorque);
|
|
63
|
+
|
|
64
|
+
// ---------------------------------------------------------------------------
|
|
65
|
+
// Motorcycle Balance, Lean Control & Countersteering (V05)
|
|
66
|
+
// ---------------------------------------------------------------------------
|
|
67
|
+
std::uint32_t rundot_kinetix_ext_motorcycle_abi_version();
|
|
68
|
+
std::uint32_t rundot_kinetix_ext_motorcycle_config_stride();
|
|
69
|
+
std::uint32_t rundot_kinetix_ext_motorcycle_input_stride();
|
|
70
|
+
std::uint32_t rundot_kinetix_ext_motorcycle_state_stride();
|
|
71
|
+
std::uint32_t rundot_kinetix_ext_motorcycle_output_stride();
|
|
72
|
+
std::uint32_t rundot_kinetix_ext_motorcycle_stride();
|
|
73
|
+
std::uint32_t rundot_kinetix_ext_motorcycle_size();
|
|
74
|
+
|
|
75
|
+
std::int32_t rundot_kinetix_ext_motorcycle_step(
|
|
76
|
+
const double* configData,
|
|
77
|
+
const double* stateData,
|
|
78
|
+
const double* inputData,
|
|
79
|
+
double groundElevation,
|
|
80
|
+
double dt,
|
|
81
|
+
double* outputData,
|
|
82
|
+
double* nextStateData);
|
|
83
|
+
|
|
84
|
+
std::int32_t rundot_kinetix_ext_motorcycle_lean_stability(
|
|
85
|
+
const double* configData,
|
|
86
|
+
double currentLean,
|
|
87
|
+
double currentLeanRate,
|
|
88
|
+
double targetLean,
|
|
89
|
+
double leanIntegral,
|
|
90
|
+
double dt,
|
|
91
|
+
double* outTorque,
|
|
92
|
+
double* outNewIntegral);
|
|
93
|
+
|
|
94
|
+
std::int32_t rundot_kinetix_ext_motorcycle_countersteer(
|
|
95
|
+
double forwardSpeed,
|
|
96
|
+
double steerCommand,
|
|
97
|
+
double currentSteerAngle,
|
|
98
|
+
double currentLean,
|
|
99
|
+
double targetLean,
|
|
100
|
+
double wheelbase,
|
|
101
|
+
double rakeAngle,
|
|
102
|
+
double counterSteerFactor,
|
|
103
|
+
double maxSteerTorque,
|
|
104
|
+
double* outCounterSteerTorque,
|
|
105
|
+
double* outTargetSteerAngle);
|
|
106
|
+
|
|
107
|
+
// ---------------------------------------------------------------------------
|
|
108
|
+
// 2D Platformer Movement Controller & Legacy Migration (D20)
|
|
109
|
+
// ---------------------------------------------------------------------------
|
|
110
|
+
std::uint32_t rundot_kinetix_ext_platformer2d_abi_version();
|
|
111
|
+
std::uint32_t rundot_kinetix_ext_platformer2d_state_stride();
|
|
112
|
+
std::uint32_t rundot_kinetix_ext_platformer2d_input_stride();
|
|
113
|
+
std::uint32_t rundot_kinetix_ext_platformer2d_config_stride();
|
|
114
|
+
std::uint32_t rundot_kinetix_ext_platformer2d_body_stride();
|
|
115
|
+
std::uint32_t rundot_kinetix_ext_platformer2d_event_stride();
|
|
116
|
+
std::uint32_t rundot_kinetix_ext_platformer2d_max_events();
|
|
117
|
+
std::uint32_t rundot_kinetix_ext_platformer2d_max_bodies();
|
|
118
|
+
std::uint32_t rundot_kinetix_ext_platformer2d_max_slide_iterations();
|
|
119
|
+
std::uint32_t rundot_kinetix_ext_platformer2d_stride();
|
|
120
|
+
std::uint32_t rundot_kinetix_ext_platformer2d_size();
|
|
121
|
+
|
|
122
|
+
std::int32_t rundot_kinetix_ext_platformer2d_step(
|
|
123
|
+
double* stateData,
|
|
124
|
+
const double* inputData,
|
|
125
|
+
const double* configData,
|
|
126
|
+
const double* bodyData,
|
|
127
|
+
std::uint32_t bodyCount,
|
|
128
|
+
double* outEventsData,
|
|
129
|
+
std::uint32_t maxEvents,
|
|
130
|
+
std::uint32_t* outEventCount);
|
|
131
|
+
|
|
132
|
+
std::int32_t rundot_kinetix_ext_platformer2d_step_legacy(
|
|
133
|
+
double* stateData,
|
|
134
|
+
const double* inputData,
|
|
135
|
+
const double* configData,
|
|
136
|
+
double worldMinX, double worldMaxX,
|
|
137
|
+
double worldMinY, double worldMaxY,
|
|
138
|
+
const double* walls, std::uint32_t wallCount,
|
|
139
|
+
const double* slopesData, std::uint32_t slopeCount,
|
|
140
|
+
const double* stepsData, std::uint32_t stepCount,
|
|
141
|
+
const double* movingPlatformsData, std::uint32_t movingPlatformCount,
|
|
142
|
+
const double* oneWayPlatformsData, std::uint32_t oneWayPlatformCount,
|
|
143
|
+
double* outEventsData,
|
|
144
|
+
std::uint32_t maxEvents,
|
|
145
|
+
std::uint32_t* outEventCount);
|
|
146
|
+
|
|
147
|
+
// ---------------------------------------------------------------------------
|
|
148
|
+
// Direct Compatibility C ABI Exports (V05 ABI Requests)
|
|
149
|
+
// ---------------------------------------------------------------------------
|
|
150
|
+
std::uint32_t rundot_kinetix_tracks_abi_version();
|
|
151
|
+
std::uint32_t rundot_kinetix_tracks_wheel_stride();
|
|
152
|
+
std::uint32_t rundot_kinetix_tracks_track_config_stride();
|
|
153
|
+
std::uint32_t rundot_kinetix_tracks_vehicle_config_stride();
|
|
154
|
+
std::uint32_t rundot_kinetix_tracks_input_stride();
|
|
155
|
+
std::uint32_t rundot_kinetix_tracks_state_stride();
|
|
156
|
+
std::uint32_t rundot_kinetix_tracks_output_stride();
|
|
157
|
+
std::uint32_t rundot_kinetix_tracks_motorcycle_config_stride();
|
|
158
|
+
std::uint32_t rundot_kinetix_tracks_motorcycle_input_stride();
|
|
159
|
+
std::uint32_t rundot_kinetix_tracks_motorcycle_state_stride();
|
|
160
|
+
std::uint32_t rundot_kinetix_tracks_motorcycle_output_stride();
|
|
161
|
+
|
|
162
|
+
std::int32_t rundot_kinetix_tracks_step_vehicle(
|
|
163
|
+
const double* configData,
|
|
164
|
+
const double* stateData,
|
|
165
|
+
const double* inputData,
|
|
166
|
+
double groundElevation,
|
|
167
|
+
double dt,
|
|
168
|
+
double* outputData,
|
|
169
|
+
double* nextStateData);
|
|
170
|
+
|
|
171
|
+
std::int32_t rundot_kinetix_tracks_evaluate_friction(
|
|
172
|
+
double trackSpeed,
|
|
173
|
+
double contactVx,
|
|
174
|
+
double contactVz,
|
|
175
|
+
double normalForce,
|
|
176
|
+
double muLon,
|
|
177
|
+
double muLat,
|
|
178
|
+
double contactXOffset,
|
|
179
|
+
double* outForces);
|
|
180
|
+
|
|
181
|
+
std::int32_t rundot_kinetix_tracks_differential_steering(
|
|
182
|
+
double forwardInput,
|
|
183
|
+
double leftRatio,
|
|
184
|
+
double rightRatio,
|
|
185
|
+
double trackGauge,
|
|
186
|
+
double maxSpeed,
|
|
187
|
+
double currentForwardSpeed,
|
|
188
|
+
double* outSpeedsAndTorque);
|
|
189
|
+
|
|
190
|
+
std::int32_t rundot_kinetix_motorcycle_step(
|
|
191
|
+
const double* configData,
|
|
192
|
+
const double* stateData,
|
|
193
|
+
const double* inputData,
|
|
194
|
+
double groundElevation,
|
|
195
|
+
double dt,
|
|
196
|
+
double* outputData,
|
|
197
|
+
double* nextStateData);
|
|
198
|
+
|
|
199
|
+
std::int32_t rundot_kinetix_motorcycle_lean_stability(
|
|
200
|
+
const double* configData,
|
|
201
|
+
double currentLean,
|
|
202
|
+
double currentLeanRate,
|
|
203
|
+
double targetLean,
|
|
204
|
+
double leanIntegral,
|
|
205
|
+
double dt,
|
|
206
|
+
double* outTorque,
|
|
207
|
+
double* outNewIntegral);
|
|
208
|
+
|
|
209
|
+
std::int32_t rundot_kinetix_motorcycle_countersteer(
|
|
210
|
+
double forwardSpeed,
|
|
211
|
+
double steerCommand,
|
|
212
|
+
double currentSteerAngle,
|
|
213
|
+
double currentLean,
|
|
214
|
+
double targetLean,
|
|
215
|
+
double wheelbase,
|
|
216
|
+
double rakeAngle,
|
|
217
|
+
double counterSteerFactor,
|
|
218
|
+
double maxSteerTorque,
|
|
219
|
+
double* outCounterSteerTorque,
|
|
220
|
+
double* outTargetSteerAngle);
|
|
221
|
+
|
|
222
|
+
} // extern "C"
|