API Docs for: 0.6.1
Show:

# ContactEquation Class

Contact/non-penetration constraint equation

## Constructor

### `ContactEquation`

(
• `bodyA`
• `bodyB`
)

#### Parameters:

• `bodyA` Body
• `bodyB` Body

## Methods

### `addToWlambda`

(
• `deltalambda`
)

Add constraint velocity to the bodies.

#### Parameters:

• `deltalambda` Number

### `computeB`

() Number

Computes the RHS of the SPOOK equation

Number:

### `computeGiMf`

() Number

Computes Ginv(M)f, where M is the mass matrix with diagonal blocks for each body, and f are the forces on the bodies.

Number:

### `computeGiMGt`

() Number

Computes Ginv(M)G'

Number:

### `computeGq`

() Number

Computes G*q, where q are the generalized body coordinates

Number:

### `computeGW`

() Number

Computes G*W, where W are the body velocities

Number:

### `computeGWlambda`

() Number

Computes G*Wlambda, where W are the body velocities

Number:

### `computeInvC`

(
• `eps`
)
Number

Compute the denominator part of the SPOOK equation: C = Ginv(M)G' + eps

#### Parameters:

• `eps` Number

Number:

### `getImpactVelocityAlongNormal`

() Number

Get the current relative velocity in the contact point.

Number:

### `setSpookParams`

()

Recalculates a,b,eps.

## Properties

Number

SPOOK parameter

Number

SPOOK parameter

Body

Body

Boolean

Default: true

Number

SPOOK parameter

JacobianElement

JacobianElement

Number

Number

### `ni`

Vec3

Contact normal, pointing out of body i.

Number

### `ri`

Vec3

World-oriented vector that goes from the center of bi to the contact point.

### `rj`

Vec3

World-oriented vector that starts in body j position and goes to the contact point.