sdr 0.21

net.cscott.sdr.anim
Class AnimDancer

java.lang.Object
  extended by net.cscott.sdr.anim.AnimDancer
Direct Known Subclasses:
CheckerDancer

public abstract class AnimDancer
extends Object

An AnimDancer encapsulates all the information needed to display and animate a single dancer. It is given a list of TimedPositions, and uses these and a BeatTimer to update the position and animation state of the scene graph Node corresponding to the dancer.

Version:
$Id: AnimDancer.java,v 1.2 2006-10-27 05:16:25 cananian Exp $
Author:
C. Scott Ananian

Field Summary
 StandardDancer dancer
          The StandardDancer corresponding to this animated dancer.
 SwitchNode node
          The scene graph Node corresponding to this animated dancer.
 
Constructor Summary
protected AnimDancer(StandardDancer dancer)
           
 
Method Summary
 void addAction(Fraction time, Action target)
          Add a new timed action.
 void addPosition(Fraction time, Position target)
          Add a new position target.
 TimedPosition getLastPosition()
           
 TimedPosition getNextPosition(Fraction time)
          Get the next position with time greater than or equal to the given time.
abstract  void update(Fraction time)
          Update the node based on the current beat time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dancer

public final StandardDancer dancer
The StandardDancer corresponding to this animated dancer.


node

public final SwitchNode node
The scene graph Node corresponding to this animated dancer.

Constructor Detail

AnimDancer

protected AnimDancer(StandardDancer dancer)
Method Detail

update

public abstract void update(Fraction time)
Update the node based on the current beat time. This method is called from the rendering thread.


addPosition

public void addPosition(Fraction time,
                        Position target)
Add a new position target. This method is called from the choreography thread.


addAction

public void addAction(Fraction time,
                      Action target)
Add a new timed action. This method is called from the choreography thread, as well as from the personality thread.


getNextPosition

public TimedPosition getNextPosition(Fraction time)
Get the next position with time greater than or equal to the given time. May update the value returned by getLastPosition(). Returns null if there is no position more recent than that returned by getLastPosition().


getLastPosition

public TimedPosition getLastPosition()

sdr 0.21

Copyright (c) 2006 C. Scott Ananian