Options
All
  • Public
  • Public/Protected
  • All
Menu

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.

Hierarchy

  • b2Sweep

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

a

a: number

World angle.

a0

a0: number

World angle.

c

Center world position.

c0

c0: b2Vec2

Center world position.

localCenter

localCenter: b2Vec2

Local center of mass position.

t0

t0: b2Vec2

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

Methods

Advance

  • Advance(t: number): void
  • Advance the sweep forward, yielding a new initial state.

    t

    The new initial time.

    Parameters

    • t: number

    Returns void

Copy

  • Creates a copy of the sweep.

    Returns b2Sweep

GetTransform

  • 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.

    Returns void

Set

  • Sets the sweep from a sweep.

    Parameters

    • other: b2Sweep

      Sweep values to copy from.

    Returns void

Generated using TypeDoc