Add boolean flags for gravity compensation and surface velocity in mjModel.

These fields (`flg_gravcomp` and `flg_surfacevel`) replace the fast-path checks originally guarded by `ngravcomp` and (recently) `nsurfacevel`. Since the engine uses these integers only as flags (zero vs non-zero), migrating them to actual booleans makes them writeable from the Python bindings at runtime without violating size/dimension constraints.

The legacy integer field `ngravcomp` is marked as deprecated and will be removed in a future release.

PiperOrigin-RevId: 949779204
Change-Id: Ifab1f026063a4239302e6ad689663b611b59dda8
This commit is contained in:
Yuval Tassa
2026-07-17 15:04:37 -07:00
committed by Copybara-Service
parent ebd4abae03
commit a04b0c5b97
20 changed files with 111 additions and 34 deletions
+2 -1
View File
@@ -1105,7 +1105,6 @@ public unsafe struct mjModel_ {
public UInt64 nnames_map;
public UInt64 nJmom;
public UInt64 ngravcomp;
public UInt64 nsurfacevel;
public UInt64 nemax;
public UInt64 njmax;
public UInt64 nconmax;
@@ -1117,6 +1116,8 @@ public unsafe struct mjModel_ {
public UInt64 nhistory;
public UInt64 narena;
public UInt64 nbuffer;
public byte flg_gravcomp;
public byte flg_surfacevel;
public mjOption_ opt;
public mjVisual_ vis;
public mjStatistic_ stat;