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.SerializableThis 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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description floataWorld anglesfloata0World anglesfloatalpha0Fraction of the current time step in the range [0,1] c0 and a0 are the positions at alpha0.Vec2cCenter world positionsVec2c0Center world positionsVec2localCenterLocal center of mass positionprivate static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description Sweep()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadvance(float alpha)Advance the sweep forward, yielding a new initial state.voidgetTransform(Transform xf, float beta)Get the interpolated transform at a specific time.voidnormalize()Sweepset(Sweep argCloneFrom)java.lang.StringtoString()
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
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.
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
normalize
public final void normalize()
-
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 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.
-
-