Improve readability of body transmission code.
(code block mentioned in #1790) PiperOrigin-RevId: 653601254 Change-Id: Ibee727ab668b690c3b9a55c39110c6219cca17fa
This commit is contained in:
committed by
Copybara-Service
parent
231d9632cd
commit
ffb50b7b67
@@ -1168,14 +1168,18 @@ void mj_transmission(const mjModel* m, mjData* d) {
|
|||||||
for (int j=0; j < d->ncon; j++) {
|
for (int j=0; j < d->ncon; j++) {
|
||||||
const mjContact* con = d->contact+j;
|
const mjContact* con = d->contact+j;
|
||||||
|
|
||||||
|
// get geom ids
|
||||||
|
int g1 = con->geom[0];
|
||||||
|
int g2 = con->geom[1];
|
||||||
|
|
||||||
// contact involving flex, continue
|
// contact involving flex, continue
|
||||||
if (con->geom[0] < 0 || con->geom[1] < 0) {
|
if (g1 < 0 || g2 < 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// get body ids
|
// get body ids
|
||||||
int b1 = m->geom_bodyid[con->geom[0]];
|
int b1 = m->geom_bodyid[g1];
|
||||||
int b2 = m->geom_bodyid[con->geom[1]];
|
int b2 = m->geom_bodyid[g2];
|
||||||
|
|
||||||
// irrelevant contact, continue
|
// irrelevant contact, continue
|
||||||
if (b1 != id && b2 != id) {
|
if (b1 != id && b2 != id) {
|
||||||
|
|||||||
Reference in New Issue
Block a user