Skip to main content
A draggable 3D gizmo (powered by drei’s PivotControls) that drives inverse kinematics. Drag the gizmo to move the robot’s end-effector. Requires a controller from useIkController().

Usage

Custom Site

Override the site tracked by this gizmo (defaults to the controller’s siteName):

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
When dragging (no 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
When dragging (with onDrag prop):
  • The onDrag callback 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 from useIkController():

Notes

  • Requires a controller prop from useIkController()
  • 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)