API

Class DistanceConstraint

Creates a distance constraint.

This code is useful for creating a distance constraint in a physics engine. A distance constraint is a type of constraint that keeps two objects at a certain distance from each other. The scene is used to add the constraint to the physics engine.

distance between bodies

The scene the constraint belongs to

DistanceConstraint

Hierarchy (View Summary)

Index
_pluginData: any = undefined

V2 Physics plugin private data for a physics material

  • get isCollisionsEnabled(): boolean

    Gets whether collisions are enabled for this physics object.

    Returns boolean

    true if collisions are enabled, false otherwise.

  • set isCollisionsEnabled(isEnabled: boolean): void

    Enables or disables collisions for the physics engine.

    Parameters

    • isEnabled: boolean

      A boolean value indicating whether collisions should be enabled or disabled.

    Returns void