controller from useIkController().
Usage
Custom Site
Override the site tracked by this gizmo (defaults to the controller’ssiteName):
Custom Drag Handler
Props
The IK controller value returned by
useIkController().MuJoCo site to track. Defaults to the
useIkController config’s site.Visual scale of the gizmo handles.
Custom drag callback. When provided, the gizmo does not automatically enable IK — the consumer is responsible for handling the drag.
Behavior
When not dragging:- The gizmo tracks the MuJoCo site’s world position and orientation each frame
- It “follows” the end-effector as the robot moves
onDrag prop):
- IK is automatically enabled via
controller.setIkEnabled(true) - The gizmo’s position/orientation is written to the IK target
- The IK solver runs each frame to compute joint angles
- OrbitControls are disabled during drag
onDrag prop):
- The
onDragcallback fires with position and quaternion - IK is NOT automatically enabled — the consumer decides what to do
- OrbitControls are disabled during drag
Programmatic Control
Use the controller value fromuseIkController():
Notes
- Requires a
controllerprop fromuseIkController() - The IK solver respects
numJointsfrom the controller config - Disable IK with
controller.setIkEnabled(false)when using custom control (e.g.,useBeforePhysicsStep)