<light> elements from the loaded MuJoCo model and creates corresponding Three.js lights.
Usage
With Intensity Multiplier
Props
Multiplier applied to all light intensities.
Light Mapping
MJCF light_type | Three.js Light |
|---|---|
0 (directional) | DirectionalLight |
1 (spot) | SpotLight |
model.nlight— number of lightslight_pos— positionlight_dir— directionlight_diffuse— colorlight_castshadow— shadow castinglight_attenuation— attenuation coefficientslight_cutoff— spotlight cone angle
Hook Alternative
For imperative usage inside your own components, useuseSceneLights:
Alternative
You can also enable MJCF lights via themjcfLights prop on MujocoCanvas:
Notes
- Lights are created once when the model loads and cleaned up on unmount
- If your MJCF has no
<light>elements, this component does nothing - The component delegates to
useSceneLightsinternally