Class b2Sweep

This describes the motion of a body/shape for TOI computation. Shapes are defined with respect to the body origin, which may no coincide with the center of mass. However, to support dynamics we must interpolate the center of mass position.

Index

Properties

Methods

Properties

public a: number

World angle.

public a0: number

World angle.

public c: b2Vec2

Center world position.

public c0: b2Vec2

Center world position.

public localCenter: b2Vec2

Local center of mass position.

public t0: b2Vec2

Time interval = [t0,1], where t0 is in [0,1].

Methods

public Advance(t: number)

Advance the sweep forward, yielding a new initial state.

t

The new initial time.

Parameters

  • t: number

public Copy(): b2Sweep

Creates a copy of the sweep.

Returns

b2Sweep

public GetTransform(xf: b2Transform, alpha: number)

Get the interpolated transform at a specific time.

Parameters

  • xf: b2Transform

    Transform at specified time, this is an out parameter.

  • alpha: number

    Is a factor in [0,1], where 0 indicates t0.

public Set(other: b2Sweep)

Sets the sweep from a sweep.

Parameters

  • other: b2Sweep

    Sweep values to copy from.