1 /*******************************************************************************
\r
2 * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.
\r
3 * All rights reserved. This program and the accompanying materials
\r
4 * are made available under the terms of the Eclipse Public License v1.0
\r
5 * which accompanies this distribution, and is available at
\r
6 * http://www.eclipse.org/legal/epl-v10.html
\r
9 * VTT Technical Research Centre of Finland - initial API and implementation
\r
10 *******************************************************************************/
\r
11 package org.simantics.proconf.g3d.animation;
\r
14 import com.jme.math.Vector3f;
\r
15 import com.jme.scene.Node;
\r
18 public class ChanneledPositionInterpolator implements Interpolator {
\r
19 private ScalarInterpolator xInterpolator;
\r
20 private ScalarInterpolator yInterpolator;
\r
21 private ScalarInterpolator zInterpolator;
\r
25 public ChanneledPositionInterpolator(ScalarInterpolator xInterpolator, ScalarInterpolator yInterpolator, ScalarInterpolator zInterpolator) {
\r
26 this.xInterpolator = xInterpolator;
\r
27 this.yInterpolator = yInterpolator;
\r
28 this.zInterpolator = zInterpolator;
\r
31 public void interpolate(double delta) {
\r
32 double x = xInterpolator.evaluate(delta);
\r
33 double y = yInterpolator.evaluate(delta);
\r
34 double z = zInterpolator.evaluate(delta);
\r
36 node.setLocalTranslation(new Vector3f((float)x,(float)y,(float)z));
\r
39 public void setTarget(Object target) {
\r
40 node = (Node)target;
\r