#

API Docs for: 0.6.1
Show: Inherited Protected Private Deprecated

# HingeConstraint Class

Extends PointToPointConstraint
Defined in: `src/constraints/HingeConstraint.js:10`

Hinge constraint. Think of it as a door hinge. It tries to keep the door in the correct place and with the correct orientation.

## Constructor

### `HingeConstraint`

(

- `bodyA`
- `bodyB`
- `[options]`

)

Defined in `src/constraints/HingeConstraint.js:10`

#### Parameters:

- `bodyA` Body
- `bodyB` Body
- `[options]` Object optional
  - `[pivotA]` Vec3 optional

    A point defined locally in bodyA. This defines the offset of axisA.

  - `[axisA]` Vec3 optional

    An axis that bodyA can rotate around, defined locally in bodyA.

  - `[pivotB]` Vec3 optional
  - `[axisB]` Vec3 optional
  - `[maxForce=1e6]` Number optional

- Index
- Methods
- Properties

## Item Index

### Methods

- disable
- disableMotor
- enable
- enableMotor
- setMotorMaxForce
- setMotorSpeed
- update

### Properties

- axisA
- axisB
- bodyA
- bodyB
- collideConnected
- equations
- equationX
- equationY
- equationZ
- id
- motorEquation
- pivotA
- pivotB
- rotationalEquation1
- rotationalEquation2

## Methods

### `disable`

()

Inherited from Constraint: `src/constraints/Constraint.js:80`

Disables all equations in the constraint.

### `disableMotor`

()

Defined in `src/constraints/HingeConstraint.js:80`

### `enable`

()

Inherited from Constraint: `src/constraints/Constraint.js:69`

Enables all equations in the constraint.

### `enableMotor`

()

Defined in `src/constraints/HingeConstraint.js:73`

### `setMotorMaxForce`

(

- `maxForce`

)

Defined in `src/constraints/HingeConstraint.js:95`

#### Parameters:

- `maxForce` Number

### `setMotorSpeed`

(

- `speed`

)

Defined in `src/constraints/HingeConstraint.js:87`

#### Parameters:

- `speed` Number

### `update`

()

Inherited from Constraint: `src/constraints/Constraint.js:61`

Update all the equations with data.

## Properties

### `axisA`

Vec3

Defined in `src/constraints/HingeConstraint.js:33`

Rotation axis, defined locally in bodyA.

### `axisB`

Vec3

Defined in `src/constraints/HingeConstraint.js:40`

Rotation axis, defined locally in bodyB.

### `bodyA`

Body

Inherited from Constraint: `src/constraints/Constraint.js:29`

### `bodyB`

Body

Inherited from Constraint: `src/constraints/Constraint.js:34`

### `collideConnected`

Boolean

Inherited from Constraint: `src/constraints/Constraint.js:44`

Set to true if you want the bodies to collide when they are connected.

### `equations`

Array

Inherited from Constraint: `src/constraints/Constraint.js:22`

Equations to be solved in this constraint

### `equationX`

ContactEquation

Inherited from PointToPointConstraint: `src/constraints/PointToPointConstraint.js:49`

### `equationY`

ContactEquation

Inherited from PointToPointConstraint: `src/constraints/PointToPointConstraint.js:54`

### `equationZ`

ContactEquation

Inherited from PointToPointConstraint: `src/constraints/PointToPointConstraint.js:59`

### `id`

Number

Inherited from Constraint: `src/constraints/Constraint.js:39`

### `motorEquation`

RotationalMotorEquation

Defined in `src/constraints/HingeConstraint.js:57`

### `pivotA`

Vec3

Inherited from PointToPointConstraint: `src/constraints/PointToPointConstraint.js:37`

Pivot, defined locally in bodyA.

### `pivotB`

Vec3

Inherited from PointToPointConstraint: `src/constraints/PointToPointConstraint.js:43`

Pivot, defined locally in bodyB.

### `rotationalEquation1`

RotationalEquation

Defined in `src/constraints/HingeConstraint.js:47`

### `rotationalEquation2`

RotationalEquation

Defined in `src/constraints/HingeConstraint.js:52`