Class Sweep

java.lang.Object
org.jbox2d.common.Sweep
All Implemented Interfaces:
Serializable

public class Sweep extends Object implements Serializable
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.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    float
    World angles
    float
    World angles
    float
    Fraction of the current time step in the range [0,1] c0 and a0 are the positions at alpha0.
    final Vec2
    Center world positions
    final Vec2
    Center world positions
    final Vec2
    Local center of mass position
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final void
    advance(float alpha)
    Advance the sweep forward, yielding a new initial state.
    final void
    getTransform(Transform xf, float beta)
    Get the interpolated transform at a specific time.
    final void
     
    final Sweep
    set(Sweep argCloneFrom)
     
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • 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()
      Overrides:
      toString in class Object
    • 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 - the result is placed here - must not be null
      t - the normalized time in [0,1].
    • advance

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