Support arbitrary large meshes in multiccd by reusing EPA memory.

PiperOrigin-RevId: 947709621
Change-Id: Idc4f168434b9d0a8555c0bed989adb0e99770a78
This commit is contained in:
Kyle Bayes
2026-07-14 08:47:52 -07:00
committed by Copybara-Service
parent 0afafacfc5
commit 2444defc63
18 changed files with 680 additions and 87 deletions
+11
View File
@@ -1321,6 +1321,17 @@ static void setSpring(mjModel* m, mjData* d) {
// entry point: set all remaining constant fields of mjModel, except for lengthrange
void mj_setConst(mjModel* m, mjData* d) {
// compute npolygonmax and nmeshdegmax
m->npolygonmax = 0;
for (int i=0; i < m->nmeshpoly; i++) {
m->npolygonmax = mjMAX(m->npolygonmax, m->mesh_polyvertnum[i]);
}
m->nmeshdegmax = 0;
for (int i=0; i < m->nmeshvert; i++) {
m->nmeshdegmax = mjMAX(m->nmeshdegmax, m->mesh_polymapnum[i]);
}
// recompute sameframe flags from current model geometry
setSameframe(m);