Improve polygon creation logic in compiler.

PiperOrigin-RevId: 875070301
Change-Id: I06e851f3450035fff68b99997406d6ea471ce3b8
This commit is contained in:
Kyle Bayes
2026-02-25 03:39:37 -08:00
committed by Copybara-Service
parent d0fc1c2c83
commit cd8bfb90c3
3 changed files with 82 additions and 70 deletions
+6 -10
View File
@@ -238,16 +238,12 @@ mjtNum CompareModel(const mjModel* m1, const mjModel* m2,
MJMODEL_POINTERS_PREAMBLE(m1);
// compare ints, exclude nbuffer because it hides the actual difference
// TODO(kylebayes): re-enable poly comparisons.
#define X(name) \
if constexpr (std::string_view(#name) != "nbuffer" && \
std::string_view(#name) != "nmeshpolymap" && \
std::string_view(#name) != "nmeshpolyvert" && \
std::string_view(#name) != "nmeshpoly") { \
if (m1->name != m2->name) { \
maxdif = std::abs((long)m1->name - (long)m2->name); \
field = #name; \
} \
#define X(name) \
if constexpr (std::string_view(#name) != "nbuffer") { \
if (m1->name != m2->name) { \
maxdif = std::abs((long)m1->name - (long)m2->name); \
field = #name; \
} \
}
MJMODEL_SIZES
#undef X