java.lang.Object
com.trapezium.attractor.AttractorSelector
- Direct Known Subclasses:
- FarPreservingAttractorSelector, NearPreservingAttractorSelector
- public class AttractorSelector
- extends java.lang.Object
The AttractorSelector or one of its subclasses is created by the
CoordAttractor factory method "createAttractorSelector". It is used
to track the currently selected attractor as a floater is matched
one by one to each attractor. Subclasses handle marking of the
preserved floaters in each attracted floater set.
- Since:
- 1.0
- Version:
- 1.0, 8 Oct 1998
|
Method Summary |
void |
attemptAttractorSelection(int attractorOffset,
float distanceToFloater)
Attempt the selection of a particular attractor. |
int |
getSelection()
Get the selected attractor offset |
void |
reset()
Initialize the object, AttractorSelector reset each time matching
for a new floater is started. |
void |
updatePreservedInfo(int[] floaterOffsets,
float[] floaterDistances,
int floaterOffset)
Template, subclasses use this to mark preserved floaters in
the array parameters passed from the CoordAttractor. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
selectedAttractor
protected int selectedAttractor
selectionDistance
protected float selectionDistance
AttractorSelector
public AttractorSelector()
- Class constructor
reset
public void reset()
- Initialize the object, AttractorSelector reset each time matching
for a new floater is started.
attemptAttractorSelection
public void attemptAttractorSelection(int attractorOffset,
float distanceToFloater)
- Attempt the selection of a particular attractor. Floaters are
attracted to the nearest attractor.
updatePreservedInfo
public void updatePreservedInfo(int[] floaterOffsets,
float[] floaterDistances,
int floaterOffset)
- Template, subclasses use this to mark preserved floaters in
the array parameters passed from the CoordAttractor.
getSelection
public int getSelection()
- Get the selected attractor offset