* @param t The time value (expecting t in [0,1])
* @return The value to use at the specified time
*/
public float getValue(float t) {
// first: determine the segment we are in
Vector2f p0 = (Vector2f) curve.get(0);
for (int i = 1; i < curve.size(); i++) {
Vector2f p1 = (Vector2f) curve.get(i);
if (t >= p0.getX() && t <= p1.getX()) {
// found the segment
float st = (t - p0.getX())
/ (p1.getX() - p0.getX());
float r = p0.getY() + st
* (p1.getY() - p0.getY());
// System.out.println( "t: " + t + ", " + p0.x + ", " + p0.y
// + " : " + p1.x + ", " + p1.y + " => " + r );
return r;
}