aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Crozet <developer@crozet.re>2021-06-02 17:15:46 +0200
committerGitHub <noreply@github.com>2021-06-02 17:15:46 +0200
commit6ba1c9dec184adcba2c68cc1851dc05587fd0bf0 (patch)
treeb672cfc4db1d2f426dad931d77098ecb4a600358
parent3bac79ecacdeaa18de19127b7a6c82cbfab29d14 (diff)
parentbde6657287cd32a801abb996322c520673406418 (diff)
downloadrapier-6ba1c9dec184adcba2c68cc1851dc05587fd0bf0.tar.gz
rapier-6ba1c9dec184adcba2c68cc1851dc05587fd0bf0.tar.bz2
rapier-6ba1c9dec184adcba2c68cc1851dc05587fd0bf0.zip
Merge pull request #196 from dimforge/api_changes
More API changes
-rw-r--r--CHANGELOG.md64
-rw-r--r--Cargo.toml3
-rw-r--r--benchmarks2d/Cargo.toml2
-rw-r--r--benchmarks2d/balls2.rs14
-rw-r--r--benchmarks2d/boxes2.rs22
-rw-r--r--benchmarks2d/capsules2.rs22
-rw-r--r--benchmarks2d/convex_polygons2.rs24
-rw-r--r--benchmarks2d/heightfield2.rs19
-rw-r--r--benchmarks2d/joint_ball2.rs14
-rw-r--r--benchmarks2d/joint_fixed2.rs18
-rw-r--r--benchmarks2d/joint_prismatic2.rs24
-rw-r--r--benchmarks2d/pyramid2.rs14
-rw-r--r--benchmarks3d/Cargo.toml2
-rw-r--r--benchmarks3d/balls3.rs12
-rw-r--r--benchmarks3d/boxes3.rs16
-rw-r--r--benchmarks3d/capsules3.rs16
-rw-r--r--benchmarks3d/ccd3.rs16
-rw-r--r--benchmarks3d/compound3.rs24
-rw-r--r--benchmarks3d/convex_polyhedron3.rs18
-rw-r--r--benchmarks3d/heightfield3.rs19
-rw-r--r--benchmarks3d/joint_ball3.rs17
-rw-r--r--benchmarks3d/joint_fixed3.rs21
-rw-r--r--benchmarks3d/joint_prismatic3.rs31
-rw-r--r--benchmarks3d/joint_revolute3.rs37
-rw-r--r--benchmarks3d/keva3.rs38
-rw-r--r--benchmarks3d/pyramid3.rs24
-rw-r--r--benchmarks3d/stacks3.rs60
-rw-r--r--benchmarks3d/trimesh3.rs19
-rw-r--r--build/rapier2d-f64/Cargo.toml10
-rw-r--r--build/rapier2d/Cargo.toml10
-rw-r--r--build/rapier3d-f64/Cargo.toml10
-rw-r--r--build/rapier3d/Cargo.toml10
-rw-r--r--build/rapier_testbed2d/Cargo.toml11
-rw-r--r--build/rapier_testbed3d/Cargo.toml11
-rw-r--r--examples2d/Cargo.toml2
-rw-r--r--examples2d/add_remove2.rs10
-rw-r--r--examples2d/ccd2.rs53
-rw-r--r--examples2d/collision_groups2.rs33
-rw-r--r--examples2d/convex_polygons2.rs24
-rw-r--r--examples2d/damping2.rs14
-rw-r--r--examples2d/debug_box_ball2.rs14
-rw-r--r--examples2d/heightfield2.rs19
-rw-r--r--examples2d/joints2.rs16
-rw-r--r--examples2d/locked_rotations2.rs18
-rw-r--r--examples2d/one_way_platforms2.rs39
-rw-r--r--examples2d/platform2.rs58
-rw-r--r--examples2d/polyline2.rs23
-rw-r--r--examples2d/pyramid2.rs14
-rw-r--r--examples2d/restitution2.rs14
-rw-r--r--examples2d/sensor2.rs41
-rw-r--r--examples2d/trimesh2.rs22
-rw-r--r--examples3d/Cargo.toml2
-rw-r--r--examples3d/ccd3.rs71
-rw-r--r--examples3d/collision_groups3.rs33
-rw-r--r--examples3d/compound3.rs32
-rw-r--r--examples3d/convex_decomposition3.rs18
-rw-r--r--examples3d/convex_polyhedron3.rs18
-rw-r--r--examples3d/damping3.rs16
-rw-r--r--examples3d/debug_add_remove_collider3.rs22
-rw-r--r--examples3d/debug_big_colliders3.rs14
-rw-r--r--examples3d/debug_boxes3.rs16
-rw-r--r--examples3d/debug_cylinder3.rs16
-rw-r--r--examples3d/debug_dynamic_collider_add3.rs28
-rw-r--r--examples3d/debug_friction3.rs16
-rw-r--r--examples3d/debug_infinite_fall3.rs18
-rw-r--r--examples3d/debug_prismatic3.rs50
-rw-r--r--examples3d/debug_rollback3.rs22
-rw-r--r--examples3d/debug_shape_modification3.rs28
-rw-r--r--examples3d/debug_triangle3.rs20
-rw-r--r--examples3d/debug_trimesh3.rs32
-rw-r--r--examples3d/domino3.rs20
-rw-r--r--examples3d/fountain3.rs14
-rw-r--r--examples3d/harness_capsules3.rs15
-rw-r--r--examples3d/heightfield3.rs23
-rw-r--r--examples3d/joints3.rs143
-rw-r--r--examples3d/keva3.rs38
-rw-r--r--examples3d/locked_rotations3.rs22
-rw-r--r--examples3d/one_way_platforms3.rs39
-rw-r--r--examples3d/platform3.rs63
-rw-r--r--examples3d/primitives3.rs16
-rw-r--r--examples3d/restitution3.rs14
-rw-r--r--examples3d/sensor3.rs40
-rw-r--r--examples3d/trimesh3.rs23
-rwxr-xr-xpublish.sh35
-rw-r--r--src/data/coarena.rs8
-rw-r--r--src/dynamics/ccd/ccd_solver.rs97
-rw-r--r--src/dynamics/ccd/toi_entry.rs26
-rw-r--r--src/dynamics/integration_parameters.rs13
-rw-r--r--src/dynamics/island_manager.rs22
-rw-r--r--src/dynamics/joint/fixed_joint.rs10
-rw-r--r--src/dynamics/rigid_body.rs204
-rw-r--r--src/dynamics/rigid_body_components.rs64
-rw-r--r--src/dynamics/solver/island_solver.rs4
-rw-r--r--src/dynamics/solver/joint_constraint/ball_position_constraint.rs8
-rw-r--r--src/dynamics/solver/joint_constraint/ball_position_constraint_wide.rs6
-rw-r--r--src/dynamics/solver/joint_constraint/fixed_position_constraint.rs40
-rw-r--r--src/dynamics/solver/joint_constraint/fixed_velocity_constraint.rs12
-rw-r--r--src/dynamics/solver/joint_constraint/fixed_velocity_constraint_wide.rs24
-rw-r--r--src/dynamics/solver/joint_constraint/generic_position_constraint.rs6
-rw-r--r--src/dynamics/solver/joint_constraint/revolute_position_constraint.rs6
-rw-r--r--src/dynamics/solver/parallel_island_solver.rs2
-rw-r--r--src/geometry/broad_phase_multi_sap/broad_phase.rs4
-rw-r--r--src/geometry/collider.rs266
-rw-r--r--src/geometry/collider_components.rs171
-rw-r--r--src/geometry/collider_set.rs58
-rw-r--r--src/geometry/contact_pair.rs16
-rw-r--r--src/geometry/interaction_groups.rs54
-rw-r--r--src/geometry/narrow_phase.rs328
-rw-r--r--src/lib.rs9
-rw-r--r--src/pipeline/collision_pipeline.rs10
-rw-r--r--src/pipeline/event_handler.rs25
-rw-r--r--src/pipeline/mod.rs6
-rw-r--r--src/pipeline/physics_hooks.rs69
-rw-r--r--src/pipeline/physics_pipeline.rs56
-rw-r--r--src/pipeline/query_pipeline.rs42
-rw-r--r--src/pipeline/user_changes.rs3
-rw-r--r--src_testbed/box2d_backend.rs25
-rw-r--r--src_testbed/camera2d.rs (renamed from src_testbed/camera.rs)1
-rw-r--r--src_testbed/camera3d.rs121
-rw-r--r--src_testbed/graphics.rs65
-rw-r--r--src_testbed/lib.rs5
-rw-r--r--src_testbed/nphysics_backend.rs36
-rw-r--r--src_testbed/objects/node.rs14
-rw-r--r--src_testbed/physx_backend.rs45
-rw-r--r--src_testbed/testbed.rs29
125 files changed, 2421 insertions, 1652 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2d3dcf9..52f5a35 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,7 +1,71 @@
## v0.9.0
+The user-guide has been fully rewritten and is now exhaustive! Check it out on [rapier.rs](https://rapier.rs/)
+
+### Added
+- A prelude has been added in order to simplify the most common imports. For example: `use rapier3d::prelude::*`
+- Add `RigidBody::set_translation` and `RigidBody.translation()`.
+- Add `RigidBody::set_rotation` and `RigidBody.rotation().
+- Add `RigidBody::set_next_translation` for setting the next translation of a position-based kinematic body.
+- Add `RigidBody::set_next_rotation` for setting the next rotation of a position-based kinematic body.
+- Add kinematic bodies controlled at the velocity level: use `RigidBodyBuilder::new_kinematic_velocity_based` or
+ `RigidBodyType::KinematicVelocityBased`.
### Modified
+The use of `RigidBodySet, ColliderSet, RigidBody, Collider` is no longer mandatory. Rigid-bodies and colliders have
+been split into multiple components that can be stored in a user-defined set. This is useful for integrating Rapier
+with other engines (for example this allows use to use Bevy's Query as our rigid-body/collider sets).
+
+The `RigidBodySet, ColliderSet, RigidBody, Collider` are still the best option for whoever doesn't want to
+provide their own component sets.
+
+#### Rigid-bodies
- Renamed `BodyStatus` to `RigidBodyType`.
+- `RigidBodyBuilder::translation` now takes a vector instead of individual components.
+- `RigidBodyBuilder::linvel` now takes a vector instead of individual components.
+- The `RigidBodyBuilder::new_kinematic` has be replaced by the `RigidBodyBuilder::new_kinematic_position_based` and
+ `RigidBodyBuilder::new_kinematic_velocity_based` constructors.
+- The `RigidBodyType::Kinematic` variant has been replaced by two variants: `RigidBodyType::KinematicVelocityBased` and
+ `RigidBodyType::KinematicPositionBased`.
+
+#### Colliders
+- `Colliderbuilder::translation` now takes a vector instead of individual components.
+- The way `PhysicsHooks` are enabled changed. Now, a physics hooks is executed if any of the two
+ colliders involved in the contact/intersection pair contains the related `PhysicsHooksFlag`.
+ These flags are configured on each collider with `ColliderBuilder::active_hooks`. As a result,
+ there is no `PhysicsHooks::active_hooks` method any more.
+- All events are now disabled for all colliders by default. Enable events for specific colliders by setting its
+ `active_events` bit mask to `ActiveEvents::CONTACT_EVENTS` and/or `ActiveEvents::PROXIMITY_EVENTS`.
+- Add a simpler way of enabling collision-detection between colliders attached to two non-dynamic rigid-bodies: see
+ `ColliderBuilder::active_collision_types`.
+- The `InteractionGroups` is now a structures with two `u32` integers: one integers for the groups
+ membership and one for the group filter mask. (Before, both were only 16-bits wide, and were
+ packed into a single `u32`).
+- Before, sensor colliders had a default density set to 0.0 whereas non-sensor colliders had a
+ default density of 1.0. This has been unified by setting the default density to 1.0 for both
+ sensor and non-sensor colliders.
+- Colliders are no longer required to be attached to a rigid-body. Therefore, `ColliderSet::insert`
+ only takes the collider as argument now. In order to attach the collider to a rigid-body,
+ (i.e., the old behavior of `ColliderSet::insert`), use `ColliderSet::insert_with_parent`.
+- Fixed a bug where collision groups were ignored by CCD.
+
+#### Joints
+- The fields `FixedJoint::local_anchor1` and `FixedJoint::local_anchor2` have been renamed to