Commit fc1cd60
Add system that asserts physics components are finite (avianphysics#909)
A lot of people (me included) have had to track down NaNs or infinities that causes avian internals to crash, and they can be difficult to track down because they cause crashes a lot later than they are introduced.
Add a system when running with debug assertions that checks relevant components during `PhysicsSystems::First`.
For bugs in Avian internals we can potentially also schedule this system in other places.
* I placed it in `PhysicsSchedulePlugin` because it feels more general purpose than the rest of `PhysicsDebugPlugin` and because it needs `self.schedule`, but I'm not sure if that's the best location for it?
* We could make the system use `assert!` instead of `debug_assert!` and make it runnable outside of `debug_assertions`?
I modified one of the examples to introduce an infinity during Update and saw that it was caught.
Added mass query data accessor.1 parent 73c0e0d commit fc1cd60
1 file changed
+19
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
125 | 124 | | |
126 | 125 | | |
127 | 126 | | |
| |||
213 | 212 | | |
214 | 213 | | |
215 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
216 | 221 | | |
217 | 222 | | |
218 | 223 | | |
| |||
593 | 598 | | |
594 | 599 | | |
595 | 600 | | |
| 601 | + | |
596 | 602 | | |
597 | 603 | | |
598 | 604 | | |
| |||
630 | 636 | | |
631 | 637 | | |
632 | 638 | | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
633 | 643 | | |
634 | 644 | | |
635 | 645 | | |
| |||
711 | 721 | | |
712 | 722 | | |
713 | 723 | | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
714 | 728 | | |
715 | 729 | | |
716 | 730 | | |
| |||
746 | 760 | | |
747 | 761 | | |
748 | 762 | | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
749 | 767 | | |
750 | 768 | | |
751 | 769 | | |
| |||
0 commit comments