Implementation:Google deepmind Mujoco User Composite
| Knowledge Sources | |
|---|---|
| Domains | Physics Simulation, Composite Objects |
| Last Updated | 2026-02-15 04:00 GMT |
Overview
Implements the mjCComposite class for generating composite objects such as particles, grids, cables, ropes, loops, and cloths.
Description
user_composite.cc provides the logic for creating composite MuJoCo objects that are built from repeating patterns of bodies, joints, and geoms. The mjCComposite constructor initializes default properties including composite type (particle, grid, cable, rope, loop, cloth), grid counts, offsets, quaternion orientation, cable curve shapes, and skin parameters. It supports plugin-based composites and generates skin meshes with optional texture coordinates and subgrid refinement.
Usage
Used during model parsing when a composite element is encountered in an MJCF XML file, generating the underlying bodies, joints, and geoms that form the composite structure.
Code Reference
Source Location
- Repository: Google_deepmind_Mujoco
- File: src/user/user_composite.cc
- Lines: 1-1103
Key Functions
mjCComposite::mjCComposite(void);
bool mjCComposite::Make(mjSpec* spec, mjsBody* body, char* error, int error_sz);
bool mjCComposite::MakeCable(mjCModel* model, mjsBody* body, char* error, int error_sz);
void mjCComposite::MakeSkin2(mjCModel* model, mjtNum inflate);
void mjCComposite::MakeSkin2Subgrid(mjCModel* model, mjtNum inflate);
Import
#include "user/user_composite.h"
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| spec | mjSpec* | Yes | Model specification to add composite elements to |
| body | mjsBody* | Yes | Parent body for the composite |
| error | char* | No | Buffer for error messages |
| error_sz | int | No | Size of error buffer |
Outputs
| Name | Type | Description |
|---|---|---|
| bool | bool | True on success, false on failure (error message written to error buffer) |