The Matter.MouseConstraint module contains methods for creating mouse constraints. Mouse constraints are used for allowing user interaction, providing the ability to move bodies via the mouse or touch.

See the included usage examples.

Hierarchy

  • default

Constructors

Methods

Constructors

Methods

  • Creates a new mouse constraint. All properties have default values, and many are pre-calculated automatically based on other properties. See the properties section below for detailed information on what you can pass via the options object.

    Parameters

    • engine: IEngine
    • options: Partial<Omit<IMouseConstraint, "constraint">> & {
          constraint?: {
              angleA?: number;
              angleB?: number;
              angularStiffness?: number;
              bodyA?: null | ({ angle?: number | undefined; anglePrev?: number | undefined; angularSpeed?: number | undefined; angularVelocity?: number | undefined; area?: number | undefined; axes?: IAxes | undefined; ... 41 more ...; _original?: { ...; } | ... 1 more ... | undefined; });
              bodyB?: null | ({ angle?: number | undefined; anglePrev?: number | undefined; angularSpeed?: number | undefined; angularVelocity?: number | undefined; area?: number | undefined; axes?: IAxes | undefined; ... 41 more ...; _original?: { ...; } | ... 1 more ... | undefined; });
              damping?: number;
              id?: number;
              label?: string;
              length?: number;
              plugin?: ({}) | ({ name?: string | undefined; version?: string | undefined; for?: string | undefined; uses?: string[] | undefined; install?: { apply?: {} | undefined; call?: {} | undefined; bind?: {} | undefined; ... 6 more ...; [Symbol.hasInstance]?: {} | undefined; } | undefined; _warned?: boolean | undefined; });
              pointA?: { x?: number | undefined; y?: number | undefined; };
              pointB?: { x?: number | undefined; y?: number | undefined; };
              render?: { visible?: boolean | undefined; lineWidth?: number | undefined; strokeStyle?: string | undefined; type?: string | undefined; anchors?: boolean | undefined; };
              stiffness?: number;
              type?: "constraint";
          };
      } = {}

    Returns IMouseConstraint

    A new MouseConstraint

    Method

    create

Generated using TypeDoc