Implementation:Google deepmind Mujoco Filament Drawable
| Knowledge Sources | |
|---|---|
| Domains | Rendering, 3D Graphics |
| Last Updated | 2026-02-15 04:00 GMT |
Overview
Manages the creation, transformation, and rendering of drawable entities (geoms, decorations, arrows, capsules, cylinders) in the Filament rendering backend.
Description
drawable.cc translates MuJoCo visualization scene objects (mjvGeom) into Filament renderable entities with correct transforms, materials, and textures. It handles composite shapes such as capsules (tube plus two domes), cylinders (tube plus two disks), and multi-part arrows by computing sub-entity transforms. The file also manages texture mapping, including special handling for infinite plane tile sizes to ensure UV scaling matches MuJoCo re-centering increments.
Usage
Called during each render frame by SceneView to convert the MuJoCo abstract scene representation into concrete Filament renderables. Each mjvGeom in the scene is dispatched to the appropriate drawable creation path based on its geometry type.
Code Reference
Source Location
- Repository: Google_deepmind_Mujoco
- File: src/experimental/filament/filament/drawable.cc
- Lines: 1-508
Key Functions
static float GetPlaneTileSize(const mjModel* model, int matid, float texrepeat);
// Drawable creation and transform logic for:
// Capsule (kCapsuleTopDome, kCapsuleBottomDome)
// Cylinder (kCylinderTopDisk, kCylinderBottomDisk)
// Arrow variants (kArrow0Cone, kArrow1Cone, kArrow2TopCone, etc.)
Import
#include "experimental/filament/filament/drawable.h"
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| geom | const mjvGeom* | Yes | MuJoCo visualization geometry to draw |
| model | const mjModel* | Yes | MuJoCo model for material and texture data |
| object_mgr | ObjectManager* | Yes | Provides shapes, materials, and textures |
| engine | filament::Engine* | Yes | Filament engine for entity creation |
Outputs
| Name | Type | Description |
|---|---|---|
| entity | utils::Entity | Filament renderable entity added to the scene |