T- Type of vector, either 2D or 3D, implementing the
public abstract class FormationMotionModerator<T extends com.badlogic.gdx.math.Vector<T>> extends java.lang.Object
FormationMotionModeratormoderates the movement of the formation based on the current positions of the members in its slots: in effect to keep the anchor point on a leash. If the members in the slots are having trouble reaching their targets, then the formation as a whole should be held back to give them a chance to catch up.
|Constructor and Description|
|Modifier and Type||Method and Description|
Calculates the drift offset when members are in the given set of slots for the specified pattern.
Update the anchor point to moderate formation motion.
anchor- the anchor point
public Location<T> calculateDriftOffset(Location<T> centerOfMass, com.badlogic.gdx.utils.Array<SlotAssignment<T>> slotAssignments, FormationPattern<T> pattern)
centerOfMass- the output location set to the calculated drift offset
slotAssignments- the set of slots
pattern- the pattern