Jacobian

View source

Stores the linear and angular coefficients for one contact constraint.

A CollisionManifold keeps separate Jacobians for the normal and tangent constraints at each contact point. Construct one with optional coefficients or update an existing one with set; vector inputs are copied into the Jacobian’s own vectors.

Examples

import { Jacobian } from '@wimaengine/narrowphase'

const constraint = new Jacobian(normalA, normalB, angularA, angularB)
constraint.set(tangentA, tangentB, tangentAngularA, tangentAngularB)

Constructor


constructor(va?: Vector2, vb?: Vector2, wa?: number, wb?: number)

View source

Creates a Jacobian and applies the supplied coefficients.

The vector arguments are copied into the new Jacobian. Angular arguments are applied by set; omitted or zero angular values leave the initialized value unchanged.

Parameters

NameDescriptionDefault
va?

Linear contribution for body A.

—
vb?

Linear contribution for body B.

—
wa?

Angular contribution for body A.

—
wb?

Angular contribution for body B.

—

Properties


va: Vector2

View source

Linear constraint contribution for body A.

Default: ...

vb: Vector2

View source

Linear constraint contribution for body B.

Default: ...

Methods


set(va?: Vector2, vb?: Vector2, wa?: number, wb?: number): void

View source

Updates this Jacobian in place.

Truthy vector arguments are copied into va and vb. Truthy angular arguments replace wa and wb; omitted or zero angular arguments leave their current values unchanged.

Parameters

NameDescriptionDefault
va?

New linear contribution for body A.

—
vb?

New linear contribution for body B.

—
wa?

New angular contribution for body A.

—
wb?

New angular contribution for body B.

—