Box2D: b2Sweep Struct Reference

| Box2D 2.4.1 A 2D physics engine for games

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
b2Sweep Struct Reference

`#include <b2_math.h>`

## Public Member Functions
void | GetTransform (b2Transform *transform, float beta) const
void | Advance (float alpha)
void | Normalize ()
| Normalize the angles.

## Public Attributes
b2Vec2 | localCenter
| local center of mass position
b2Vec2 | c0
b2Vec2 | c
| center world positions
float | a0
float | a
| world angles
float | alpha0

## Detailed Description

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.

## Member Function Documentation

## ◆ Advance()

void b2Sweep::Advance | ( | float | alpha | ) |
| inline

Advance the sweep forward, yielding a new initial state.

Parameters

  alpha | the new initial time.

## ◆ GetTransform()

void b2Sweep::GetTransform | ( | b2Transform * | transform,
|  | float | beta
| ) |  | const
| inline

Get the interpolated transform at a specific time.

Parameters

  transform | the output transform
  beta | is a factor in [0,1], where 0 indicates alpha0.

## ◆ Normalize()

void b2Sweep::Normalize | ( |  | ) |
| inline

Normalize the angles.

Normalize an angle in radians to be between -pi and pi.

## Member Data Documentation

## ◆ alpha0

float b2Sweep::alpha0

Fraction of the current time step in the range [0,1] c0 and a0 are the positions at alpha0.

The documentation for this struct was generated from the following file:

- /build/box2d/src/box2d-2.4.1/include/box2d/b2_math.h