movements
Class PersonMovementInTransition

java.lang.Object
  extended bymovements.PersonMovement
      extended bymovements.PersonMovementInTransition
All Implemented Interfaces:
java.io.Serializable

class PersonMovementInTransition
extends PersonMovement

This class implements a movement of a participant that is a transition from one movement to another.

Sometimes one figure or movement may end leaving a person in one position and the next figure or movement starts with that person in a different position. The purpose of this class is to adjust the end of the prior figure and the start of the following figure so that the dancer moves continuously and smoothly from one figure to the next.


Field Summary
private  PersonMovement followingMovement
           
private  PersonMovement priorMovement
           
private  double rateOfAdjustmentAcross
           
private  double rateOfAdjustmentDirection
           
private  double rateOfAdjustmentDown
           
protected  int tickLength
           
private  ParticipantPosition unadjustedPosition
          Work object used to obtain the position where the participant would have been were there no adjustment for the transition.
 
Constructor Summary
(package private) PersonMovementInTransition(PersonMovement priorMovement, PersonMovement followingMovement)
           
 
Method Summary
(package private)  ParticipantPosition getPosition(int ticksIntoMovement)
           
(package private)  void getPosition(ParticipantPosition position, int ticksIntoMovement)
           
(package private)  int getTickLength()
           
private  void readObject(java.io.ObjectInputStream in)
           
private  double shortestTurn(double turnAngle)
          Given an angle, in radians, that specifies an angle through which a dancer must turn, this method returns a turn angle that gets the dancer to face the same direction but by minimizing the amount of turning.
(package private)  PersonMovement splitMovement(int subPeriodStartTick, int subPeriodEndTick)
          Provides a movement that covers only a period of this movement.
protected  PersonMovement splitMovementInternal(int subPeriodStartTick, int subPeriodEndTick)
          Provides a movement that covers only a period of this movement.
 void Trace(java.lang.String indent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

priorMovement

private PersonMovement priorMovement

followingMovement

private PersonMovement followingMovement

rateOfAdjustmentDown

private double rateOfAdjustmentDown

rateOfAdjustmentAcross

private double rateOfAdjustmentAcross

rateOfAdjustmentDirection

private double rateOfAdjustmentDirection

unadjustedPosition

private transient ParticipantPosition unadjustedPosition
Work object used to obtain the position where the participant would have been were there no adjustment for the transition.


tickLength

protected int tickLength
Constructor Detail

PersonMovementInTransition

PersonMovementInTransition(PersonMovement priorMovement,
                           PersonMovement followingMovement)
Method Detail

readObject

private void readObject(java.io.ObjectInputStream in)
                 throws java.io.IOException,
                        java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.lang.ClassNotFoundException

shortestTurn

private double shortestTurn(double turnAngle)
Given an angle, in radians, that specifies an angle through which a dancer must turn, this method returns a turn angle that gets the dancer to face the same direction but by minimizing the amount of turning. For example, given a turn of 200 degrees to the left, this method returns an angle representing a turn of 160 degrees to the right.


getPosition

void getPosition(ParticipantPosition position,
                 int ticksIntoMovement)
Specified by:
getPosition in class PersonMovement

Trace

public void Trace(java.lang.String indent)
Overrides:
Trace in class PersonMovement

getTickLength

int getTickLength()

getPosition

ParticipantPosition getPosition(int ticksIntoMovement)

splitMovement

final PersonMovement splitMovement(int subPeriodStartTick,
                                   int subPeriodEndTick)
Provides a movement that covers only a period of this movement. This method does some error checking and handles the request in a couple of trivial situations. It calls an implementation specific method to handle the non-trivial cases.


splitMovementInternal

protected PersonMovement splitMovementInternal(int subPeriodStartTick,
                                               int subPeriodEndTick)
Provides a movement that covers only a period of this movement. This is a default implementation that uses the PersonMovementSplitter to provide the desired sub-movement. However, most implementations of PersonMovement can do this more efficiently and so override this method. By allowing each PersonMovement implementation to implement this, we get a simpler tree of PersonMovement objects.



Copyright © 2003 Nigel Westbury