Skip to main content
Returns the THREE.Mesh[] array for a given MuJoCo body ID. This is the low-level primitive for building custom selection visuals, outlines, postprocessing effects, or any logic that needs direct access to the meshes belonging to a body.

Signature

Usage

Custom Selection Visuals

Because useBodyMeshes gives you raw mesh references, you can implement any visual effect:

Postprocessing

Pair with @react-three/postprocessing to apply per-body effects:

Parameters

Returns

How It Works

Traverses the R3F scene graph and collects all meshes whose userData.bodyID matches the given bodyId. The <SceneRenderer> component sets userData.bodyID on every mesh it creates, so this hook works with any standard mujoco-react scene.