aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/rapier-ci-bench.yml4
-rw-r--r--CHANGELOG31
-rw-r--r--Cargo.toml5
-rw-r--r--benchmarks2d/Cargo.toml2
-rw-r--r--benchmarks3d/Cargo.toml2
-rw-r--r--build/rapier2d/Cargo.toml19
-rw-r--r--build/rapier3d/Cargo.toml19
-rw-r--r--build/rapier_testbed2d/Cargo.toml14
-rw-r--r--build/rapier_testbed3d/Cargo.toml18
-rw-r--r--examples2d/Cargo.toml2
-rw-r--r--examples2d/all_examples2.rs6
-rw-r--r--examples2d/collision_groups2.rs98
-rw-r--r--examples2d/damping2.rs45
-rw-r--r--examples2d/restitution2.rs56
-rw-r--r--examples3d/Cargo.toml2
-rw-r--r--examples3d/all_examples3.rs10
-rw-r--r--examples3d/collision_groups3.rs102
-rw-r--r--examples3d/damping3.rs45
-rw-r--r--examples3d/debug_boxes3.rs32
-rw-r--r--examples3d/debug_cylinder3.rs65
-rw-r--r--examples3d/debug_infinite_fall3.rs32
-rw-r--r--examples3d/heightfield3.rs18
-rw-r--r--examples3d/primitives3.rs27
-rw-r--r--examples3d/restitution3.rs56
-rw-r--r--examples3d/trimesh3.rs18
-rw-r--r--src/data/graph.rs10
-rw-r--r--src/data/hashmap.rs137
-rw-r--r--src/data/maybe_serializable_data.rs17
-rw-r--r--src/data/mod.rs4
-rw-r--r--src/data/pubsub.rs3
-rw-r--r--src/dynamics/joint/joint.rs1
-rw-r--r--src/dynamics/joint/joint_set.rs32
-rw-r--r--src/dynamics/mass_properties.rs23
-rw-r--r--src/dynamics/mass_properties_capsule.rs23
-rw-r--r--src/dynamics/mass_properties_cone.rs29
-rw-r--r--src/dynamics/mass_properties_cylinder.rs40
-rw-r--r--src/dynamics/mass_properties_polygon.rs2
-rw-r--r--src/dynamics/mod.rs3
-rw-r--r--src/dynamics/rigid_body.rs107
-rw-r--r--src/dynamics/rigid_body_set.rs7
-rw-r--r--src/dynamics/solver/velocity_constraint.rs9
-rw-r--r--src/dynamics/solver/velocity_constraint_wide.rs11
-rw-r--r--src/dynamics/solver/velocity_ground_constraint.rs12
-rw-r--r--src/dynamics/solver/velocity_ground_constraint_wide.rs12
-rw-r--r--src/geometry/broad_phase_multi_sap.rs150
-rw-r--r--src/geometry/capsule.rs86
-rw-r--r--src/geometry/collider.rs449
-rw-r--r--src/geometry/collider_set.rs5
-rw-r--r--src/geometry/contact.rs66
-rw-r--r--src/geometry/contact_generator/ball_ball_contact_generator.rs9
-rw-r--r--src/geometry/contact_generator/ball_convex_contact_generator.rs23
-rw-r--r--src/geometry/contact_generator/capsule_capsule_contact_generator.rs39
-rw-r--r--src/geometry/contact_generator/contact_dispatcher.rs106
-rw-r--r--src/geometry/contact_generator/contact_generator.rs30
-rw-r--r--src/geometry/contact_generator/contact_generator_workspace.rs104
-rw-r--r--src/geometry/contact_generator/cuboid_capsule_contact_generator.rs11
-rw-r--r--src/geometry/contact_generator/cuboid_cuboid_contact_generator.rs4
-rw-r--r--src/geometry/contact_generator/cuboid_triangle_contact_generator.rs8
-rw-r--r--src/geometry/contact_generator/heightfield_shape_contact_generator.rs128
-rw-r--r--src/geometry/contact_generator/mod.rs18
-rw-r--r--src/geometry/contact_generator/pfm_pfm_contact_generator.rs144
-rw-r--r--src/geometry/contact_generator/polygon_polygon_contact_generator.rs35
-rw-r--r--src/geometry/contact_generator/serializable_workspace_tag.rs9
-rw-r--r--src/geometry/contact_generator/trimesh_shape_contact_generator.rs42
-rw-r--r--src/geometry/interaction_graph.rs1
-rw-r--r--src/geometry/interaction_groups.rs60
-rw-r--r--src/geometry/mod.rs33
-rw-r--r--src/geometry/narrow_phase.rs227
-rw-r--r--src/geometry/polygon.rs2
-rw-r--r--src/geometry/polygonal_feature_map.rs132
-rw-r--r--src/geometry/polyhedron_feature3d.rs169
-rw-r--r--src/geometry/proximity.rs12
-rw-r--r--src/geometry/proximity_detector/ball_convex_proximity_detector.rs20
-rw-r--r--src/geometry/proximity_detector/cuboid_cuboid_proximity_detector.rs4
-rw-r--r--src/geometry/proximity_detector/cuboid_triangle_proximity_detector.rs8
-rw-r--r--src/geometry/proximity_detector/polygon_polygon_proximity_detector.rs29
-rw-r--r--src/geometry/proximity_detector/proximity_detector.rs8
-rw-r--r--src/geometry/proximity_detector/proximity_dispatcher.rs40
-rw-r--r--src/geometry/proximity_detector/trimesh_shape_proximity_detector.rs11
-rw-r--r--src/geometry/round_cylinder.rs107
-rw-r--r--src/geometry/sat.rs105
-rw-r--r--src/geometry/shape.rs390
-rw-r--r--src/geometry/trimesh.rs45
-rw-r--r--src/geometry/user_callbacks.rs57
-rw-r--r--src/geometry/wquadtree.rs33
-rw-r--r--src/lib.rs1
-rw-r--r--src/pipeline/collision_pipeline.rs23
-rw-r--r--src/pipeline/physics_pipeline.rs11
-rw-r--r--src/pipeline/query_pipeline.rs36
-rw-r--r--src/utils.rs134
-rw-r--r--src_testbed/box2d_backend.rs78
-rw-r--r--src_testbed/engine.rs96
-rw-r--r--src_testbed/nphysics_backend.rs53
-rw-r--r--src_testbed/objects/cone.rs74
-rw-r--r--src_testbed/objects/cylinder.rs74
-rw-r--r--src_testbed/objects/mod.rs2
-rw-r--r--src_testbed/objects/node.rs18
-rw-r--r--src_testbed/physx_backend.rs45
-rw-r--r--src_testbed/testbed.rs48
99 files changed, 3757 insertions, 1105 deletions
diff --git a/.github/workflows/rapier-ci-bench.yml b/.github/workflows/rapier-ci-bench.yml
index 9cce1b2..6c4f007 100644
--- a/.github/workflows/rapier-ci-bench.yml
+++ b/.github/workflows/rapier-ci-bench.yml
@@ -18,15 +18,17 @@ jobs:
BENCHBOT_TARGET_COMMIT: ${{ github.event.pull_request.head.sha }}
BENCHBOT_SHA: ${{ github.sha }}
BENCHBOT_HEAD_REF: ${{github.head_ref}}
+ BENCHBOT_OTHER_BACKENDS: false
runs-on: ubuntu-latest
steps:
- name: Find commit SHA
if: github.ref == 'refs/heads/master'
run: |
echo "::set-env name=BENCHBOT_TARGET_COMMIT::$BENCHBOT_SHA"
+ echo "::set-env name=BENCHBOT_OTHER_BACKENDS::true"
- name: Send 3D bench message
shell: bash
run: curl -u $BENCHBOT_AMQP_USER:$BENCHBOT_AMQP_PASS
-i -H "content-type:application/json" -X POST
https://$BENCHBOT_AMQP_HOST/api/exchanges/$BENCHBOT_AMQP_VHOST//publish
- -d'{"properties":{},"routing_key":"benchmark","payload":"{ \"repository\":\"https://github.com/'$BENCHBOT_TARGET_REPO'\", \"branch\":\"'$GITHUB_REF'\", \"commit\":\"'$BENCHBOT_TARGET_COMMIT'\" }","payload_encoding":"string"}' \ No newline at end of file
+ -d'{"properties":{},"routing_key":"benchmark","payload":"{ \"repository\":\"https://github.com/'$BENCHBOT_TARGET_REPO'\", \"branch\":\"'$GITHUB_REF'\", \"commit\":\"'$BENCHBOT_TARGET_COMMIT'\", \"other_backends\":'$BENCHBOT_OTHER_BACKENDS' }","payload_encoding":"string"}' \ No newline at end of file
diff --git a/CHANGELOG b/CHANGELOG
index 70b20e5..4d3e5b6 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,33 @@
-## v0.2.0 - WIP
+## v0.3.2
+- Add linear and angular damping. The damping factor can be set with `RigidBodyBuilder::linear_damping` and
+ `RigidBodyBuilder::angular_damping`.
+- Implement `Clone` for almost everything that can be worth cloning.
+- Allow setting the initial mass and mass properties of a rigid-bodies using `RigidBodyBuilder::mass` and
+ `RigidBodyBuilder::mass_properties`.
+- The restitution coefficient of colliders is now taken into account by the physics solver.
+
+## v0.3.1
+- Fix non-determinism problem when using triangle-meshes, cone, cylinders, or capsules.
+- Add `JointSet::remove(...)` to remove a joint from the `JointSet`.
+
+## v0.3.0
+- Collider shapes are now trait-objects instead of a `Shape` enum.
+- Add a user-defined `u128` to each colliders and rigid-bodies for storing user data.
+- Add the support for `Cylinder`, `RoundCylinder`, and `Cone` shapes.
+- Added the support for collision filtering based on bit masks (often known as collision groups, collision masks, or
+ collision layers in other physics engines). Each collider has two groups. Their `collision_groups` is used for filtering
+ what pair of colliders should have their contacts computed by the narrow-phase. Their `solver_groups` is used for filtering
+ what pair of colliders should have their contact forces computed by the constraints solver.
+- Collision groups can also be used to filter what collider should be hit by a ray-cast performed by the `QueryPipeline`.
+- Added collision filters based on user-defined trait-objects. This adds two traits `ContactPairFilter` and
+ `ProximityPairFilter` that allows user-defined logic for determining if two colliders/sensors are allowed to interact.
+- The `PhysicsPipeline::step` method now takes two additional arguments: the optional `&ContactPairFilter` and `&ProximityPairFilter`
+for filtering contact and proximity pairs.
+
+## v0.2.1
+- Fix panic in TriMesh construction and QueryPipeline update caused by a stack overflow or a subtraction underflow.
+
+## v0.2.0
The most significant change on this version is the addition of the `QueryPipeline` responsible for performing
scene-wide queries. So far only ray-casting has been implemented.
diff --git a/Cargo.toml b/Cargo.toml
index 944fa40..cfb166a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -5,6 +5,11 @@ members = [ "build/rapier2d", "build/rapier_testbed2d", "examples2d", "benchmark
[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" }
[profile.release]
#debug = true
diff --git a/benchmarks2d/Cargo.toml b/benchmarks2d/Cargo.toml
index b1ee8db..90a6326 100644
--- a/benchmarks2d/Cargo.toml
+++ b/benchmarks2d/Cargo.toml
@@ -14,7 +14,7 @@ enhanced-determinism = [ "rapier2d/enhanced-determinism" ]
[dependencies]
rand = "0.7"
Inflector = "0.11"
-nalgebra = "0.22"
+nalgebra = "0.23"
[dependencies.rapier_testbed2d]
path = "../build/rapier_testbed2d"
diff --git a/benchmarks3d/Cargo.toml b/benchmarks3d/Cargo.toml
index 81c843a..03194df 100644
--- a/benchmarks3d/Cargo.toml
+++ b/benchmarks3d/Cargo.toml
@@ -14,7 +14,7 @@ enhanced-determinism = [ "rapier3d/enhanced-determinism" ]
[dependencies]
rand = "0.7"
Inflector = "0.11"
-nalgebra = "0.22"
+nalgebra = "0.23"
[dependencies.rapier_testbed3d]
path = "../build/rapier_testbed3d"
diff --git a/build/rapier2d/Cargo.toml b/build/rapier2d/Cargo.toml
index ff5253b..1c24a5d 100644
--- a/build/rapier2d/Cargo.toml
+++ b/build/rapier2d/Cargo.toml
@@ -1,7 +1,6 @@
-# Name idea: bident for 2D and trident for 3D
[package]
name = "rapier2d"
-version = "0.2.0"
+version = "0.3.2"
authors = [ "Sébastien Crozet <developer@crozet.re>" ]
description = "2-dimensional physics engine in Rust."
documentation = "http://docs.rs/rapier2d"
@@ -22,7 +21,7 @@ simd-nightly = [ "simba/packed_simd", "simd-is-enabled" ]
# enabled with the "simd-stable" or "simd-nightly" feature.
simd-is-enabled = [ ]
wasm-bindgen = [ "instant/wasm-bindgen" ]
-serde-serialize = [ "nalgebra/serde-serialize", "ncollide2d/serde-serialize", "serde", "generational-arena/serde", "bit-vec/serde", "arrayvec/serde" ]
+serde-serialize = [ "erased-serde", "nalgebra/serde-serialize", "ncollide2d/serde-serialize", "serde", "generational-arena/serde", "bit-vec/serde", "arrayvec/serde" ]
enhanced-determinism = [ "simba/libm_force", "indexmap" ]
[lib]
@@ -35,18 +34,22 @@ required-features = [ "dim2" ]
vec_map = "0.8"
instant = { version = "0.1", features = [ "now" ]}
num-traits = "0.2"
-nalgebra =