public class Sweep

  1. Object
  2. Sweep
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.

Fields

public final Vec2 localCenterLocal center of mass position
public final Vec2 c0Center world positions
public final Vec2 cCenter world positions
public float a0World angles
public float aWorld angles
public float alpha0Fraction of the current time step in the range [0,1] c0 and a0 are the positions at alpha0.

Constructors

public Sweep()

Methods

public String toString()Returns a string representation of the object.
public final void normalize()
public final Sweep set(Sweep argCloneFrom)
public final void getTransform(Transform xf, float beta)Get the interpolated transform at a specific time.
public final void advance(float alpha)Advance the sweep forward, yielding a new initial state.

Inherited methods

Field details

localCenter

public final Vec2 localCenter
Local center of mass position

c0

public final Vec2 c0
Center world positions

c

public final Vec2 c
Center world positions

a0

public float a0
World angles

a

public float a
World angles

alpha0

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

Constructor details

Sweep

public Sweep()

Method details

toString

public String toString()
Returns a string representation of the object. In general, the toString method returns a string that “textually represents” this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method. The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@’, and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of: getClass().getName() + ‘@’ + Integer.toHexString(hashCode())

normalize

public final void normalize()

set

public final Sweep set(Sweep argCloneFrom)

getTransform

public final void getTransform(Transform xf, float beta)
Get the interpolated transform at a specific time.

Parameters

xf Transform
the result is placed here - must not be null
beta float
Not documented.

advance

public final void advance(float alpha)
Advance the sweep forward, yielding a new initial state.

Parameters

alpha float
the new initial time.