From f74b8401ad9ef50b8cdbf1f43a2b21f6c42b0ebc Mon Sep 17 00:00:00 2001 From: Sébastien Crozet Date: Sun, 2 Jan 2022 14:47:40 +0100 Subject: Implement multibody joints and the new solver --- .github/workflows/rapier-ci-build.yml | 24 +- Cargo.toml | 22 +- benchmarks2d/Cargo.toml | 6 +- benchmarks2d/balls2.rs | 6 +- benchmarks2d/boxes2.rs | 5 +- benchmarks2d/capsules2.rs | 5 +- benchmarks2d/convex_polygons2.rs | 5 +- benchmarks2d/heightfield2.rs | 5 +- benchmarks2d/joint_ball2.rs | 13 +- benchmarks2d/joint_fixed2.rs | 21 +- benchmarks2d/joint_prismatic2.rs | 15 +- benchmarks2d/pyramid2.rs | 5 +- benchmarks3d/Cargo.toml | 6 +- benchmarks3d/all_benchmarks3.rs | 8 +- benchmarks3d/balls3.rs | 5 +- benchmarks3d/boxes3.rs | 5 +- benchmarks3d/capsules3.rs | 5 +- benchmarks3d/ccd3.rs | 5 +- benchmarks3d/compound3.rs | 5 +- benchmarks3d/convex_polyhedron3.rs | 5 +- benchmarks3d/heightfield3.rs | 5 +- benchmarks3d/joint_ball3.rs | 13 +- benchmarks3d/joint_fixed3.rs | 19 +- benchmarks3d/joint_prismatic3.rs | 22 +- benchmarks3d/joint_revolute3.rs | 24 +- benchmarks3d/keva3.rs | 5 +- benchmarks3d/pyramid3.rs | 5 +- benchmarks3d/stacks3.rs | 5 +- benchmarks3d/trimesh3.rs | 5 +- build/rapier2d-f64/Cargo.toml | 67 -- build/rapier2d/Cargo.toml | 67 -- build/rapier3d-f64/Cargo.toml | 66 -- build/rapier3d/Cargo.toml | 66 -- build/rapier_testbed2d/Cargo.toml | 58 -- build/rapier_testbed3d/Cargo.toml | 60 -- crates/rapier2d-f64/Cargo.toml | 67 ++ crates/rapier2d/Cargo.toml | 67 ++ crates/rapier3d-f64/Cargo.toml | 66 ++ crates/rapier3d/Cargo.toml | 66 ++ crates/rapier_testbed2d/Cargo.toml | 56 ++ crates/rapier_testbed3d/Cargo.toml | 58 ++ examples2d/Cargo.toml | 6 +- examples2d/add_remove2.rs | 12 +- examples2d/ccd2.rs | 5 +- examples2d/collision_groups2.rs | 5 +- examples2d/convex_polygons2.rs | 5 +- examples2d/damping2.rs | 12 +- examples2d/debug_box_ball2.rs | 5 +- examples2d/heightfield2.rs | 5 +- examples2d/joints2.rs | 13 +- examples2d/locked_rotations2.rs | 5 +- examples2d/one_way_platforms2.rs | 6 +- examples2d/platform2.rs | 5 +- examples2d/polyline2.rs | 5 +- examples2d/pyramid2.rs | 5 +- examples2d/restitution2.rs | 5 +- examples2d/sensor2.rs | 5 +- examples2d/trimesh2.rs | 5 +- examples3d/Cargo.toml | 6 +- examples3d/all_examples3.rs | 11 +- examples3d/articulations3.rs | 678 +++++++++++++ examples3d/ccd3.rs | 5 +- examples3d/collision_groups3.rs | 5 +- examples3d/compound3.rs | 5 +- examples3d/convex_decomposition3.rs | 6 +- examples3d/convex_polyhedron3.rs | 5 +- examples3d/damping3.rs | 12 +- examples3d/debug_add_remove_collider3.rs | 6 +- examples3d/debug_articulations3.rs | 98 ++ examples3d/debug_big_colliders3.rs | 5 +- examples3d/debug_boxes3.rs | 9 +- examples3d/debug_cylinder3.rs | 5 +- examples3d/debug_dynamic_collider_add3.rs | 6 +- examples3d/debug_friction3.rs | 5 +- examples3d/debug_infinite_fall3.rs | 5 +- examples3d/debug_prismatic3.rs | 24 +- examples3d/debug_rollback3.rs | 6 +- examples3d/debug_shape_modification3.rs | 6 +- examples3d/debug_triangle3.rs | 5 +- examples3d/debug_trimesh3.rs | 5 +- examples3d/domino3.rs | 5 +- examples3d/fountain3.rs | 11 +- examples3d/harness_capsules3.rs | 5 +- examples3d/heightfield3.rs | 5 +- examples3d/joints3.rs | 248 ++--- examples3d/keva3.rs | 5 +- examples3d/locked_rotations3.rs | 5 +- examples3d/one_way_platforms3.rs | 6 +- examples3d/platform3.rs | 5 +- examples3d/primitives3.rs | 19 +- examples3d/rapier.data | Bin 0 -> 2017666 bytes examples3d/restitution3.rs | 5 +- examples3d/sensor3.rs | 5 +- examples3d/trimesh3.rs | 5 +- publish-testbeds.sh | 10 +- src/counters/mod.rs | 4 +- src/data/coarena.rs | 12 +- src/data/graph.rs | 52 +- src/dynamics/integration_parameters.rs | 96 +- src/dynamics/island_manager.rs | 13 +- src/dynamics/joint/ball_joint.rs | 148 --- src/dynamics/joint/fixed_joint.rs | 73 +- src/dynamics/joint/generic_joint.rs | 144 --- src/dynamics/joint/impulse_joint/impulse_joint.rs | 20 + .../joint/impulse_joint/impulse_joint_set.rs | 356 +++++++ src/dynamics/joint/impulse_joint/mod.rs | 6 + src/dynamics/joint/joint.rs | 143 --- src/dynamics/joint/joint_data.rs | 270 ++++++ src/dynamics/joint/joint_set.rs | 359 ------- src/dynamics/joint/mod.rs | 27 +- src/dynamics/joint/motor_model.rs | 61 ++ src/dynamics/joint/multibody_joint/mod.rs | 15 + src/dynamics/joint/multibody_joint/multibody.rs | 1021 ++++++++++++++++++++ .../joint/multibody_joint/multibody_joint.rs | 571 +++++++++++ .../joint/multibody_joint/multibody_joint_set.rs | 352 +++++++ .../joint/multibody_joint/multibody_link.rs | 173 ++++ .../joint/multibody_joint/multibody_workspace.rs | 27 + .../joint/multibody_joint/unit_multibody_joint.rs | 122 +++ src/dynamics/joint/prismatic_joint.rs | 289 ++---- src/dynamics/joint/revolute_joint.rs | 220 ++--- src/dynamics/joint/spherical_joint.rs | 91 ++ src/dynamics/joint/spring_model.rs | 65 -- src/dynamics/mod.rs | 15 +- src/dynamics/rigid_body_components.rs | 168 +++- src/dynamics/rigid_body_set.rs | 18 +- src/dynamics/solver/categorization.rs | 36 +- src/dynamics/solver/delta_vel.rs | 24 +- src/dynamics/solver/generic_velocity_constraint.rs | 377 ++++++++ .../solver/generic_velocity_constraint_element.rs | 348 +++++++ src/dynamics/solver/interaction_groups.rs | 13 +- src/dynamics/solver/island_solver.rs | 151 +-- .../joint_constraint/ball_position_constraint.rs | 266 ----- .../ball_position_constraint_wide.rs | 216 ----- .../joint_constraint/ball_velocity_constraint.rs | 660 ------------- .../ball_velocity_constraint_wide.rs | 359 ------- .../joint_constraint/fixed_position_constraint.rs | 151 --- .../fixed_position_constraint_wide.rs | 71 -- .../joint_constraint/fixed_velocity_constraint.rs | 436 --------- .../fixed_velocity_constraint_wide.rs | 539 ----------- .../generic_position_constraint.rs | 346 ------- .../generic_position_constraint_wide.rs | 60 -- .../generic_velocity_constraint.rs | 706 -------------- .../generic_velocity_constraint_wide.rs | 464 --------- .../solver/joint_constraint/joint_constraint.rs | 710 ++++++++------ .../joint_generic_velocity_constraint.rs | 529 ++++++++++ .../joint_generic_velocity_constraint_builder.rs | 853 ++++++++++++++++ .../joint_constraint/joint_position_constraint.rs | 280 ------ .../joint_constraint/joint_velocity_constraint.rs | 608 ++++++++++++ .../joint_velocity_constraint_builder.rs | 699 ++++++++++++++ src/dynamics/solver/joint_constraint/mod.rs | 107 +- .../prismatic_position_constraint.rs | 182 ---- .../prismatic_position_constraint_wide.rs | 71 -- .../prismatic_velocity_constraint.rs | 859 ---------------- .../prismatic_velocity_constraint_wide.rs | 848 ---------------- .../revolute_position_constraint.rs | 295 ------ .../revolute_position_constraint_wide.rs | 71 -- .../revolute_velocity_constraint.rs | 750 -------------- .../revolute_velocity_constraint_wide.rs | 527 ---------- src/dynamics/solver/mod.rs | 27 +- src/dynamics/solver/parallel_island_solver.rs | 156 +-- src/dynamics/solver/parallel_position_solver.rs | 107 -- src/dynamics/solver/parallel_solver_constraints.rs | 101 +- src/dynamics/solver/parallel_velocity_solver.rs | 111 +-- src/dynamics/solver/position_constraint.rs | 168 ---- src/dynamics/solver/position_constraint_wide.rs | 157 --- src/dynamics/solver/position_ground_constraint.rs | 121 --- .../solver/position_ground_constraint_wide.rs | 143 --- src/dynamics/solver/position_solver.rs | 57 -- src/dynamics/solver/solver_constraints.rs | 317 ++++-- src/dynamics/solver/velocity_constraint.rs | 131 +-- src/dynamics/solver/velocity_constraint_element.rs | 114 +-- src/dynamics/solver/velocity_constraint_wide.rs | 110 +-- src/dynamics/solver/velocity_ground_constraint.rs | 77 +- .../solver/velocity_ground_constraint_element.rs | 81 +- .../solver/velocity_ground_constraint_wide.rs | 93 +- src/dynamics/solver/velocity_solver.rs | 222 ++++- src/geometry/broad_phase_multi_sap/broad_phase.rs | 6 +- src/geometry/contact_pair.rs | 55 +- src/geometry/narrow_phase.rs | 6 +- src/lib.rs | 50 +- src/pipeline/physics_pipeline.rs | 160 ++- src/utils.rs | 226 +++-- src_testbed/box2d_backend.rs | 19 +- src_testbed/harness/mod.rs | 45 +- src_testbed/lib.rs | 10 - src_testbed/nphysics_backend.rs | 248 ----- src_testbed/physics/mod.rs | 25 +- src_testbed/physx_backend.rs | 383 ++++---- src_testbed/testbed.rs | 382 ++++---- src_testbed/ui.rs | 84 +- 190 files changed, 10585 insertions(+), 13359 deletions(-) delete mode 100644 build/rapier2d-f64/Cargo.toml delete mode 100644 build/rapier2d/Cargo.toml delete mode 100644 build/rapier3d-f64/Cargo.toml delete mode 100644 build/rapier3d/Cargo.toml delete mode 100644 build/rapier_testbed2d/Cargo.toml delete mode 100644 build/rapier_testbed3d/Cargo.toml create mode 100644 crates/rapier2d-f64/Cargo.toml create mode 100644 crates/rapier2d/Cargo.toml create mode 100644 crates/rapier3d-f64/Cargo.toml create mode 100644 crates/rapier3d/Cargo.toml create mode 100644 crates/rapier_testbed2d/Cargo.toml create mode 100644 crates/rapier_testbed3d/Cargo.toml create mode 100644 examples3d/articulations3.rs create mode 100644 examples3d/debug_articulations3.rs create mode 100644 examples3d/rapier.data delete mode 100644 src/dynamics/joint/ball_joint.rs delete mode 100644 src/dynamics/joint/generic_joint.rs create mode 100644 src/dynamics/joint/impulse_joint/impulse_joint.rs create mode 100644 src/dynamics/joint/impulse_joint/impulse_joint_set.rs create mode 100644 src/dynamics/joint/impulse_joint/mod.rs delete mode 100644 src/dynamics/joint/joint.rs create mode 100644 src/dynamics/joint/joint_data.rs delete mode 100644 src/dynamics/joint/joint_set.rs create mode 100644 src/dynamics/joint/motor_model.rs create mode 100644 src/dynamics/joint/multibody_joint/mod.rs create mode 100644 src/dynamics/joint/multibody_joint/multibody.rs create mode 100644 src/dynamics/joint/multibody_joint/multibody_joint.rs create mode 100644 src/dynamics/joint/multibody_joint/multibody_joint_set.rs create mode 100644 src/dynamics/joint/multibody_joint/multibody_link.rs create mode 100644 src/dynamics/joint/multibody_joint/multibody_workspace.rs create mode 100644 src/dynamics/joint/multibody_joint/unit_multibody_joint.rs create mode 100644 src/dynamics/joint/spherical_joint.rs delete mode 100644 src/dynamics/joint/spring_model.rs create mode 100644 src/dynamics/solver/generic_velocity_constraint.rs create mode 100644 src/dynamics/solver/generic_velocity_constraint_element.rs delete mode 100644 src/dynamics/solver/joint_constraint/ball_position_constraint.rs delete mode 100644 src/dynamics/solver/joint_constraint/ball_position_constraint_wide.rs delete mode 100644 src/dynamics/solver/joint_constraint/ball_velocity_constraint.rs delete mode 100644 src/dynamics/solver/joint_constraint/ball_velocity_constraint_wide.rs delete mode 100644 src/dynamics/solver/joint_constraint/fixed_position_constraint.rs delete mode 100644 src/dynamics/solver/joint_constraint/fixed_position_constraint_wide.rs delete mode 100644 src/dynamics/solver/joint_constraint/fixed_velocity_constraint.rs delete mode 100644 src/dynamics/solver/joint_constraint/fixed_velocity_constraint_wide.rs delete mode 100644 src/dynamics/solver/joint_constraint/generic_position_constraint.rs delete mode 100644 src/dynamics/solver/joint_constraint/generic_position_constraint_wide.rs delete mode 100644 src/dynamics/solver/joint_constraint/generic_velocity_constraint.rs delete mode 100644 src/dynamics/solver/joint_constraint/generic_velocity_constraint_wide.rs create mode 100644 src/dynamics/solver/joint_constraint/joint_generic_velocity_constraint.rs create mode 100644 src/dynamics/solver/joint_constraint/joint_generic_velocity_constraint_builder.rs delete mode 100644 src/dynamics/solver/joint_constraint/joint_position_constraint.rs create mode 100644 src/dynamics/solver/joint_constraint/joint_velocity_constraint.rs create mode 100644 src/dynamics/solver/joint_constraint/joint_velocity_constraint_builder.rs delete mode 100644 src/dynamics/solver/joint_constraint/prismatic_position_constraint.rs delete mode 100644 src/dynamics/solver/joint_constraint/prismatic_position_constraint_wide.rs delete mode 100644 src/dynamics/solver/joint_constraint/prismatic_velocity_constraint.rs delete mode 100644 src/dynamics/solver/joint_constraint/prismatic_velocity_constraint_wide.rs delete mode 100644 src/dynamics/solver/joint_constraint/revolute_position_constraint.rs delete mode 100644 src/dynamics/solver/joint_constraint/revolute_position_constraint_wide.rs delete mode 100644 src/dynamics/solver/joint_constraint/revolute_velocity_constraint.rs delete mode 100644 src/dynamics/solver/joint_constraint/revolute_velocity_constraint_wide.rs delete mode 100644 src/dynamics/solver/parallel_position_solver.rs delete mode 100644 src/dynamics/solver/position_constraint.rs delete mode 100644 src/dynamics/solver/position_constraint_wide.rs delete mode 100644 src/dynamics/solver/position_ground_constraint.rs delete mode 100644 src/dynamics/solver/position_ground_constraint_wide.rs delete mode 100644 src/dynamics/solver/position_solver.rs delete mode 100644 src_testbed/nphysics_backend.rs diff --git a/.github/workflows/rapier-ci-build.yml b/.github/workflows/rapier-ci-build.yml index 08c5da5..b4bc538 100644 --- a/.github/workflows/rapier-ci-build.yml +++ b/.github/workflows/rapier-ci-build.yml @@ -28,13 +28,13 @@ jobs: - name: Build rapier3d run: cargo build --verbose -p rapier3d; - name: Build rapier2d SIMD - run: cd build/rapier2d; cargo build --verbose --features simd-stable; + run: cd crates/rapier2d; cargo build --verbose --features simd-stable; - name: Build rapier3d SIMD - run: cd build/rapier3d; cargo build --verbose --features simd-stable; + run: cd crates/rapier3d; cargo build --verbose --features simd-stable; - name: Build rapier2d SIMD Parallel - run: cd build/rapier2d; cargo build --verbose --features simd-stable --features parallel; + run: cd crates/rapier2d; cargo build --verbose --features simd-stable --features parallel; - name: Build rapier3d SIMD Parallel - run: cd build/rapier3d; cargo build --verbose --features simd-stable --features parallel; + run: cd crates/rapier3d; cargo build --verbose --features simd-stable --features parallel; - name: Run tests run: cargo test - name: Check rapier_testbed2d @@ -42,9 +42,9 @@ jobs: - name: Check rapier_testbed3d run: cargo check --verbose -p rapier_testbed3d; - name: Check rapier_testbed2d --features parallel - run: cd build/rapier_testbed2d; cargo check --verbose --features parallel; + run: cd crates/rapier_testbed2d; cargo check --verbose --features parallel; - name: Check rapier_testbed3d --features parallel - run: cd build/rapier_testbed3d; cargo check --verbose --features parallel; + run: cd crates/rapier_testbed3d; cargo check --verbose --features parallel; - name: Check rapier-examples-2d run: cargo check -j 1 --verbose -p rapier-examples-2d; - name: Check rapier-examples-3d @@ -57,9 +57,9 @@ jobs: - uses: actions/checkout@v2 - run: rustup target add wasm32-unknown-unknown - name: build rapier2d - run: cd build/rapier2d && cargo build --verbose --features wasm-bindgen --target wasm32-unknown-unknown; + run: cd crates/rapier2d && cargo build --verbose --features wasm-bindgen --target wasm32-unknown-unknown; - name: build rapier3d - run: cd build/rapier3d && cargo build --verbose --features wasm-bindgen --target wasm32-unknown-unknown; + run: cd crates/rapier3d && cargo build --verbose --features wasm-bindgen --target wasm32-unknown-unknown; build-wasm-emscripten: runs-on: ubuntu-latest env: @@ -68,10 +68,10 @@ jobs: - uses: actions/checkout@v2 - run: rustup target add wasm32-unknown-emscripten - name: build rapier2d - run: cd build/rapier2d && cargo build --verbose --target wasm32-unknown-emscripten; + run: cd crates/rapier2d && cargo build --verbose --target wasm32-unknown-emscripten; - name: build rapier3d - run: cd build/rapier3d && cargo build --verbose --target wasm32-unknown-emscripten; + run: cd crates/rapier3d && cargo build --verbose --target wasm32-unknown-emscripten; - name: build rapier2d --features simd-stable - run: cd build/rapier2d && cargo build --verbose --target wasm32-unknown-emscripten --features simd-stable; + run: cd crates/rapier2d && cargo build --verbose --target wasm32-unknown-emscripten --features simd-stable; - name: build rapier3d --features simd-stable - run: cd build/rapier3d && cargo build --verbose --target wasm32-unknown-emscripten --features simd-stable; + run: cd crates/rapier3d && cargo build --verbose --target wasm32-unknown-emscripten --features simd-stable; diff --git a/Cargo.toml b/Cargo.toml index 7021ade..1bd8c67 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,21 +1,17 @@ [workspace] -members = [ "build/rapier2d", "build/rapier2d-f64", "build/rapier_testbed2d", "examples2d", "benchmarks2d", - "build/rapier3d", "build/rapier3d-f64", "build/rapier_testbed3d", "examples3d", "benchmarks3d" ] +members = [ "crates/rapier2d", "crates/rapier2d-f64", "crates/rapier_testbed2d", "examples2d", "benchmarks2d", + "crates/rapier3d", "crates/rapier3d-f64", "crates/rapier_testbed3d", "examples3d", "benchmarks3d" ] resolver = "2" [patch.crates-io] #wrapped2d = { git = "https://github.com/Bastacyclop/rust_box2d.git" } #simba = { path = "../simba" } -#ncollide2d = { path = "../ncollide/build/ncollide2d" } -#ncollide3d = { path = "../ncollide/build/ncollide3d" } -#nphysics2d = { path = "../nphysics/build/nphysics2d" } -#nphysics3d = { path = "../nphysics/build/nphysics3d" } #kiss3d = { path = "../kiss3d" } -#parry2d = { path = "../parry/build/parry2d" } -#parry3d = { path = "../parry/build/parry3d" } -#parry2d-f64 = { path = "../parry/build/parry2d-f64" } -#parry3d-f64 = { path = "../parry/build/parry3d-f64" } +#parry2d = { path = "../parry/crates/parry2d" } +#parry3d = { path = "../parry/crates/parry3d" } +#parry2d-f64 = { path = "../parry/crates/parry2d-f64" } +#parry3d-f64 = { path = "../parry/crates/parry3d-f64" } #nalgebra = { path = "../nalgebra" } #kiss3d = { git = "https://github.com/sebcrozet/kiss3d" } @@ -24,14 +20,10 @@ resolver = "2" #parry3d = { git = "https://github.com/dimforge/parry", branch = "special_cases" } #parry2d-f64 = { git = "https://github.com/dimforge/parry", branch = "special_cases" } #parry3d-f64 = { git = "https://github.com/dimforge/parry", branch = "special_cases" } -#ncollide2d = { git = "https://github.com/dimforge/ncollide" } -#ncollide3d = { git = "https://github.com/dimforge/ncollide" } -#nphysics2d = { git = "https://github.com/dimforge/nphysics" } -#nphysics3d = { git = "https://github.com/dimforge/nphysics" } [profile.release] #debug = true -codegen-units = 1 +#codegen-units = 1 #opt-level = 1 #lto = true diff --git a/benchmarks2d/Cargo.toml b/benchmarks2d/Cargo.toml index c7c775d..bbab4d9 100644 --- a/benchmarks2d/Cargo.toml +++ b/benchmarks2d/Cargo.toml @@ -2,7 +2,7 @@ name = "rapier-benchmarks-2d" version = "0.1.0" authors = [ "Sébastien Crozet " ] -edition = "2018" +edition = "2021" [features] parallel = [ "rapier2d/parallel", "rapier_testbed2d/parallel" ] @@ -16,10 +16,10 @@ rand = "0.8" Inflector = "0.11" [dependencies.rapier_testbed2d] -path = "../build/rapier_testbed2d" +path = "../crates/rapier_testbed2d" [dependencies.rapier2d] -path = "../build/rapier2d" +path = "../crates/rapier2d" [[bin]] name = "all_benchmarks2" diff --git a/benchmarks2d/balls2.rs b/benchmarks2d/balls2.rs index ec55f24..168acaf 100644 --- a/benchmarks2d/balls2.rs +++ b/benchmarks2d/balls2.rs @@ -7,7 +7,9 @@ pub fn init_world(testbed: &mut Testbed) { */ let mut bodies = RigidBodySet::new(); let mut colliders = ColliderSet::new(); - let joints = JointSet::new(); + let impulse_joints = ImpulseJointSet::new(); + let multibody_joints = MultibodyJointSet::new(); + /* * Ground */ @@ -58,6 +60,6 @@ pub fn init_world(testbed: &mut Testbed) { /* * Set up the testbed. */ - testbed.set_world(bodies, colliders, joints); + testbed.set_world(bodies, colliders, impulse_joints, multibody_joints); testbed.look_at(point![0.0, 2.5], 5.0); } diff --git a/benchmarks2d/boxes2.rs b/benchmarks2d/boxes2.rs index 2e4c5e4..c3d7445 100644 --- a/benchmarks2d/boxes2.rs +++ b/benchmarks2d/boxes2.rs @@ -7,7 +7,8 @@ pub fn init_world(testbed: &mut Testbed) { */ let mut bodies = RigidBodySet::new(); let mut colliders = ColliderSet::new(); - let joints = JointSet::new(); + let impulse_joints = ImpulseJointSet::new(); + let multibody_joints = MultibodyJointSet::new(); /* * Ground @@ -63,6 +64,6 @@ pub fn init_world(testbed: &mut Testbed) { /* * Set up the testbed. */ - testbed.set_world(bodies, colliders, joints); + testbed.set_world(bodies, colliders, impulse_joints, multibody_joints); testbed.look_at(point![0.0, 50.0], 10.0); } diff --git a/benchmarks2d/capsules2.rs b/benchmarks2d/capsules2.rs index e75afe4..3bfa6ab 100644 --- a/benchmarks2d/capsules2.rs +++ b/benchmarks2d/capsules2.rs @@ -7,7 +7,8 @@ pub fn init_world(testbed: &mut Testbed) { */ let mut bodies = RigidBodySet::new(); let mut colliders = ColliderSet::new(); - let joints = JointSet::new(); + let impulse_joints = ImpulseJointSet::new(); + let multibody_joints = MultibodyJointSet::new(); /* * Ground @@ -65,6 +66,6 @@ pub fn init_world(testbed: &mut Testbed) { /* * Set up the testbed. */ - testbed.set_world(bodies, colliders, joints); + testbed.set_world(bodies, colliders, impulse_joints, multibody_joints); testbed.look_at(point![0.0, 50.0], 10.0); } diff --git a/benchmarks2d/convex_polygons2.rs b/benchmarks2d/convex_polygons2.rs index 6c9792e..6678460 100644 --- a/benchmarks2d/convex_polygons2.rs +++ b/benchmarks2d/convex_polygons2.rs @@ -9,7 +9,8 @@ pub fn init_world(testbed: &mut Testbed) { */ let mut bodies = RigidBodySet::new(); let mut colliders = ColliderSet::new(); - let joints = JointSet::new(); + let impulse_joints = ImpulseJointSet::new(); + let multibody_joints = MultibodyJointSet::new(); /* * Ground @@ -76,6 +77,6 @@ pub fn init_world(testbed: &mut Testbed) { /* * Set up the testbed. */ - testbed.set_world(bodies, colliders, joints); + testbed.set_world(bodies, colliders, impulse_joints, multibody_joints); testbed.look_at(point![0.0, 50.0], 10.0); } diff --git a/benchmarks2d/heightfield2.rs b/benchmarks2d/heightfield2.rs index 3178e60..04c56da 100644 --- a/benchmarks2d/heightfield2.rs +++ b/benchmarks2d/heightfield2.rs @@ -8,7 +8,8 @@ pub fn init_world(testbed: &mut Testbed) { */ let mut bodies = RigidBodySet::new(); let mut colliders = ColliderSet::new(); - let joints = JointSet::new(); + let impulse_joints = ImpulseJointSet::new(); + let multibody_joints = MultibodyJointSet::new(); /* * Ground @@ -63,6 +64,6 @@ pub fn init_world(testbed: &mut Testbed) { /* * Set up the testbed. */ - testbed.set_world(bodies, colliders, joints); + testbed.set_world(bodies, colliders, impulse_joints, multibody_joints); testbed.look_at(point![0.0, 50.0], 10.0); } diff --git a/benchmarks2d/joint_ball2.rs b/benchmarks2d/joint_ball2.rs index 114fe85..e856556 100644 --- a/benchmarks2d/joint_ball2.rs +++ b/benchmarks2d/joint_ball2.rs @@ -7,7 +7,8 @@ pub fn init_world(testbed: &mut Testbed) { */ let mut bodies = RigidBodySet::new(); let mut colliders = ColliderSet::new(); - let mut joints = JointSet::new(); + let mut impulse_joints = ImpulseJointSet::new(); + let multibody_joints = MultibodyJointSet::new(); /* * Create the balls @@ -41,16 +42,16 @@ pub fn init_world(testbed: &mut Testbed) { // Vertical joint. if i > 0 { let parent_handle = *body_handles.last().unwrap(); - let joint = BallJoint::new(Point::origin(), point![0.0, shift]); - joints.insert(parent_handle, child_handle, joint); + let joint = RevoluteJoint::new().local_anchor2(point![0.0, shift]); + impulse_joints.insert(parent_handle, child_handle, joint); } // Horizontal joint. if k > 0 { let parent_index = body_handles.len() - numi; let parent_handle = body_handles[parent_index]; - let joint = BallJoint::new(Point::origin(), point![-shift, 0.0]); - joints.insert(parent_handle, child_handle, joint); + let joint = RevoluteJoint::new().local_anchor2(point![-shift, 0.0]); + impulse_joints.insert(parent_handle, child_handle, joint); } body_handles.push(child_handle); @@ -60,6 +61,6 @@ pub fn init_world(testbed: &mut Testbed) { /* * Set up the testbed. */ - testbed.set_world(bodies, colliders, joints); + testbed.set_world(bodies, colliders, impulse_joints, multibody_joints); testbed.look_at(point![numk as f32 * rad, numi as f32 * -rad], 5.0); } diff --git a/benchmarks2d/joint_fixed2.rs b/benchmarks2d/joint_fixed2.rs index 8d6e8dc..690b8cb 100644 --- a/benchmarks2d/joint_fixed2.rs +++ b/benchmarks2d/joint_fixed2.rs @@ -7,7 +7,8 @@ pub fn init_world(testbed: &mut Testbed) { */ let mut bodies = RigidBodySet::new(); let mut colliders = ColliderSet::new(); - let mut joints = JointSet::new(); + let mut impulse_joints = ImpulseJointSet::new(); + let multibody_joints = MultibodyJointSet::new(); /* * Create the balls @@ -46,22 +47,18 @@ pub fn init_world(testbed: &mut Testbed) { // Vertical joint. if i > 0 { let parent_handle = *body_handles.last().unwrap(); - let joint = FixedJoint::new( - Isometry::identity(), - Isometry::translation(0.0, shift), - ); - joints.insert(parent_handle, child_handle, joint); + let joint = + FixedJoint::new().local_frame2(Isometry::translation(0.0, shift)); + impulse_joints.insert(parent_handle, child_handle, joint); } // Horizontal joint. if k > 0 { let parent_index = body_handles.len() - num; let parent_handle = body_handles[parent_index]; - let joint = FixedJoint::new( - Isometry::identity(), - Isometry::translation(-shift, 0.0), - ); - joints.insert(parent_handle, child_handle, joint); + let joint = + FixedJoint::new().local_frame2(Isometry::translation(-shift, 0.0)); + impulse_joints.insert(parent_handle, child_handle, joint); } body_handles.push(child_handle); @@ -73,6 +70,6 @@ pub fn init_world(testbed: &mut Testbed) { /* * Set up the testbed. */ - testbed.set_world(bodies, colliders, joints); + testbed.set_world(bodies, colliders, impulse_joints, multibody_joints); testbed.look_at(point![50.0, 50.0], 5.0); } diff --git a/benchmarks2d/joint_prismatic2.rs b/benchmarks2d/joint_prismatic2.rs index c2b4bf3..4733088 100644 --- a/benchmarks2d/joint_prismatic2.rs +++ b/benchmarks2d/joint_prismatic2.rs @@ -7,7 +7,8 @@ pub fn init_world(testbed: &mut Testbed) { */ let mut bodies = RigidBodySet::new(); let mut colliders = ColliderSet::new(); - let mut joints = JointSet::new(); + let mut impulse_joints = ImpulseJointSet::new(); + let multibody_joints = MultibodyJointSet::new(); /* * Create the balls @@ -46,12 +47,10 @@ pub fn init_world(testbed: &mut Testbed) { UnitVector::new_normalize(vector![-1.0, 1.0]) }; - let mut prism = - PrismaticJoint::new(Point::origin(), axis, point![0.0, shift], axis); - prism.limits_enabled = true; - prism.limits[0] = -1.5; - prism.limits[1] = 1.5; - joints.insert(curr_parent, curr_child, prism); + let mut prism = PrismaticJoint::new(axis) + .local_anchor2(point![0.0, shift]) + .limit_axis([-1.5, 1.5]); + impulse_joints.insert(curr_parent, curr_child, prism); curr_parent = curr_child; } @@ -61,6 +60,6 @@ pub fn init_world(testbed: &mut Testbed) { /* * Set up the testbed. */ - testbed.set_world(bodies, colliders, joints); + testbed.set_world(bodies, colliders, impulse_joints, multibody_joints); testbed.look_at(point![80.0, 80.0], 15.0); } diff --git a/benchmarks2d/pyramid2.rs b/benchmarks2d/pyramid2.rs index a557ff4..61636b9 100644 --- a/benchmarks2d/pyramid2.rs +++ b/benchmarks2d/pyramid2.rs @@ -7,7 +7,8 @@ pub fn init_world(testbed: &mut Testbed) { */ let mut bodies = RigidBodySet::new(); let mut colliders = ColliderSet::new(); - let joints = JointSet::new(); + let impulse_joints = ImpulseJointSet::new(); + let multibody_joints = MultibodyJointSet::new(); /* * Ground @@ -50,6 +51,6 @@ pub fn init_world(testbed: &mut Testbed) { /* * Set up the testbed. */ - testbed.set_world(bodies, colliders, joints); + testbed.set_world(bodies, colliders, impulse_joints, multibody_joints); testbed.look_at(point![0.0, 2.5], 5.0); } diff --git a/benchmarks3d/Cargo.toml b/benchmarks3d/Cargo.toml index 9b76df3..76d1911 100644 --- a/benchmarks3d/Cargo.toml +++ b/benchmarks3d/Cargo.toml @@ -2,7 +2,7 @@ name = "rapier-benchmarks-3d" version = "0.1.0" authors = [ "Sébastien Crozet " ] -edition = "2018" +edition = "2021" [features] parallel = [ "rapier3d/parallel", "rapier_testbed3d/parallel" ] @@ -16,10 +16,10 @@ rand = "0.8" Inflector = "0.11" [dependencies.rapier_testbed3d] -path = "../build/rapier_testbed3d" +path = "../crates/rapier_testbed3d" [dependencies.rapier3d] -path = "../build/rapier3d" +path = "../crates/rapier3d" [[bin]] name = "all_benchmarks3" diff --git a/benchmarks3d/all_benchmarks3.rs b/benchmarks3d/all_benchmarks3.rs index f61b80f..6a3f756 100644 --- a/benchmarks3d/all_benchmarks3.rs +++ b/benchmarks3d/all_benchmarks3.rs @@ -58,10 +58,10 @@ pub fn main() { ("Stacks", stacks3::init_world), ("Pyramid", pyramid3::init_world), ("Trimesh", trimesh3::init_world), - ("Joint ball", joint_ball3::init_world), - ("Joint fixed", joint_fixed3::init_world), - ("Joint revolute", joint_revolute3::init_world), - ("Joint prismatic", joint_prismatic3::init_world), + ("ImpulseJoint ball", joint_ball3::init_world), + ("ImpulseJoint fixed", joint_fixed3::init_world), + ("ImpulseJoint revolute", joint_revolute3::init_world), + ("ImpulseJoint prismatic", joint_prismatic3::init_world), ("Keva tower", keva3::init_world), ]; diff --git a/benchmarks3d/balls3.rs b/benchmarks3d/balls3.rs index 3f0bf36..b4d5102 100644 --- a/benchmarks3d/balls3.rs +++ b/benchmarks3d/balls3.rs @@ -7,7 +7,8 @@ pub fn init_world(testbed: &mut Testbed) { */ let mut bodies = RigidBodySet::new(); let mut colliders = ColliderSet::new(); - let joints = JointSet::new(); + let impulse_joints = ImpulseJointSet::new(); + let multibody_joints = MultibodyJointSet::new(); /* * Create the balls @@ -48,6 +49,6 @@ pub fn init_world(testbed: &mut Testbed) { /* * Set up the testbed. */ - testbed.set_world(bodies, colliders, joints); + testbed.set_world(bodies, colliders, impulse_joints, multibody_joints); testbed.look_at(point![100.0, 100.0, 100.0], Point::origin()); } diff --git a/benchmarks3d/boxes3.rs b/benchmarks3d/boxes3.rs index 9c7ed81..0250619 100644 --- a/benchmarks3d/boxes3.rs +++ b/benchmarks3d/boxes3.rs @@ -7,7 +7,8 @@ pub fn init_world(testbed: &mut Testbed) { */ let mut bodies = RigidBodySet::new(); let mut colliders = ColliderSet::new(); - let joints = JointSet::new(); + let impulse_joints = ImpulseJointSet::new(); + let multibody_joints = MultibodyJointSet::new(); /* * Ground @@ -58,6 +59,6 @@ pub fn init_world(testbed: &mut Testbed) { /* * Set up the testbed. */ - testbed.set_world(bodies, colliders, joints); + testbed.set_world(bodies, colliders, impulse_joints, multibody_joints); testbed.look_at(point![100.0, 100.0, 100.0], Point::origin()); } diff --git a/benchmarks3d/capsules3.rs b/benchmarks3d/capsules3.rs index 8565503..5b05f23 100644 --- a/benchmarks3d/capsules3.rs +++ b/benchmarks3d/capsules3.rs @@ -7,7 +7,8 @@ pub fn init_world(testbed: &mut Testbed) { */ let mut bodies = RigidBodySet::new(); let mut colliders = ColliderSet::new(); - let joints = JointSet::new(); + let impulse_joints = ImpulseJointSet::new(); + let multibody_joints = MultibodyJointSet::new(); /* * Ground @@ -59,6 +60,6 @@ pub fn init_world(testbed: &mut Testbed) { /* * Set up the testbed. */ - testbed.set_world(bodies, colliders, joints); + testbed.set_world(bodies, colliders, impulse_joints, multibody_joints); testbed.look_at(point![100.0, 100.0, 100.0], Point::origin()); } diff --git a/benchmarks3d/ccd3.rs b/benchmarks3d/ccd3.rs index 987aba6..d54ebc1 100644 --- a/benchmarks3d/ccd3.rs +++ b/benchmarks3d/ccd3.rs @@ -7,7 +7,8 @@ pub fn init_world(testbed: &mut Testbed) { */ let mut bodies = RigidBodySet::new(); let mut colliders = ColliderSet::new(); - let joints = JointSet::new(); + let impulse_joints = ImpulseJointSet::new(); + let multibody_joints = MultibodyJointSet::new(); /* * Ground @@ -73,6 +74,6 @@ pub fn init_world(testbed: &mut Testbed) { /* * Set up the testbed. */ - testbed.set_world(bodies, colliders, joints); + testbed.set_world(bodies, colliders, impulse_joints, multibody_joints); testbed.look_at(point![100.0, 100.0, 100.0], Point::origin()); } diff --git a/benchmarks3d/compound3.rs b/benchmarks3d/compound3.rs index a914ce9..872923c 100644 --- a/benchmarks3d/compound3.rs +++ b/benchmarks3d/compound3.rs @@ -7,7 +7,8 @@ pub fn init_world(testbed: &mut Testbed) { */ let mut bodies = RigidBodySet::new(); let mut colliders = ColliderSet::new(); - let joints = JointSet::new(); + let impulse_joints = ImpulseJointSet::new(); + let multibody_joints = MultibodyJointSet::new(); /* * Ground @@ -66,6 +67,6 @@ pub fn init_world(testbed: &mut Testbed) { /* * Set up the testbed. */ - testbed.set_world(bodies, colliders, joints); + testbed.set_world(bodies, colliders, impulse_joints, multibody_joints); testbed.look_at(point![100.0, 100.0, 100.0], Point::origin()); } diff --git a/benchmarks3d/convex_polyhedron3.rs b/benchmarks3d/convex_polyhedron3.rs index 7065cd5..cb834ea 100644 --- a/benchmarks3d/convex_polyhedron3.rs +++ b/benchmarks3d/convex_polyhedron3.rs @@ -9,7 +9,8 @@ pub fn init_world(testbed: &mut Testbed) { */ let mut bodies = RigidBodySet::new(); let mut colliders = ColliderSet::new(); - let joints = JointSet::new(); + let impulse_joints = ImpulseJointSet::new(); + let multibody_joints = MultibodyJointSet::new(); /* * Ground @@ -73,6 +74,6 @@ pub fn init_world(testbed: &mut Testbed) { /* * Set up the testbed. */ - testbed.set_world(bodies, colliders, joints); + testbed.set_world(bodies, colliders, impulse_joints, multibody_joints); testbed.look_at(point![100.0, 100.0, 100.0], Point::origin()); } diff --git a/benchmarks3d/heightfield3.rs b/benchmarks3d/heightfield3.rs index 32856fe..b95f1ee 100644 --- a/benchmarks3d/heightfield3.rs +++ b/benchmarks3d/heightfield3.rs @@ -8,7 +8,8 @@ pub fn init_world(testbed: &mut Testbed) { */ let mut bodies = RigidBodySet::new(); let mut colliders = ColliderSet::new(); - let joints = JointSet::new(); + let impulse_joints = ImpulseJointSet::new(); + let multibody_joints = MultibodyJointSet::new(); /* * Ground @@ -73,6 +74,6 @@ pub fn init_world(testbed: &mut Testbed) { /* * Set up the testbed. */ - testbed.set_world(bodies, colliders, joints); + testbed.set_world(bodies, colliders, impulse_joints, multibody_joints); testbed.look_at(point![100.0, 100.0, 100.0], Point::origin()); } diff --git a/benchmarks3d/joint_ball3.rs b/benchmarks3d/joint_ball3.rs index a1661f8..64128ba 100644 --- a/benchmarks3d/joint_ball3.rs +++ b/benchmarks3d/joint_ball3.rs @@ -7,7 +7,8 @@ pub fn init_world(testbed: &mut Testbed) { */ let mut bodies = RigidBodySet::new(); let mut colliders = ColliderSet::new(); - let mut joints = JointSet::new(); + let mut impulse_joints = ImpulseJointSet::new(); + let multibody_joints = MultibodyJointSet::new(); let rad = 0.4; let num = 100; @@ -36,16 +37,16 @@ pub fn init_world(testbed: &mut Testbed) { // Vertical joint. if i > 0 { let parent_handle = *body_handles.last().unwrap(); - let joint = BallJoint::new(Point::origin(), point![0.0, 0.0, -shift]); - joints.insert(parent_handle, child_handle, joint); + let joint = SphericalJoint::new().local_anchor2(point![0.0, 0.0, -shift]); + impulse_joints.insert(parent_handle, child_handle, joint); } // Horizontal joint. if k > 0 { let parent_index = body_handles.len() - num; let parent_handle = body_handles[parent_index]; - let joint = BallJoint::new(Point::origin(), point![-shift, 0.0, 0.0]); - joints.insert(parent_handle, child_handle, joint); + let joint = SphericalJoint::new().local_anchor2(point![-shift, 0.0, 0.0]); + impulse_joints.insert(parent_handle, child_handle, joint); } body_handles.push(child_handle); @@ -55,6 +56,6 @@ pub fn init_world(testbed: &mut Testbed) { /* * Set up the testbed. */ - testbed.set_world(bodies, colliders, joints); + testbed.set_world(bodies, colliders, impulse_joints, multibody_joints); testbed.look_at(point![-110.0, -46.0, 170.0], point![54.0, -38.0, 29.0]); } diff --git a/benchmarks3d/joint_fixed3.rs b/benchmarks3d/joint_fixed3.rs index 3d1e317..b3f4039 100644 --- a/benchmarks3d/joint_fixed3.rs +++ b/benchmarks3d/joint_fixed3.rs @@ -7,7 +7,8 @@ pub fn init_world(testbed: &mut Testbed) { */ let mut bodies = RigidBodySet::new(); let mut colliders = ColliderSet::new(); - let mut joints = JointSet::new(); + let mut impulse_joints = ImpulseJointSet::new(); + let multibody_joints = MultibodyJointSet::new(); let rad = 0.4; let num = 5; @@ -49,22 +50,16 @@ pub fn init_world(testbed: &mut Testbed) { // Vertical joint. if i > 0 { let parent_handle = *body_handles.last().unwrap(); - let joint = FixedJoint::new( - Isometry::identity(), - Isometry::translation(0.0, 0.0, -shift), - ); - joints.insert(parent_handle, child_handle, joint); + let joint = FixedJoint::new().local_anchor2(point![0.0, 0.0, -shift]); + impulse_joints.insert(parent_handle, child_handle, joint); } // Horizontal joint. if k > 0 { let parent_index = body_handles.len() - num; let parent_handle = body_handles[parent_index]; - let joint = FixedJoint::new( - Isometry::identity(), - Isometry::translation(-shift, 0.0, 0.0), - ); - joints.insert(parent_handle, child_handle, joint); + let joint = FixedJoint::new().local_anchor2(point![-shift, 0.0, 0.0]); + impulse_joints.insert(parent_handle, child_handle, joint); } body_handles.push(child_handle); @@ -77,6 +72,6 @@ pub fn init_world(testbed: &mut Testbed) { /* * Set up the testbed. */ - testbed.set_world(bodies, colliders, joints); + testbed.set_world(bodies, colliders, impulse_joints, multibody_joints); testbed.look_at(point![-38.0, 14.0, 108.0], point![46.0, 12.0, 23.0]); } diff --git a/benchmarks3d/joint_prismatic3.rs b/benchmarks3d/joint_prismatic3.rs index b011662..80839d7 100644 --- a/benchmarks3d/joint_prismatic3.rs +++ b/benchmarks3d/joint_prismatic3.rs @@ -7,7 +7,8 @@ pub fn init_world(testbed: &mut Testbed) { */ let mut bodies = RigidBodySet::new(); let mut colliders = ColliderSet::new(); - let mut joints = JointSet::new(); + let mut impulse_joints = ImpulseJointSet::new(); + let multibody_joints = MultibodyJointSet::new(); let rad = 0.4; let num = 5; @@ -47,19 +48,10 @@ pub fn init_world(testbed: &mut Testbed) { UnitVector::new_normalize(vector![-1.0, 1.0, 0.0]) }; - let z = Vector::z(); - let mut prism = PrismaticJoint::new( - Point::origin(), - axis, - z, - point![0.0, 0.0, -shift], - axis, - z, - ); - prism.limits_enabled = true; - prism.limits[0] = -2.0; - prism.limits[1] = 2.0; - joints.insert(curr_parent, curr_child, prism); + let prism = PrismaticJoint::new(axis) + .local_anchor2(point![0.0, 0.0, -shift]) + .limit_axis([-2.0, 0.0]); + impulse_joints.insert(curr_parent, curr_child, prism); curr_parent = curr_child; } @@ -70,6 +62,6 @@ pub fn init_world(testbed: &mut Testbed) { /* * Set up the testbed. */ - testbed.set_world(bodies, colliders, joints); + testbed.set_world(bodies, colliders, impulse_joints, multibody_joints); testbed.look_at(point![262.0, 63.0, 124.0], point![101.0, 4.0, -3.0]); } diff --git a/benchmarks3d/joint_revolute3.rs b/benchmarks3d/joint_revolute3.rs index d6dc06c..8bdf0e9 100644 --- a/benchmarks3d/joint_revolute3.rs +++ b/benchmarks3d/joint_revolute3.rs @@ -7,7 +7,8 @@ pub fn init_world(testbed: &mut Testbed) { */ let mut bodies = RigidBodySet::new(); let mut colliders = ColliderSet::new(); - let mut joints = JointSet::new(); + let mut impulse_joints = ImpulseJointSet::new(); + let multibody_joints = MultibodyJointSet::new(); let rad = 0.4; let num = 10; @@ -49,22 +50,21 @@ pub fn init_world(testbed: &mut Testbed) { colliders.insert_with_parent(collider, handles[k], &mut bodies); } - // Setup four joints. - let o = Point::origin(); + // Setup four impulse_joints. let x = Vector::x_axis(); let z = Vector::z_axis(); let revs = [ - RevoluteJoint::new(o, z, point![0.0, 0.0, -shift], z), - RevoluteJoint::new(o, x, point![-shift, 0.0, 0.0], x), - RevoluteJoint::new(o, z, point![0.0, 0.0, -shift], z), - RevoluteJoint::new(o, x, point![shift, 0.0, 0.0], x), + RevoluteJoint::new(z).local_anchor2(point![0.0, 0.0, -shift]), + RevoluteJoint::new(x).local_anchor2(point![-shift, 0.0, 0.0]), + RevoluteJoint::new(z).local_anchor2(point![0.0, 0.0, -shift]), + RevoluteJoint::new(x).local_anchor2(point![shift, 0.0, 0.0]), ]; - joints.insert(curr_parent, handles[0], revs[0]); - joints.insert(handles[0], handles[1], revs[1]); - joints.insert(handles[1], handles[2], revs[2]); - joints.insert(handles[2], handles[3], revs[3]); + impulse_joints.insert(curr_parent, handles[0], revs[0]); + impulse_joints.insert(handles[0], handles[1], revs[1]); + impulse_joints.insert(handles[1], handles[2], revs[2]); + impulse_joints.insert(handles[2], handles[3], revs[3]); curr_parent = handles[3]; } @@ -74,6 +74,6 @@ pub fn init_world(testbed: &mut Testbed) { /* * Set up the testbed. */ - testbed.set_world(bodies, colliders, joints); + testbed.set_world(bodies, colliders, impulse_joints, multibody_joints); testbed.look_at(point![478.0, 83.0, 228.0], point![134.0, 83.0, -116.0]); } diff --git a/benchmarks3d/keva3.rs b/benchmarks3d/keva3.rs index 38a0432..ad9e1ae 100644 --- a/benchmarks3d/keva3.rs +++ b/benchmarks3d/keva3.rs @@ -83,7 +83,8 @@ pub fn init_world(testbed: &mut Testbed) { */ let mut bodies = RigidBodySet::new(); let mut colliders = ColliderSet::new(); - let joints = JointSet::new(); + let impulse_joints = ImpulseJointSet::new(); + let multibody_joints = MultibodyJointSet::new(); /* * Ground @@ -132,6 +133,6 @@ pub fn init_world(testbed: &mut Testbed) { /* * Set up the testbed. */ - testbed.set_world(bodies, colliders, joints); + testbed.set_world(bodies, colliders, impulse_joints, multibody_joints); testbed.look_at(point![100.0, 100.0, 100.0], Point::origin()); } diff --git a/benchmarks3d/pyramid3.rs b/benchmarks3d/pyramid3.rs index 655ecb7..b378da4 100644 --- a/benchmarks3d/pyramid3.rs +++ b/benchmarks3d/pyramid3.rs @@ -41,7 +41,8 @@ pub fn init_world(testbed: &mut Testbed) { */ let mut bodies = RigidBodySet::new(); let mut colliders = ColliderSet::new(); - let joints = JointSet::new(); + let impulse_joints = ImpulseJointSet::new(); + let multibody_joints = MultibodyJointSet::new(); /* * Ground @@ -73,6 +74,6 @@ pub fn init_world(testbed: &mut Testbed) { /* * Set up the testbed. */ - testbed.set_world(bodies, colliders, joints); + testbed.set_world(bodies, colliders, impulse_joints, multibody_joints); testbed.look_at(point![100.0, 100.0, 100.0], Point::origin()); } diff --git a/benchmarks3d/stacks3.rs b/benchmarks3d/stacks3.rs index 39386ea..7fc9097 100644 --- a/benchmarks3d/stacks3.rs +++ b/benchmarks3d/stacks3.rs @@ -101,7 +101,8 @@ pub fn init_world(testbed: &mut Testbed) { */ let mut bodies = RigidBodySet::new(); let mut colliders = ColliderSet::new(); - let joints = JointSet::new(); + let impulse_joints = ImpulseJointSet::new(); + let multibody_joints = MultibodyJointSet::new(); /* * Ground @@ -183,6 +184,6 @@ pub fn init_world(testbed: &mut Testbed) { /* * Set up the testbed. */ - testbed.set_world(bodies, colliders, joints); + testbed.set_world(bodies, colliders, impulse_joints, multibody_joints); testbed.look_at(point![100.0, 100.0, 100.0], Point::origin()); } diff --git a/benchmarks3d/trimesh3.rs b/benchmarks3d/trimesh3.rs index 8621f19..1039a09 100644 --- a/benchmarks3d/trimesh3.rs +++ b/benchmarks3d/trimesh3.rs @@ -8,7 +8,8 @@ pub fn init_world(testbed: &mut Testbed) { */ let mut bodies = RigidBodySet::new(); let mut colliders = ColliderSet::new(); - let joints = JointSet::new(); + let impulse_joints = ImpulseJointSet::new(); + let multibody_joints = MultibodyJointSet::new(); /* * Ground @@ -78,6 +79,6 @@ pub fn init_world(testbed: &mut Testbed) { /* * Set up the testbed. */ - testbed.set_world(bodies, colliders, joints); + testbed.set_world(bodies, colliders, impulse_joints, multibody_joints); testbed.look_at(point![100.0, 100.0, 100.0], Point::origin()); } diff --git a/build/rapier2d-f64/Cargo.toml b/build/rapier2d-f64/Cargo.toml deleted file mode 100644 index 5d85639..0000000 --- a/build/rapier2d-f64/Cargo.toml +++ /dev/null @@ -1,67 +0,0 @@ -[package] -name = "rapier2d-f64" -version = "0.11.1" -authors = [ "Sébastien Crozet " ] -description = "2-dimensional physics engine in Rust." -documentation = "http://docs.rs/rapier2d" -homepage = "http://rapier.rs" -repository = "https://github.com/dimforge/rapier" -readme = "README.md" -categories = [ "science", "game-development", "mathematics", "simulation", "wasm"] -keywords = [ "physics", "dynamics", "rigid", "real-time", "joints" ] -license = "Apache-2.0" -edition = "2018" - -[badges] -maintenance = { status = "actively-developed" } - -[features] -default = [ "dim2", "f64", "default-sets" ] -dim2 = [ ] -f64 = [ ] -default-sets = [ ] -parallel = [ "rayon" ] -simd-stable = [ "simba/wide", "simd-is-enabled" ] -simd-nightly = [ "simba/packed_simd", "simd-is-enabled" ] -# Do not enable this feature directly. It is automatically -# enabled with the "simd-stable" or "simd-nightly" feature. -simd-is-enabled = [ "vec_map" ] -wasm-bindgen = [ "instant/wasm-bindgen" ] -serde-serialize = [ "nalgebra/serde-serialize", "parry2d-f64/serde-serialize", "serde", "bit-vec/serde", "arrayvec/serde" ] -enhanced-determinism = [ "simba/libm_force", "parry2d-f64/enhanced-determinism", "indexmap" ] - -# Feature used for debugging only. -debug-disable-legitimate-fe-exceptions = [ ] - -# Feature used for development and debugging only. -# Do not enable this unless you are working on the engine internals. -dev-remove-slow-accessors = [] - -[lib] -name = "rapier2d_f64" -path = "../../src/lib.rs" -required-features = [ "dim2", "f64" ] - - -[dependencies] -vec_map = { version = "0.8", optional = true } -instant = { version = "0.1", features = [ "now" ]} -num-traits = "0.2" -nalgebra = "0.29" -parry2d-f64 = "^0.7.1" -simba = "0.6" -approx = "0.5" -rayon = { version = "1", optional = true } -crossbeam = "0.8" -arrayvec = "0.7" -bit-vec = "0.6" -rustc-hash = "1" -serde = { version = "1", features = [ "derive" ], optional = true } -indexmap = { version = "1", features = [ "serde-1" ], optional = true } -downcast-rs = "1.2" -num-derive = "0.3" -bitflags = "1" - -[dev-dependencies] -bincode = "1" -serde = { version = "1", features = [ "derive" ] } diff --git a/build/rapier2d/Cargo.toml b/build/rapier2d/Cargo.toml deleted file mode 100644 index 9bc5f3b..0000000 --- a/build/rapier2d/Cargo.toml +++ /dev/null @@ -1,67 +0,0 @@ -[package] -name = "rapier2d" -version = "0.11.1" -authors = [ "Sébastien Crozet " ] -description = "2-dimensional physics engine in Rust." -documentation = "http://docs.rs/rapier2d" -homepage = "http://rapier.rs" -repository = "https://github.com/dimforge/rapier" -readme = "README.md" -categories = [ "science", "game-development", "mathematics", "simulation", "wasm"] -keywords = [ "physics", "dynamics", "rigid", "real-time", "joints" ] -license = "Apache-2.0" -edition = "2018" - -[badges] -maintenance = { status = "actively-developed" } - -[features] -default = [ "dim2", "f32", "default-sets" ] -dim2 = [ ] -f32 = [ ] -default-sets = [ ] -parallel = [ "rayon" ] -simd-stable = [ "simba/wide", "simd-is-enabled" ] -simd-nightly = [ "simba/packed_simd", "simd-is-enabled" ] -# Do not enable this feature directly. It is automatically -# enabled with the "simd-stable" or "simd-nightly" feature. -simd-is-enabled = [ "vec_map" ] -wasm-bindgen = [ "instant/wasm-bindgen" ] -serde-serialize = [ "nalgebra/serde-serialize", "parry2d/serde-serialize", "serde", "bit-vec/serde", "arrayvec/serde" ] -enhanced-determinism = [ "simba/libm_force", "parry2d/enhanced-determinism", "indexmap" ] - -# Feature used for debugging only. -debug-disable-legitimate-fe-exceptions = [ ] - -# Feature used for development and debugging only. -# Do not enable this unless you are working on the engine internals. -dev-remove-slow-accessors = [] - -[lib] -name = "rapier2d" -path = "../../src/lib.rs" -required-features = [ "dim2", "f32" ] - - -[dependencies] -vec_map = { version = "0.8", optional = true } -instant = { version = "0.1", features = [ "now" ]} -num-traits = "0.2" -nalgebra = "0.29" -parry2d = "^0.7.1" -simba = "0.6" -approx = "0.5" -rayon = { version = "1", optional = true } -crossbeam = "0.8" -arrayvec = "0.7" -bit-vec = "0.6" -rustc-hash = "1" -serde = { version = "1", features = [ "derive" ], optional = true } -indexmap = { version = "1", features = [ "serde-1" ], optional = true } -downcast-rs = "1.2" -num-derive = "0.3" -bitflags = "1" - -[dev-dependencies] -bincode = "1" -serde = { version = "1", features = [ "derive" ] } diff --git a/build/rapier3d-f64/Cargo.toml b/build/rapier3d-f64/Cargo.toml deleted file mode 100644 index a6cdd00..0000000 --- a/build/rapier3d-f64/Cargo.toml +++ /dev/null @@ -1,66 +0,0 @@ -[package] -name = "rapier3d-f64" -version = "0.11.1" -authors = [ "Sébastien Crozet " ] -description = "3-dimensional physics engine in Rust." -documentation = "http://docs.rs/rapier3d" -homepage = "http://rapier.rs" -repository = "https://github.com/dimforge/rapier" -readme = "README.md" -categories = [ "science", "game-development", "mathematics", "simulation", "wasm"] -keywords = [ "physics", "dynamics", "rigid", "real-time", "joints" ] -license = "Apache-2.0" -edition = "2018" - -[badges] -maintenance = { status = "actively-developed" } - -[features] -default = [ "dim3", "f64", "default-sets" ] -dim3 = [ ] -f64 = [ ] -default-sets = [ ] -parallel = [ "rayon" ] -simd-stable = [ "parry3d-f64/simd-stable", "simba/wide", "simd-is-enabled" ] -simd-nightly = [ "parry3d-f64/simd-nightly", "simba/packed_simd", "simd-is-enabled" ] -# Do not enable this feature directly. It is automatically -# enabled with the "simd-stable" or "simd-nightly" feature. -simd-is-enabled = [ "vec_map" ] -wasm-bindgen = [ "instant/wasm-bindgen" ] -serde-serialize = [ "nalgebra/serde-serialize", "parry3d-f64/serde-serialize", "serde", "bit-vec/serde" ] -enhanced-determinism = [ "simba/libm_force", "parry3d-f64/enhanced-determinism" ] - -# Feature used for debugging only. -debug-disable-legitimate-fe-exceptions = [ ] - -# Feature used for development and debugging only. -# Do not enable this unless you are working on the engine internals. -dev-remove-slow-accessors = [] - -[lib] -name = "rapier3d_f64" -path = "../../src/lib.rs" -required-features = [ "dim3", "f64" ] - - -[dependencies] -vec_map = { version = "0.8", optional = true } -instant = { version = "0.1", features = [ "now" ]} -num-traits = "0.2" -nalgebra = "0.29" -parry3d-f64 = "^0.7.1" -simba = "0.6" -approx = "0.5" -rayon = { version = "1", optional = true } -crossbeam = "0.8" -arrayvec = "0.7" -bit-vec = "0.6" -rustc-hash = "1" -serde = { version = "1", features = [ "derive" ], optional = true } -downcast-rs = "1.2" -num-derive = "0.3" -bitflags = "1" - -[dev-dependencies] -bincode = "1" -serde = { version = "1", features = [ "derive" ] } diff --git a/build/rapier3d/Cargo.toml b/build/rapier3d/Cargo.toml deleted file mode 100644 index 2830c07..0000000 --- a/build/rapier3d/Cargo.toml +++ /dev/null @@ -1,66 +0,0 @@ -[package] -name = "rapier3d" -version = "0.11.1" -authors = [ "Sébastien Crozet " ] -description = "3-dimensional physics engine in Rust." -documentation = "http://docs.rs/rapier3d" -homepage = "http://rapier.rs" -repository = "https://github.com/dimforge/rapier" -readme = "README.md" -categories = [ "science", "game-development", "mathematics", "simulation", "wasm"] -keywords = [ "physics", "dynamics", "rigid", "real-time", "joints" ] -license = "Apache-2.0" -edition = "2018" - -[badges] -maintenance = { status = "actively-developed" } - -[features] -default = [ "dim3", "f32", "default-sets" ] -dim3 = [ ] -f32 = [ ] -default-sets = [ ] -parallel = [ "rayon" ] -simd-stable = [ "parry3d/simd-stable", "simba/wide", "simd-is-enabled" ] -simd-nightly = [ "parry3d/simd-nightly", "simba/packed_simd", "simd-is-enabled" ] -# Do not enable this feature directly. It is automatically -# enabled with the "simd-stable" or "simd-nightly" feature. -simd-is-enabled = [ "vec_map" ] -wasm-bindgen = [ "instant/wasm-bindgen" ] -serde-serialize = [ "nalgebra/serde-serialize", "parry3d/serde-serialize", "serde", "bit-vec/serde" ] -enhanced-determinism = [ "simba/libm_force", "parry3d/enhanced-determinism" ] - -# Feature used for debugging only. -debug-disable-legitimate-fe-exceptions = [ ] - -# Feature used for development and debugging only. -# Do not enable this unless you are working on the engine internals. -dev-remove-slow-accessors = [] - -[lib] -name = "rapier3d" -path = "../../src/lib.rs" -required-features = [ "dim3", "f32" ] - - -[dependencies] -vec_map = { version = "0.8", optional = true } -instant = { version = "0.1", features = [ "now" ]} -num-traits = "0.2" -nalgebra = "0.29" -parry3d = "^0.7.1" -simba = "0.6" -approx = "0.5" -rayon = { version = "1", optional = true } -crossbeam = "0.8" -arrayvec = "0.7" -bit-vec = "0.6" -rustc-hash = "1" -serde = { version = "1", features = [ "derive" ], optional = true } -downcast-rs = "1.2" -num-derive = "0.3" -bitflags = "1" - -[dev-dependencies] -bincode = "1" -serde = { version = "1", features = [ "derive" ] } diff --git a/build/rapier_testbed2d/Cargo.toml b/build/rapier_testbed2d/Cargo.toml deleted file mode 100644 index 0ba4803..0000000 --- a/build/rapier_testbed2d/Cargo.toml +++ /dev/null @@ -1,58 +0,0 @@ -[package] -name = "rapier_testbed2d" -version = "0.11.0" -authors = [ "Sébastien Crozet " ] -description = "Testbed for the Rapier 2-dimensional physics engine in Rust." -homepage = "http://rapier.org" -repository = "https://github.com/dimforge/rapier" -categories = [ "science", "game-development", "mathematics", "simulation", "wasm"] -keywords = [ "physics", "dynamics", "rigid", "real-time", "joints" ] -license = "Apache-2.0" -edition = "2018" - -[badges] -maintenance = { status = "actively-developed" } - -[lib] -name = "rapier_testbed2d" -path = "../../src_testbed/lib.rs" -required-features = [ "dim2" ] - -[features] -default = [ "dim2" ] -dim2 = [ ] -parallel = [ "rapier2d/parallel", "num_cpus" ] -other-backends = [ "wrapped2d", "nphysics2d", "ncollide2d" ] - - -[dependencies] -nalgebra = { version = "0.29", features = [ "rand" ] } -rand = "0.8" -rand_pcg = "0.3" -instant = { version = "0.1", features = [ "web-sys", "now" ]} -bitflags = "1" -num_cpus = { version = "1", optional = true } -wrapped2d = { version = "0.4", optional = true } -parry2d = "0.7" -ncollide2d = { version = "0.32", optional = true } -nphysics2d = { version = "0.24", optional = true } -crossbeam = "0.8" -bincode = "1" -Inflector = "0.11" -md5 = "0.7" - -bevy_egui = "0.5" - -# Dependencies for native only. -[target.'cfg(not(target_arch = "wasm32"))'.dependencies] -bevy = {version = "0.5", default-features = false, features = ["bevy_wgpu", "bevy_winit", "render", "x11"]} - -# Dependencies for WASM only. -[target.'cfg(target_arch = "wasm32")'.dependencies] -bevy = {version = "0.5", default-features = false, features = ["bevy_winit", "render"]} -bevy_webgl2 = "0.5" - -[dependencies.rapier2d] -path = "../rapier2d" -version = "0.11" -features = [ "serde-serialize" ] diff --git a/build/rapier_testbed3d/Cargo.toml b/build/rapier_testbed3d/Cargo.toml deleted file mode 100644 index 1ec0084..0000000 --- a/build/rapier_testbed3d/Cargo.toml +++ /dev/null @@ -1,60 +0,0 @@ -[package] -name = "rapier_testbed3d" -version = "0.11.0" -authors = [ "Sébastien Crozet " ] -description = "Testbed for the Rapier 3-dimensional physics engine in Rust." -homepage = "http://rapier.org" -repository = "https://github.com/dimforge/rapier" -categories = [ "science", "game-development", "mathematics", "simulation", "wasm"] -keywords = [ "physics", "dynamics", "rigid", "real-time", "joints" ] -license = "Apache-2.0" -edition = "2018" - -[badges] -maintenance = { status = "actively-developed" } - -[lib] -name = "rapier_testbed3d" -path = "../../src_testbed/lib.rs" -required-features = [