movements
Class TrackGenerator
java.lang.Object
movements.TrackGenerator
- class TrackGenerator
- extends java.lang.Object
This class takes as input a series of positions to which a participant
must move and outputs a PersonMovement object that makes a track going
through each position in turn.
The starting point is set by passing it to the constructor.
Data is then input by making calls to the addPosition method.
The movement object is then obtained by calling the getMovement
method.
The movement will be made at a constant speed.
The total time to be taken for the entire track is passed to
getMovement.
The caller cannot specify
the time at which the participant gets to the intermediate points.
If the participant is supposed to be at a particular point at a
particular time then the user of this class must call getMovement
when the point with the time fix is reached to generate the movement
up to that point and then start over.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
position
private ParticipantPosition position
m_numberOfTrackSegments
private int m_numberOfTrackSegments
m_trackSegments
private TrackSegment[] m_trackSegments
TrackGenerator
TrackGenerator(ParticipantPosition startingPosition)
- Construct an empty list of tracks.
- Parameters:
startingPosition - The caller must not modify the contents of this object
after this method has been called. The behavior of
this class will be undefined if they are.
addWayPoint
void addWayPoint(ParticipantPosition wayPoint)
throws MoveBackwardsException,
TurnOnSpotException
- Adds a way point. The way point includes the direction in which the
participant is both moving and facing when at the way point.
- Parameters:
wayPoint - The caller must not modify the contents of this object
after this method has been called. The behavior of
this class will be undefined if they are.
- Throws:
MoveBackwardsException
TurnOnSpotException
getMovement
PersonMovement getMovement(int tickLength)
Copyright © 2003 Nigel Westbury