API Docs for: 0.6.1
Show:

# ConeEquation Class

Cone equation. Works to keep the given body world vectors aligned, or tilted within a given angle from each other.

## Constructor

### `ConeEquation`

(
• `bodyA`
• `bodyB`
• `[options.axisA]`
• `[options.axisB]`
• `[options.angle]`
• `[options.maxForce=1e6]`
)

#### Parameters:

• `bodyA` Body
• `bodyB` Body
• `[options.axisA]` Vec3 optional

Local axis in A

• `[options.axisB]` Vec3 optional

Local axis in B

• `[options.angle]` Vec3 optional

The "cone angle" to keep

• `[options.maxForce=1e6]` Number optional

## 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:

### `setSpookParams`

()

Recalculates a,b,eps.

## Properties

Number

SPOOK parameter

### `angle`

Number

The cone angle to keep

Number

SPOOK parameter

Body

Body

Boolean

Default: true

Number

SPOOK parameter

JacobianElement

JacobianElement

Number

Number