Options
All
  • Public
  • Public/Protected
  • All
Menu

This is a holder class for the physics constraint created by the physics plugin It holds a set of functions to control the underlying constraint

see

https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine

Hierarchy

  • PhysicsConstraint

Index

Constructors

  • new PhysicsConstraint(type: ConstraintType, options: PhysicsConstraintParameters, scene: Scene): PhysicsConstraint
  • Constructs a new constraint for the physics constraint.

    Parameters

    • type: ConstraintType

      The type of constraint to create.

    • options: PhysicsConstraintParameters

      The options for the constraint.

    • scene: Scene

      The scene the constraint belongs to.

      This code is useful for creating a new constraint for the physics engine. It checks if the scene has a physics engine, and if the plugin version is correct. If all checks pass, it initializes the constraint with the given type and options.

    Returns PhysicsConstraint

Properties

_pluginData: any

V2 Physics plugin private data for a physics material

Methods

  • dispose(): void
  • Returns void

  • getAxisFriction(axis: ConstraintAxis): number
  • Parameters

    • axis: ConstraintAxis

    Returns number

  • getAxisMaxLimit(axis: ConstraintAxis): number
  • Parameters

    • axis: ConstraintAxis

    Returns number

  • getAxisMinLimit(axis: ConstraintAxis): number
  • Parameters

    • axis: ConstraintAxis

    Returns number

  • getAxisMode(axis: ConstraintAxis): ConstraintAxisLimitMode
  • Parameters

    • axis: ConstraintAxis

    Returns ConstraintAxisLimitMode

  • getAxisMotorMaxForce(axis: ConstraintAxis): number
  • Parameters

    • axis: ConstraintAxis

    Returns number

  • getAxisMotorTarget(axis: ConstraintAxis): number
  • Parameters

    • axis: ConstraintAxis

    Returns number

  • getAxisMotorType(axis: ConstraintAxis): ConstraintMotorType
  • Parameters

    • axis: ConstraintAxis

    Returns ConstraintMotorType

  • Retrieves the child body of the current physics constraint.

    Returns undefined | PhysicsBody

    The child body of the current physics constraint, or undefined if no child body is present.

  • getCollisionsEnabled(): boolean
  • Returns boolean

  • getEnabled(): boolean
  • Returns boolean

  • Retrieves the parent body of the current physics constraint.

    Returns undefined | PhysicsBody

    The parent body of the current physics constraint, or undefined if the current constraint does not have a parent body.

  • Parameters

    Returns void

  • Parameters

    Returns void

  • setAxisFriction(axis: ConstraintAxis, friction: number): void
  • Parameters

    • axis: ConstraintAxis
    • friction: number

    Returns void

  • setAxisMaxLimit(axis: ConstraintAxis, limit: number): void
  • Parameters

    • axis: ConstraintAxis
    • limit: number

    Returns void

  • setAxisMinLimit(axis: ConstraintAxis, minLimit: number): void
  • Parameters

    • axis: ConstraintAxis
    • minLimit: number

    Returns void

  • setAxisMode(axis: ConstraintAxis, limitMode: ConstraintAxisLimitMode): void
  • Parameters

    • axis: ConstraintAxis
    • limitMode: ConstraintAxisLimitMode

    Returns void

  • setAxisMotorMaxForce(axis: ConstraintAxis, maxForce: number): void
  • Parameters

    • axis: ConstraintAxis
    • maxForce: number

    Returns void

  • setAxisMotorTarget(axis: ConstraintAxis, target: number): void
  • Parameters

    • axis: ConstraintAxis
    • target: number

    Returns void

  • setAxisMotorType(axis: ConstraintAxis, motorType: ConstraintMotorType): void
  • Parameters

    • axis: ConstraintAxis
    • motorType: ConstraintMotorType

    Returns void

  • Sets the child body of the current body.

    Parameters

    • body: PhysicsBody

      The child body to set.

      This method is useful for setting the child body of the current body in a physics engine. This allows for the creation of complex structures of bodies that interact with each other in a realistic way.

    Returns void

  • setCollisionsEnabled(isEnabled: boolean): void
  • Parameters

    • isEnabled: boolean

    Returns void

  • setEnabled(isEnabled: boolean): void
  • Parameters

    • isEnabled: boolean

    Returns void

  • Sets the parent body of this body.

    Parameters

    • body: PhysicsBody

      The parent body to set.

      This method is useful for setting the parent body of a physics body in a physics engine. This allows the engine to accurately simulate the motion of the body in relation to its parent body. For example, if the parent body is a planet, the engine can accurately simulate the motion of the body in relation to the planet's gravity.

    Returns void

Legend

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

Settings

Theme