Reset contact efc_address in mj_clearEfc, fixes #2869

The truth is that all these solver-related values should be moved out of `mjContact` altogether, but that can be done in a future followup.

PiperOrigin-RevId: 818624976
Change-Id: I5b9e63927098cdf26b9f8acfdd9d86e75d6ce331
This commit is contained in:
Yuval Tassa
2025-10-13 06:17:41 -07:00
committed by Copybara-Service
parent 9b7e7e471d
commit bbeb0b95a7
+5
View File
@@ -75,6 +75,11 @@ static inline void mj_clearEfc(mjData* d) {
d->nefc = 0;
d->nisland = 0;
d->contact = (mjContact*) d->arena;
// if any contacts are allocated, clear their efc_address
for (int i=0; i < d->ncon; i++) {
d->contact[i].efc_address = -1;
}
}
#ifdef __cplusplus