Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ConeTwistConstraint

A Cone Twist constraint, useful for ragdolls.

Hierarchy

Index

Constructors

constructor

  • new ConeTwistConstraint(bodyA: Body, bodyB: Body, options?: { angle?: number; axisA?: Vec3; axisB?: Vec3; collideConnected?: boolean; maxForce?: number; pivotA?: Vec3; pivotB?: Vec3; twistAngle?: number }): ConeTwistConstraint
  • Parameters

    • bodyA: Body
    • bodyB: Body
    • options: { angle?: number; axisA?: Vec3; axisB?: Vec3; collideConnected?: boolean; maxForce?: number; pivotA?: Vec3; pivotB?: Vec3; twistAngle?: number } = {}
      • Optional angle?: number

        The aperture angle of the cone.

        default

        0

      • Optional axisA?: Vec3

        The axis direction for the constraint of the body A.

      • Optional axisB?: Vec3

        The axis direction for the constraint of the body B.

      • Optional collideConnected?: boolean

        Wether to collide the connected bodies or not.

        default

        false

      • Optional maxForce?: number

        The maximum force that should be applied to constrain the bodies.

        default

        1e6

      • Optional pivotA?: Vec3

        The pivot point for bodyA.

      • Optional pivotB?: Vec3

        The pivot point for bodyB.

      • Optional twistAngle?: number

        The twist angle of the joint.

        default

        0

    Returns ConeTwistConstraint

Properties

angle

angle: number

The aperture angle of the cone.

axisA

axisA: Vec3

The axis direction for the constraint of the body A.

axisB

axisB: Vec3

The axis direction for the constraint of the body B.

bodyA

bodyA: Body

Body A.

bodyB

bodyB: Body

Body B.

collideConnected

collideConnected: boolean

Set to false if you don't want the bodies to collide when they are connected.

equations

equations: Equation[]

Equations to be solved in this constraint.

pivotA

pivotA: Vec3

Pivot, defined locally in bodyA.

pivotB

pivotB: Vec3

Pivot, defined locally in bodyB.

twistAngle

twistAngle: number

The twist angle of the joint.

Methods

disable

  • disable(): void

enable

  • enable(): void

update

  • update(): void