controller from useIkController().
Usage
Custom Site
Override the site tracked by this gizmo (defaults to the controller’ssiteName):
Custom Drag Handler
Props
IkContextValue
required
The IK controller value returned by
useIkController().string
default:"controller's siteName"
MuJoCo site to track. Defaults to the
useIkController config’s site.number
default:"0.18"
Visual scale of the gizmo handles.
({ position, quaternion }) => void
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, 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 uses the controller’s inferred or explicit joint/actuator selection
- Disable IK with
controller.setIkEnabled(false)when using custom control (e.g.,useBeforePhysicsStep)