Constrains a dragged object to rotate only around a fixed world-space axis. Uses swing-twist decomposition to extract only the twist component around the given axis from the delta rotation since drag start, discarding any perpendicular swing that would tilt the object.

This is the correct constraint for XZ-plane dragging when the parent is rotated — it restricts the object to yaw around the plane normal regardless of how the plane is oriented in world space.

Implements

  • IDragConstraint

Constructors

Methods

Constructors

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