Package org.jbox2d.common
Class Sweep
java.lang.Object
org.jbox2d.common.Sweep
- All Implemented Interfaces:
java.io.Serializable
public class Sweep
extends java.lang.Object
implements java.io.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
FieldsModifier and TypeFieldDescriptionfloat
World anglesfloat
World anglesfloat
Fraction of the current time step in the range [0,1] c0 and a0 are the positions at alpha0.final Vec2
Center world positionsfinal Vec2
Center world positionsfinal Vec2
Local center of mass positionprivate static final long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal 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
java.lang.String
toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
localCenter
Local center of mass position -
c0
Center world positions -
c
Center world positions -
a0
public float a0World angles -
a
public float aWorld angles -
alpha0
public float alpha0Fraction 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 java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
normalize
public final void normalize() -
set
-
getTransform
Get the interpolated transform at a specific time.- Parameters:
xf
- the result is placed here - must not be nullt
- 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.
-