Constructor parameters for TransformControls.

interface TransformControlsParams {
    id?: string;
    mode?: TransformControlsMode;
    picker?: PickStrategy;
    rotationSnap?: number;
    scaleSnap?: number;
    showX?: boolean;
    showY?: boolean;
    showZ?: boolean;
    size?: number;
    space?: TransformControlsSpace;
    target?: TransformControlsTarget;
    translationSnap?: number;
    view: View;
    viewController?: ViewController;
}

Properties

id?: string

Unique id for the controls' internal SceneModel and ViewLayer. Defaults to "transformControls".

Initial mode. Defaults to "translate".

picker?: PickStrategy

PickStrategy used to identify which handle is under the pointer. The controls call picker.pick({ view, canvasPos, filter }) with a filter that restricts hits to the gizmo's own handle ids, so the picker skips the rest of the scene entirely.

Required for drag interaction. Without a picker the handles still render but cannot be grabbed.

rotationSnap?: number

Snap step for rotate-mode drags, in radians. Drag angles are quantised to multiples of this value. null disables snapping (default).

scaleSnap?: number

Snap step for scale-mode drags, as a multiplicative factor (for example 0.1 snaps to 10% increments). null disables snapping (default).

showX?: boolean

Show or hide the X-axis handles. Defaults to true.

showY?: boolean

Show or hide the Y-axis handles. Defaults to true.

showZ?: boolean

Show or hide the Z-axis handles. Defaults to true.

size?: number

Screen-space size in pixels (approximate handle length on screen). Each frame the controls compute a world-space scale that maps size pixels to the handle's unit length, so the rig stays a constant pixel size regardless of camera distance. Defaults to 160.

Initial coordinate space. Defaults to "world".

Initial target. Pass null (or omit) to construct with no target — the controls stay hidden until TransformControls.attach supplies one.

translationSnap?: number

Snap step for translate-mode drags, in world units. Drag deltas are quantised to multiples of this value along each axis. null disables snapping (default).

view: View

The View the controls attach to. The constructor creates its own ViewLayer and SceneModel within this view's scene to host the gizmo geometry.

viewController?: ViewController

Optional ViewController to suspend while a handle is being dragged.

Without this, the orbit controller's mousemove listener still fires alongside the gizmo's pointermove (browsers dispatch the mouse and pointer event families independently, so stopping one does not stop the other), and the camera orbits in lockstep with the drag.

When provided, the controls set viewController.active = false on drag start and restore the prior value on drag end.