Yuval Tassa
c348bc9f4c
Disable clang-format for MuJoCo public headers and engine source.
...
PiperOrigin-RevId: 886720463
Change-Id: I7c89fa99bee0598dcf48807bfbd61ee8bf8fa9b8
2026-03-20 05:06:15 -07:00
Haroon Qureshi
6134fe48d9
Enable shadows depending on render settings.
...
PiperOrigin-RevId: 886236214
Change-Id: I6999e52ff3d9fc0734082312a77d6c033b69a24b
2026-03-19 09:59:50 -07:00
Haroon Qureshi
eae31f0b3c
Use model's num_quads for generating planes.
...
PiperOrigin-RevId: 886228541
Change-Id: I693f85edd84e4e1b1db6a932d4479888426bcae4
2026-03-19 09:44:53 -07:00
Haroon Qureshi
7c63bcc8f3
Move Render logic into the Scene/Gui View classes.
...
This is in preparation for an upcoming change.
PiperOrigin-RevId: 886203890
Change-Id: I91eba35b394898d942f66f75e947c450b924a973
2026-03-19 08:50:41 -07:00
Kyle Bayes
eec6e43a73
Bit compress face vertices in EPA to reduce memory needed. The parameter ccd_iteration is only supported to 1000, so we only need 10 bits for vertex index.
...
PiperOrigin-RevId: 885690198
Change-Id: I4c6af170ddc86316d3e9cfaf7ca7e0e4fac8a416
2026-03-18 11:10:14 -07:00
Alessio Quaglino
e57d95e68f
Remove vertcollide attribute from flex contact.
...
The `vertcollide` attribute in flex and flexcomp contact specifications has been removed since the next mjWarp release will support flex collisions. This attribute was previously used to enable vertex-based collisions by adding sphere geoms at flex vertices. The functionality associated with this attribute has been deprecated and removed from the XML parser, documentation, and internal data structures. Affected example XML files have also been updated.
PiperOrigin-RevId: 885595503
Change-Id: I6a78975f1bc540c09ea8b5306ff3be0962b7ab24
2026-03-18 07:59:57 -07:00
Matija Kecman
f1715e67bd
Fix studio web so that single file xml model can be loaded in a single-threaded wasm build
...
model_holder.cc modified to disable multi-threaded compilation for WASM builds. index.html `animate()` function modified so the animation rendering loop executes asynchronously with async/await calls. These changes are sufficient to make xml files without references work (e.g., humanoid.xml), more work is needed to make the vfs work so multi-file models can load.
PiperOrigin-RevId: 885537402
Change-Id: I3469cae48e7268073be334b99bf907c5ed8c27a7
2026-03-18 05:31:29 -07:00
Haroon Qureshi
b0c48ba846
Planes should not receive shadows when rendered from behind.
...
Also refactors Renderables a bit to allow for additional use-cases.
PiperOrigin-RevId: 885527587
Change-Id: I4b17e097256de0356151a6d087bc01f11e3071b7
2026-03-18 05:05:21 -07:00
Haroon Qureshi
3f77daa27a
Support wireframe rendering.
...
PiperOrigin-RevId: 885508978
Change-Id: I97216a120f4fede62924819cfb5cef5693adc7f8
2026-03-18 04:13:24 -07:00
Haroon Qureshi
bc1f9513be
Add flag for software rendering.
...
This flag is currently unused.
PiperOrigin-RevId: 885453938
Change-Id: Ia2112410ff12c7b18ad154f18887d4d795bafa3d
2026-03-18 01:48:15 -07:00
Yuval Tassa
9d3ee5a948
Improve ASAN poisoning logic in mj_freeStack.
...
When freeing a stack frame, only poison the newly-freed memory region
`[old_top, new_top)` instead of the entire region `[limit, top)`. The old
code redundantly re-poisoned already-poisoned memory on every
`mj_freeStack` call.
Benchmarking `engine_forward_test` under ASAN:
- Before: 99.3s
- After: 75.6s (~24% faster)
PiperOrigin-RevId: 885035750
Change-Id: Ib195661ca337d13c5ff6094bcc107c4c0a617b9b
2026-03-17 08:26:39 -07:00
Matija Kecman
c420a6e1ca
Fix resizing the window when running single threaded
...
This was affecting code running in the browser using WASM
PiperOrigin-RevId: 884921901
Change-Id: I13e634452275927f58a63179cdf140780852be2f
2026-03-17 03:32:35 -07:00
Matija Kecman
4be4a539c4
Fix "Selected backend not supported in this build" error when running using WASM
...
PiperOrigin-RevId: 884908229
Change-Id: I5515d1ffe8e7a4fd1f3c1eeee11a7f24196be780
2026-03-17 02:57:45 -07:00
Haroon Qureshi
9a0dd7d32d
Make planes semi-transparent from behind.
...
PiperOrigin-RevId: 884896612
Change-Id: I00cc53e539fd1abccb43c7c6b89a7e063cb4848c
2026-03-17 02:27:34 -07:00
Yuval Tassa
efae9157a7
Polynomial stiffness and damping https://youtu.be/aKa3ZlEF9_Y
...
PiperOrigin-RevId: 884607673
Change-Id: If8088dbf37fed1055304778a7eb84dec52cba920
2026-03-16 13:25:25 -07:00
Alessio Quaglino
aec1b45dce
Remove unnecessary const from grad parameter in strain Jacobian functions.
...
The `grad` parameter in `volumetric_dSdx` and `invariant_dSdx` is not modified, but the `const` qualifier was inconsistent with how the array was being passed, requiring an unnecessary cast. Removing the `const` simplifies the function signatures and calls.
PiperOrigin-RevId: 884598322
Change-Id: Icac8071aa8e838057dd39c979c23a4f47e1dc22d
2026-03-16 13:04:00 -07:00
Alessio Quaglino
ac2730ab80
Change flex strain constraints for trilinear to a more stable formulation.
...
This change improves trilinear flex elements by using reduced integration for volumetric quantities (strain trace and volume ratio) at the element center, while adding full integration for shear components at 8 Gauss points and removing the second strain invariant from the constraints, which is negligible for small strains. This reduced integration "B-bar" technique is standard in finite element analysis and prevents artificial stiffness that can occur when low-order elements are nearly incompressible. The constraint count per trilinear element changes from 24 to 26 compared to using invariants. For quadratic elements, the full 27 quadrature point are used resulting in 162 constraints.
PiperOrigin-RevId: 884570752
Change-Id: Ib74ece8f4712c2c81fbfd784524fcac52a2c80e5
2026-03-16 12:05:16 -07:00
Yuval Tassa
1f2587fe3e
Make preprocessor checks for ADDRESS_SANITIZER compatible with GCC
...
PiperOrigin-RevId: 884468086
Change-Id: I5742f023689fd8cc1747df1af5f0a9687a0e77ac
2026-03-16 09:03:52 -07:00
Taylor Howell
bb38a34869
Skip shared dofs for contact constraints
...
PiperOrigin-RevId: 884455239
Change-Id: I7ee36a13c28be88e12380b4790f150ad62f268c1
2026-03-16 08:36:58 -07:00
Yuval Tassa
eca5758bf9
Define ADDRESS_SANITIZER portably using standard compiler macros
...
Use `__SANITIZE_ADDRESS__` (GCC) and `__has_feature(address_sanitizer)` (Clang)
to define ADDRESS_SANITIZER when the toolchain doesn't provide it natively.
Fixes #3160
PiperOrigin-RevId: 884447485
Change-Id: I48ef51bca8f5c5f15f62089e73cd8fa649723636
2026-03-16 08:18:11 -07:00
Yuval Tassa
c651a0daeb
Merge friction and limit constraint counting into instantiation functions.
...
PiperOrigin-RevId: 884379952
Change-Id: I23605f3e5ada0ed0fbdcf3e1903f54788700e2d3
2026-03-16 05:23:20 -07:00
Yuval Tassa
a47a18dd28
Rollback of 1cda1e7a8c, fixes #3163
...
Note this change re-opens issue #2472
PiperOrigin-RevId: 884378131
Change-Id: Ifefc345f1a296e5245cbb10047bb678ffea3598f
2026-03-16 05:17:43 -07:00
Yuval Tassa
55f5ac0a1d
Remove mj_jacDifPairCount by incorporating the counting into mj_jacDifPair
...
PiperOrigin-RevId: 884366070
Change-Id: I7490ca205a315bc661414e32c91ad1ec753a8fe7
2026-03-16 04:44:59 -07:00
Haroon Qureshi
28def7d25d
Internal changes.
...
PiperOrigin-RevId: 883932254
Change-Id: Ic93097dde6425e7de00001b8d74ecc61adcde321
2026-03-15 03:38:34 -07:00
Kyle Bayes
88ba8ffdbc
Remove const qualifier on mjData in mjfCollision type as mjData is non-const in mjc_SDF via mjpPlugin.
...
PiperOrigin-RevId: 883225786
Change-Id: I5fecaa1d575b340a6510212db7b3e7db48f361cc
2026-03-13 10:21:53 -07:00
Haroon Qureshi
b18657acde
Remove unused flag.
...
PiperOrigin-RevId: 883113888
Change-Id: I098669f8a873694903159649567bc2f68397f955
2026-03-13 05:37:47 -07:00
Matija Kecman
86aae0f5a5
Use user::ThreadPool for actuator lengthrange calculation in addition to mesh and texture compilation
...
PiperOrigin-RevId: 883099169
Change-Id: Id6832c2ca0b8f45e2f428615ae54df4b8bb6f434
2026-03-13 04:54:57 -07:00
Haroon Qureshi
b62aed86f9
Recreate swap chain when the window size changes.
...
PiperOrigin-RevId: 882521107
Change-Id: I0d29d2e323e7830256c24eead439b3f2eb55de40
2026-03-12 04:56:50 -07:00
Haroon Qureshi
16d618e7b9
Ensure we have a valid vfs when loading a spec.
...
PiperOrigin-RevId: 882503274
Change-Id: Iddbd6f00c0344bb34d68bb72a640c0a8e81076a2
2026-03-12 04:06:05 -07:00
Sam Haves
3601b063dc
Modify mjCMesh vert_ field to be vector<float> instead of vector<double>.
...
PiperOrigin-RevId: 882162404
Change-Id: Ia97439420f284d594f5cb1a91cd0fb640ac8dff0
2026-03-11 13:15:32 -07:00
Haroon Qureshi
ad57721e2c
Add missing state.
...
PiperOrigin-RevId: 882072832
Change-Id: I6ad75af67edc7672350c775c1a560e3db6d16969
2026-03-11 10:06:43 -07:00
Sam Haves
ecc22667fa
Correct polygon winding order for all meshes not only when loaded from a file.
...
PiperOrigin-RevId: 882053060
Change-Id: I94ee81838fa4074a1a890de4f282eca45ee9e820
2026-03-11 09:25:27 -07:00
Haroon Qureshi
db9ab94555
Refactor parts of the toolbar GUI into the GUI library.
...
PiperOrigin-RevId: 882024591
Change-Id: I3ac73247973666f4d60e9d8d028d20d3ef709bcc
2026-03-11 08:23:12 -07:00
Michael Moss
6d70e66810
Update MuJoCo version from 3.6.0 to 3.7.0 following the 3.6.0 release
...
PiperOrigin-RevId: 881995135
Change-Id: I0c1a3b4a22c4c7cfada580b49a2cacde64cc84f3
2026-03-11 07:09:24 -07:00
Haroon Qureshi
ed2f34baa0
Fix logic for looking up root model within an archive.
...
PiperOrigin-RevId: 881976329
Change-Id: I7771b84ff0aed83d55ee830deb2f92357355eb88
2026-03-11 06:18:14 -07:00
Haroon Qureshi
df02fe4bc0
BodyAddChild PopupContext needs to happen immediately upon triggering it.
...
PiperOrigin-RevId: 881955422
Change-Id: I03675431d78c93550ff2ad6d562daf1a0e3d0d08
2026-03-11 05:20:39 -07:00
Kyle Bayes
acf7f030a6
Remove const qualifier from mjData in mj_geomDistance. The function mj_geomDistance will require data stack space as nativeccd memory is determined from opt.ccd_iterations.
...
PiperOrigin-RevId: 881946592
Change-Id: I524b9fa41018a581e58647d44de6ca3db4c6608b
2026-03-11 04:55:44 -07:00
Copybara-Service
64ee2d041f
Merge pull request #3105 from NandiniDhanrale:fix/vfs-move-3098
...
PiperOrigin-RevId: 881946056
Change-Id: Ide041ff1dcdae00133251d928936920b47cf6c0d
2026-03-11 04:53:57 -07:00
Sam Haves
6890e133c0
Add mjs_getCompiler C API and compiler property to Python spec elements.
...
PiperOrigin-RevId: 881488083
Change-Id: I3aa1c0562bf2fd27057b8056048e3156fc1b067c
2026-03-10 09:57:36 -07:00
Haroon Qureshi
d6aac2041e
Make filament-opengl the default graphics mode for studio.
...
PiperOrigin-RevId: 881362074
Change-Id: Iaa42ddf915b8b146775b2cf0263152b94c586c49
2026-03-10 04:59:03 -07:00
Alessio Quaglino
f1b305632c
Allow mesh with octrees in mjc_distance.
...
PiperOrigin-RevId: 881355677
Change-Id: I8da9f7c92d6e76f16a5d82e7d16488211a8a65b7
2026-03-10 04:41:34 -07:00
Michael Moss
955d6c0b02
Update MuJoCo version from 3.5.1 to 3.6.0 prior to next release.
...
The next release will include breaking changes, so this bumps the major
version to reflect that.
PiperOrigin-RevId: 881351265
Change-Id: I970c68a0211651c07fcb8109ebd0b138196cf50a
2026-03-10 04:30:07 -07:00
Alessio Quaglino
713b5524bc
Introduces a new "strain" equality mode (flex_edgeequality = 3) for flexcomps with trilinear interpolation. This mode enforces constraints on the three invariants of the Green-Lagrange strain tensor at 8 Gauss quadrature points within each flex element, resulting in 24 equality constraints per flexcomp.
...
Also fixes a bug when attaching a flex with constraints.
PiperOrigin-RevId: 881349765
Change-Id: I8e6df8239488bfdc87d7e5b473568975e38c737e
2026-03-10 04:26:07 -07:00
Copybara-Service
3a99f6110e
Merge pull request #3084 from Ashutosh0x:fix/mingw-stat-localtime
...
PiperOrigin-RevId: 880906196
Change-Id: I98027e80e9882620cb184766c14110478178ce53
2026-03-09 09:54:10 -07:00
Yuval Tassa
1e1eb48261
No-op refactor of flex interpolation factorization and solve in mj_implicitSkip.
...
PiperOrigin-RevId: 880867833
Change-Id: I2ab8ce5a027742af07ef0256bc4cdee62289282e
2026-03-09 08:20:24 -07:00
Copybara-Service
79d14035f9
Merge pull request #3158 from mar-yan24:mark-flexcompFix
...
PiperOrigin-RevId: 880857702
Change-Id: Ic1ad4068312c9a02728ce7f49abb38dea3b97a46
2026-03-09 07:57:21 -07:00
Copybara-Service
3510537bcb
Merge pull request #3027 from Adityakk9031:#2982
...
PiperOrigin-RevId: 880846172
Change-Id: I5b0ccda4b481c079a6bb640ab19756c3fd4b4b26
2026-03-09 07:26:58 -07:00
Sam Haves
ed0d7ba29f
Move STL handling to a mjpDecoder.
...
PiperOrigin-RevId: 880820344
Change-Id: Ib3a714dd9698335433e518ed6af17d7b8407a8fb
2026-03-09 06:15:04 -07:00
Kyle Bayes
330c36c99b
Fix issue in GJK where the tolerance for x_norm was set too low.
...
PiperOrigin-RevId: 880735671
Change-Id: I324e37e8677d3c7feeb4b8bcf065a2a0122326b6
2026-03-09 02:14:52 -07:00
Mark Yang
95724d1ec2
Fix vfs load for mesh gmeshs type
2026-03-07 21:45:12 -05:00