Freezes individual rotation axes (X, Y, and/or Z) of the dragged object. The locked axis values are captured once at construction time and restored every frame.

Set useLocalSpace to true to lock axes in the object's local space; leave it false (default) to lock axes in world space.

const c = new FixedRotationAxesConstraint(RotationAxis.Y, false);
// init is called automatically by DragControls, or call manually: c.init(ctx);

Implements

  • IDragConstraint

Constructors

Properties

Methods

Constructors

  • Parameters

    • frozenAxes: RotationAxis

      Bitfield of RotationAxis values indicating which axes to lock.

    • useLocalSpace: boolean = false

      When true, axes are locked in the object's local space; otherwise world space.

    Returns FixedRotationAxesConstraint

Properties

frozenAxes: RotationAxis

Bitfield of RotationAxis values indicating which axes to lock.

useLocalSpace: boolean = false

When true, axes are locked in the object's local space; otherwise world space.

Methods

  • Modifies followObject in-place. Invoked after position is resolved each frame.

    Parameters

    Returns void

  • Called once at drag start and again whenever the drag context resets (e.g. multi-touch → single-pointer transition). Capture any object snapshot (position, rotation, scale) you need to hold fixed during the drag. Constraints that need no dynamic initialization may omit this method.

    Parameters

    • ctx: IDragConstraintContext

    Returns void