aboutsummaryrefslogtreecommitdiff
path: root/CHANGELOG.md
blob: 5893994e3263a79558fb71239fadd8c0fe0c7fb1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
## v0.23.0 (08 Jan 2024)

### Fix

- The broad-phase region key has been replaced by an i64 in the f64 version of rapier, increasing the range before panics occur.
- Fix `BroadphaseMultiSap` not being able to serialize correctly with serde_json.
- Fix `KinematicCharacterController::move_shape` not respecting parameters `max_slope_climb_angle` and `min_slope_slide_angle`.
- Improve ground detection reliability for `KinematicCharacterController`. (#715)
- Fix wasm32 default values for physics hooks filter to be consistent with native: `COMPUTE_IMPULSES`.

### Added

- `RigidBodySet` and `ColliderSet` have a new constructor `with_capacity`.
- Use `profiling` crate to provide helpful profiling information in different tools.
  - The testbeds have been updated to use `puffin_egui`

### Modified

- `InteractionGroups` default value for `memberships` is now `GROUP_1` (#706)
- `ImpulseJointSet::get_mut` has a new parameter `wake_up: bool`, to wake up connected bodies.
- Removed unmaintained `instant` in favor of `web-time`. This effectively removes the `wasm-bindgen` transitive dependency as it's no longer needed.
- Significantly improve performances of `QueryPipeline::intersection_with_shape`.

## v0.22.0 (20 July 2024)

### Fix

- Fix crash when removing a multibody joint, or a rigid-body with a multipody-joint attached to it.
- Fix crash when inserting multibody joints in an arbitrary order (instead of incrementally from root to leaf).
- Fix `BroadphaseMultiSap` not being able to serialize a field with serde_json.

### Added

- Implement rotation gizmo for Ball 2D shape (as radius line) in Debug renderer if `DebugRenderMode::COLLIDER_SHAPES`
  enabled
- Implement `Debug` for `ColliderSet`, `InteractionGraph`,
  `MultibodyLink`, `MultibodyJointSet`, `Multibody`, `ImpulseJointSet`

### Modified

- Update parry to v0.17. Refer to [its changelog](https://github.com/dimforge/parry/blob/master/CHANGELOG.md#v0170) for
  further details.
- Divided by two the value of each `QueryFilterFlags` variant so that
  the smallest one is 1 instead of 2 (fixes a bug in rapier.js).
- `BroadphaseMultiSap` now serializes its `colliders_proxy_ids` as `Vec[(ColliderHandle, BroadPhaseProxyIndex)]`.

## v0.21.0 (23 June 2024)

### Fix

- Fix `NaN` values appearing in bodies translation and rotation after a simulation step with a delta time equal to
  0 ([#660](https://github.com/dimforge/rapier/pull/660)).
- Fix crash in the SAP broad-phase when teleporting an object.

### Modified

- Update to `nalgebra` 0.33 and `parry` 0.16.
- `solve_character_collision_impulses` collisions parameter is now an iterator over references.

## v0.20.0 (9 June 2024)

This release introduces two new crates:

- `rapier3d-urdf` for loading URDF files into rapier3d. This will load the rigid-bodies,
  colliders, and joints.
- `rapier3d-stl` for loading an STL file as a collision shape.

### Added

- Add `Multibody::inverse_kinematics`, `Multibody::inverse_kinematics_delta`,
  and `::inverse_kinematics_delta_with_jacobian`
  for running inverse kinematics on a multibody to align one its links pose to the given prescribed pose.
- Add `InverseKinematicsOption` to customize some behaviors of the inverse-kinematics solver.
- Add `Multibody::body_jacobian` to get the jacobian of a specific link.
- Add `Multibody::update_rigid_bodies` to update rigid-bodies based on the multibody links poses.
- Add `Multibody::forward_kinematics_single_link` to run forward-kinematics to compute the new pose and jacobian of a
  single link without mutating the multibody. This can take an optional displacement on generalized coordinates that are
  taken into account during transform propagation.
- Implement `Debug` for `ColliderBuilder`.
- Add `Collider::converted_trimesh` and `MeshConverter` for building a collider with a shape computed from a mesh’s
  index and vertex buffers. That computed shape can currently be a `TriMesh`, a `Cuboid` (covering the mesh’s AABB or
  OBB), a convex hull, or a convex decomposition.
- Implement `Default` for `RigidBodyBuilder`. This is equivalent to `RigidBodyBuilder::dynamic()`.
- Implement `Default` for `ColliderBuilder`. This is equivalent to `ColliderBuilder::ball(0.5)`.
- Add `RevoluteJoint::angle` to compute the joint’s angle given the rotation of its attached rigid-bodies.

### Modified

- Renamed `JointAxesMask::X/Y/Z` to `::LIN_X/LIN_Y/LIN_Z`; and renamed `JointAxisMask::X/Y/Z` to `::LinX/LinY/LynZ` to
  make it clear it is not to be used as angular axes (the angular axis are `JointAxesMask::ANG_X/ANG_Y/AngZ` and
  `JointAxisMask::AngX/AngY/AngZ`).
- The contact constraints regularization parameters have been changed from `erp/damping_ratio` to
  `natural_frequency/damping_ratio`. This helps define them in a timestep-length independent way. The new variables
  are named `IntegrationParameters::contact_natural_frequency` and `IntegrationParameters::contact_damping_ratio`.
- The `IntegrationParameters::normalized_max_penetration_correction` has been replaced
  by `::normalized_max_corrective_velocity`
  to make the parameter more timestep-length independent. It is now set to a non-infinite value to eliminate aggressive
  "popping effects".
- The `Multibody::forward_kinematics` method will no longer automatically update the poses of the `RigidBody` associated
  to each joint. Instead `Multibody::update_rigid_bodies` has to be called explicitly.
- The `Multibody::forward_kinematics` method will automatically adjust the multibody’s degrees of freedom if the root
  rigid-body changed type (between dynamic and non-dynamic). It can also optionally apply the root’s rigid-body pose
  instead of the root link’s pose (useful for example if you modified the root rigid-body pose externally and wanted
  to propagate it to the multibody).
- Remove an internal special-case for contact constraints on fast contacts. The doesn’t seem necessary with the substep
  solver.
- Remove `RigidBody::add_collider`. This was an implementation detail previously needed by `bevy_rapier`. To attach
  a collider to a rigid-body, use `ColliderSet::insert_with_parent` or `ColliderSet::set_parent`.
- Rename `JointAxis::X/Y/Z` to `::LinX/LinY/LinZ` to avoid confusing it with `::AngX/AngY/AngZ`.
- Rename `JointAxesMask::X/Y/Z` to `::LIN_X/LIN_Y/LIN_Z` to avoid confusing it with `::ANG_X/ANG_Y/ANG_Z`.
- The function `RigidBody::add_collider` is now private. It was only public because it was needed for some internal
  `bevy_rapier` plumbings, but it is no longer useful. Adding a collider must always go through the `ColliderSet`.
- `CharacterController::solve_character_collision_impulses` now takes multiple `CharacterCollision` as parameter:
  this change will allow further internal optimizations.
- `QueryPipeline::update` now doesn't need the `RigidBodySet` as parameter.
- Removed `QueryPipelineMode`.
- `QueryPipeline::update_with_mode` was renamed to `::update_with_generator` and now takes
  `impl QbvhDataGenerator<ColliderHandle>` as parameter see [`QueryPipeline::updaters`] module for more information.

## v0.19.0 (05 May 2024)

### Fix

- Fix crash when simulating a spring joint between two dynamic bodies.
- Fix kinematic bodies not being affected by gravity after being switched back to dynamic.
- Fix regression on contact force reporting from contact force events.
- Fix kinematic character controller getting stuck against vertical walls.
- Fix joint limits/motors occasionally not being applied properly when one of the attached
  rigid-bodies is fixed.
- Fix an issue where contacts would be completely ignored between two convex shapes.

### Added

**Many stability improvements were added as part of this release. To see illustrations of some of these
changes, see [#625](https://github.com/dimforge/rapier/pull/625).**

- Add `RigidBody::predict_position_using_velocity` to predict the next position of the rigid-body
  based only on its current velocity.
- Add `Collider::copy_from` to copy most collider attributes to an existing collider.
- Add `RigidBody::copy_from` to copy most rigid-body attributes to an existing rigid-body.
- Add the `BroadPhase` trait and expect an implementor of this trait as input to `PhysicsPipeline::step`.
- Implement a 2D block-solver as well as warmstarting. Significantly improves stacking capabilities. Generally reduces
  the "pop" effect that can happen due to penetration corrections.
- Add `RigidBodyBuilder::soft_ccd_prediction` and `RigidBody::set_soft_ccd_prediction` to enable `soft-ccd`: a form of
  CCD based on predictive contacts. This is helpful for objects moving moderately fast. This form of CCD is generally
  cheaper than the normal (time-dropping) CCD implemented so far. It is possible to combine both soft-ccd and
  time-dropping ccd.
- Add a `ColliderBuilder::contact_skin`, `Collider::set_contact_skin`, and `Collider::contact_skin`. This forces the
  solver te maintain a gap between colliders with non-zero contact skin, as if they had a slight margin around them.
  This helps performance and stability for thin objects (like triangle meshes).
- Internal edges were reworked to avoid dropping contacts that would help with stability, and improve stability of
  collisions between two triangle meshes. The `TriMeshFlags::FIX_INTERNAL_EDGES` and
  `HeightFieldFlags::FIX_INTERNAL_EDGES` flags were added to enable internal edges handling.
- Add `IntegrationParameters::length_units` to automatically adjust internal thresholds when the user relies on custom
  length units (e.g. pixels in 2D).

### Modified

**Many shape-casting related functions/structs were renamed. Check out the CHANGELOG for parry 0.15.0 for
additional details.**

- Renamed `BroadPhase` to `BroadPhaseMultiSap`. The `BroadPhase` is now a trait that can be
  implemented for providing a custom broad-phase to rapier. Equivalently, the `DefaultBroadPhase` type
  alias can be used in place of `BroadPhaseMultiSap`.
- The kinematic character controller autostepping is now disabled by default.
- Add `KinematicCharacterController::normal_nudge_factor` used to help getting the character unstuck
  due to rounding errors.
- Rename `TOI` to `ShapeCastHit`.
- Rename many fields from `toi` to `time_of_impact`.
- The `QueryPipeline::cast_shape` method now takes a `ShapeCastOptions` instead of the `max_toi`
  and `stop_at_penetration` parameters. This allows a couple of extra configurations, including the
  ability to have the shape-cast target a specific distance instead of actual shape overlap.

## v0.18.0 (24 Jan. 2024)

The main highlight of this release is the implementation of a new non-linear constraints solver for better stability
and increased convergence rates. See [#579](https://github.com/dimforge/rapier/pull/579) for additional information.

In order to adjust the number of iterations of the new solver, simply
adjust `IntegrationParameters::num_solver_iterations`.
If recovering the old solver behavior is useful to you, call `IntegrationParameters::switch_to_standard_pgs_solver()`.

It is now possible to specify some additional solver iteration for specific rigid-bodies (and everything interacting
with it directly or indirectly through contacts and joints): `RigidBodyBuilder::additional_solver_iterations` and
`RigidBodyBuilder::set_additional_solver_iterations`. This allows for higher-accuracy on subsets of the physics scene
without affecting performance of the other parts of the simulation.

### Fix

- Fix bug causing angular joint limits and motor to sometimes only take into account half of the angles specified by the
  user.
- Fix bug where collisions would not be re-computed after a collider was re-enabled.

### Added

- Add a `SpringJoint` and `SpringJointBuilder` for simulating springs with customizable stiffness and damping
  coefficients.
- Add `SphericalJoint::local_frame1/2`, `::set_local_frame1/2`, and `SphericalJointBuilder::local_frame1/2` to set both
  the joint’s anchor and reference orientation.
- Add `EffectiveCharacterMovement::is_sliding_down_slope` to indicate if the character controlled by the kinematic
  character controller is sliding on a slope that is too steep.
- Add `Wheel::side_friction_stiffness` to customize the side friction applied to the vehicle controller’s wheel.
- Add `Wheel::raycast_info` to access more wheel information relative to the ground.
- Add `DebugRenderStyle::disabled_color_multiplier` to make the debug-renderer color disabled object differently.
- Fix incorrect update of angular degrees-of-freedoms on spherical multibody joints.
- Fix debug-renderer showing moved kinematic rigid-bodies only at their initial position.

### Modified

- Make `Wheel::friction_slip` public to customize the front friction applied to the vehicle controller’s wheels.
- Add the `DebugRenderBackend::filter_object` predicate that can be implemented to apply custom filtering rules
  on the objects being rendered.
- Switch the testbed to `bevy 0.12` and use its new Gizmos API for rendering lines.
- Rename `NarrowPhase::contacts_with` to `NarrowPhase::contact_pairs_with`.
- Rename `NarrowPhase::intersections_with` to `NarrowPhase::intersection_pairs_with`.

## v0.17.2 (26 Feb. 2023)

### Fix

- Fix issue with convex polyhedron jitter due to missing contacts.
- Fix character controller getting stuck against vertical walls.
- Fix character controller’s snapping to ground not triggering sometimes.
- Fix character controller’s horizontal offset being mostly ignored and some instances of vertical offset being ignored.

## v0.17.1 (22 Jan. 2023)

### Fix

- Fix bug resulting in dynamic rigid-bodies acting as kinematic bodies after being disabled and then re-enabled.

## v0.17.0 (15 Jan. 2023)

### Added

- Add `RigidBody::set_enabled`, `RigidBody::is_enabled`, `RigidBodyBuilder::enabled` to enable/disable a rigid-body
  without having to delete it. Disabling a rigid-body attached to a multibody joint isn’t supported yet.
- Add `Collider::set_enabled`, `Collider::is_enabled`, `ColliderBuilder::enabled` to enable/disable a collider
  without having to delete it.
- Add `GenericJoint::set_enabled`, `GenericJoint::is_enabled` to enable/disable a joint without having to delete it.
  Disabling a multibody joint isn’t supported yet.
- Add `DynamicRayCastVehicleController`, a vehicle controller based on ray-casting and dynamic rigid-bodies (mostly
  a port of the vehicle controller from Bullet physics).
- Add `RigidBody::user_force` and `RigidBody::user_torque` to read the forces or torques added by the user to a
  dynamic rigid-body.
- Add `RigidBody::locked_axes` to get the rigid-body axes that were locked by the user.

### Modified

- Add the `QueryPipeline` as an optional argument to `PhysicsPipeline::step` and `CollisionPipeline::step`. If this
  argument is specified, then the query pipeline will be incrementally (i.e. more efficiently) update at the same time
  as
  these other pipelines. In that case, calling `QueryPipeline::update` a `PhysicsPipeline::step` isn’t needed.
- `RigidBody::set_body_type` now takes an extra boolean argument indicating if the rigid-body should be woken-up
  (if it becomes dynamic).
- `RigidBody::mass_properties` now also returns the world-space mass-properties of the rigid-body.

### Fix

- Fix bug resulting in rigid-bodies being awakened after they are created, even if they are created sleeping.

## v0.16.1 (10 Nov. 2022)

### Fix

- Fixed docs build on `docs.rs`.

## v0.16.0 (30 Oct. 2022)

### Added

- Implement `Copy` for `CharacterCollision`.
- Implement conversion (`From` trait) between `Group` and `u32`.
- Add `ColliderBuilder::trimesh_with_flags` to build a triangle mesh with specific flags controlling
  its initialization.

### Modified

- Rename `AABB` to `Aabb` to comply with Rust’s style guide.
- Switch to `parry 0.11`.

### Fix

- Fix internal edges of 3D triangle meshes or 3D heightfields generating invalid contacts preventing
  balls from moving straight.

## v0.15.0 (02 Oct. 2022)

### Added

- Add a **kinematic character** controller implementation. See the `control` module. The character controller currently
  supports the following features:
    - Slide on uneven terrains
    - Interaction with dynamic bodies.
    - Climb stairs automatically.
    - Automatically snap the body to the floor when going downstairs.
    - Prevent sliding up slopes that are too steep
    - Prevent sliding down slopes that are not steep enough
    - Int