Add height fields to list of discrete objects in NativeCCD.

PiperOrigin-RevId: 676452215
Change-Id: I5d6a0d1e26ee852c774b44f550c1d0531b7a269b
This commit is contained in:
Kyle Bayes
2024-09-19 09:47:40 -07:00
committed by Copybara-Service
parent 4998e7b392
commit 7a92423cf2
4 changed files with 31 additions and 25 deletions
+4 -7
View File
@@ -92,13 +92,10 @@ static int discreteGeoms(mjCCDObj* obj1, mjCCDObj* obj2) {
// non-zero margin makes geoms smooth
if (obj1->margin != 0 || obj2->margin != 0) return 0;
// negative geom indices correspond to flex objects, return
if (obj1->geom < 0 || obj2->geom < 0) return 0;
int g1 = obj1->model->geom_type[obj1->geom];
int g2 = obj2->model->geom_type[obj2->geom];
return (g1 == mjGEOM_MESH || g1 == mjGEOM_BOX) &&
(g2 == mjGEOM_MESH || g2 == mjGEOM_BOX);
int g1 = obj1->geom_type;
int g2 = obj2->geom_type;
return (g1 == mjGEOM_MESH || g1 == mjGEOM_BOX || g1 == mjGEOM_HFIELD) &&
(g2 == mjGEOM_MESH || g2 == mjGEOM_BOX || g2 == mjGEOM_HFIELD);
}