Commit 15ed1de
committed
Fix Fabric seed for scaled parents and scaled children
_sync_fabric_from_usd_initial had two scale-related bugs in the
USD->Fabric seed path that produced silently wrong matrices whenever a
parent or child had a non-unit scale. Both kernels that recompute
world<->local consistency read those seeded matrices, so the error
propagated.
* Parent worldMatrix was composed with a hardcoded (1, 1, 1) scale.
Orthonormalize() strips scale from the local-to-world transform, so
we now extract the scale via Gf.Transform.GetScale() *before*
orthonormalizing and pass it through to the compose kernel.
* Child localMatrix was composed with the empty-array sentinel for the
scale slot, leaving the kernel-side scale at the identity default.
We now pass the locally-authored scale (already fetched via
_usd_view.get_scales()) so the matrix carries the right scale.
* Child worldMatrix is still composed from get_world_poses() position
and orientation plus the child's local scale, which is wrong when a
parent has non-unit world scale. Instead of fixing the seed by hand
(would require per-child world-scale lookups), mark the view dirty at
the end of the seed. The very next world read fires
_sync_world_from_local_if_dirty, which computes
child_world = parent_world * child_local on the GPU - and with both
matrices now correctly scaled, the multiply produces the right
world-space scale automatically.
Added test_initial_seed_with_scaled_parent regression test: parent
world scale (2, 1, 1), child local scale (3, 1, 1). Locally verified
the test fails when either fix is reverted in isolation.1 parent 7a6f3b0 commit 15ed1de
2 files changed
Lines changed: 70 additions & 9 deletions
File tree
- source/isaaclab_physx
- isaaclab_physx/sim/views
- test/sim
Lines changed: 22 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
769 | 769 | | |
770 | 770 | | |
771 | 771 | | |
772 | | - | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
773 | 776 | | |
774 | 777 | | |
775 | 778 | | |
776 | 779 | | |
777 | 780 | | |
778 | 781 | | |
779 | 782 | | |
780 | | - | |
| 783 | + | |
781 | 784 | | |
782 | 785 | | |
783 | 786 | | |
| |||
793 | 796 | | |
794 | 797 | | |
795 | 798 | | |
| 799 | + | |
| 800 | + | |
796 | 801 | | |
797 | 802 | | |
798 | 803 | | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
799 | 807 | | |
800 | 808 | | |
801 | 809 | | |
802 | 810 | | |
803 | 811 | | |
804 | 812 | | |
| 813 | + | |
805 | 814 | | |
806 | 815 | | |
807 | 816 | | |
808 | | - | |
809 | | - | |
810 | | - | |
811 | | - | |
812 | | - | |
| 817 | + | |
813 | 818 | | |
814 | 819 | | |
815 | 820 | | |
| |||
823 | 828 | | |
824 | 829 | | |
825 | 830 | | |
826 | | - | |
| 831 | + | |
827 | 832 | | |
828 | 833 | | |
829 | 834 | | |
| |||
833 | 838 | | |
834 | 839 | | |
835 | 840 | | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
836 | 849 | | |
837 | 850 | | |
838 | 851 | | |
| |||
Lines changed: 48 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
357 | 357 | | |
358 | 358 | | |
359 | 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 | + | |
0 commit comments