Options
All
  • Public
  • Public/Protected
  • All
Menu

A generic constraint, which can be used to build more complex constraints than those specified in PhysicsConstraintType. The axis and pivot options in PhysicsConstraintParameters define the space the constraint operates in. This constraint contains a set of limits, which restrict the relative movement of the bodies in that coordinate system

Hierarchy

Index

Constructors

Properties

_pluginData: any

V2 Physics plugin private data for a physics material

The collection of limits which this constraint will apply

Accessors

  • get isCollisionsEnabled(): boolean
  • set isCollisionsEnabled(isEnabled: boolean): void
  • Gets whether collisions are enabled for this physics object.

    Returns boolean

    true if collisions are enabled, false otherwise.

  • Enables or disables collisions for the physics engine.

    Parameters

    • isEnabled: boolean

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

    Returns void

  • get isEnabled(): boolean
  • set isEnabled(isEnabled: boolean): void
  • Enable/disable the constraint

    Returns boolean

    true if constraint is enabled

  • Enable/disable the constraint

    Parameters

    • isEnabled: boolean

      value for the constraint

    Returns void

  • Retrieves the options of the physics constraint.

    Returns PhysicsConstraintParameters

    The physics constraint parameters.

  • Gets the type of the constraint.

    Returns PhysicsConstraintType

    The type of the constraint.

Methods

  • dispose(): void
  • Disposes the constraint from the physics engine.

    This method is useful for cleaning up the physics engine when a body is no longer needed. Disposing the body will free up resources and prevent memory leaks.

    Returns void

  • Gets the friction of the given axis of the physics engine.

    Parameters

    Returns Nullable<number>

    The friction of the given axis, or null if the constraint hasn't been initialized yet.

  • Gets the maximum limit of the given axis of the physics engine.

    Parameters

    Returns Nullable<number>

    The maximum limit of the given axis, or null if the constraint hasn't been initialized yet.

  • Gets the minimum limit of the given axis of the physics engine.

    Parameters

    Returns Nullable<number>

    The minimum limit of the given axis, or null if the constraint hasn't been initialized yet.

  • Gets the limit mode of the given axis of the constraint.

    Parameters

    Returns Nullable<PhysicsConstraintAxisLimitMode>

    The limit mode of the given axis, or null if the constraint hasn't been initialized yet.

  • Gets the maximum force of the motor of the given axis of the constraint.

    Parameters

    Returns Nullable<number>

    The maximum force of the motor, or null if the constraint hasn't been initialized yet.

  • Gets the target velocity of the motor associated to the given constraint axis.

    Parameters

    Returns Nullable<number>

    The target velocity of the motor, or null if the constraint hasn't been initialized yet.

  • Gets the motor type of the specified axis of the constraint.

    Parameters

    Returns Nullable<PhysicsConstraintMotorType>

    The motor type of the specified axis, or null if the constraint hasn't been initialized yet.

  • Sets the friction of the given axis of the physics engine.

    Parameters

    • axis: PhysicsConstraintAxis

      The axis of the physics engine to set the friction for.

    • friction: number

      The friction to set for the given axis.

    Returns void

  • Sets the maximum limit of the given axis for the physics engine.

    Parameters

    • axis: PhysicsConstraintAxis

      The axis to set the limit for.

    • limit: number

      The maximum limit of the axis.

      This method is useful for setting the maximum limit of the given axis for the physics engine, which can be used to control the movement of the physics object. This helps to ensure that the physics object does not move beyond the given limit.

    Returns void

  • Sets the minimum limit of a given axis of a constraint.

    Parameters

    Returns void

  • Sets the limit mode for the given axis of the constraint.

    Parameters

    • axis: PhysicsConstraintAxis

      The axis to set the limit mode for.

    • limitMode: PhysicsConstraintAxisLimitMode

      The limit mode to set.

      This method is useful for setting the limit mode for a given axis of the constraint. This is important for controlling the behavior of the physics engine when the constraint is reached. By setting the limit mode, the engine can be configured to either stop the motion of the objects, or to allow them to continue moving beyond the constraint.

    Returns void

  • Sets the maximum force of the motor of the given axis of the constraint.

    Parameters

    • axis: PhysicsConstraintAxis

      The axis of the constraint.

    • maxForce: number

      The maximum force of the motor.

    Returns void

  • Sets the target velocity of the motor associated with the given axis of the constraint.

    Parameters

    • axis: PhysicsConstraintAxis

      The axis of the constraint.

    • target: number

      The target velocity of the motor.

      This method is useful for setting the target velocity of the motor associated with the given axis of the constraint.

    Returns void

  • Sets the motor type of the given axis of the constraint.

    Parameters

    Returns void

    void

Legend

  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Static method

Settings

Theme