+++ /dev/null
-/*******************************************************************************\r
- * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- * VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
-package org.simantics.proconf.g3d.animation;\r
-\r
-\r
-import com.jme.math.Vector3f;\r
-import com.jme.scene.Node;\r
-\r
-\r
-public class ChanneledPositionInterpolator implements Interpolator {\r
- private ScalarInterpolator xInterpolator;\r
- private ScalarInterpolator yInterpolator;\r
- private ScalarInterpolator zInterpolator;\r
-\r
- Node node;\r
- \r
- public ChanneledPositionInterpolator(ScalarInterpolator xInterpolator, ScalarInterpolator yInterpolator, ScalarInterpolator zInterpolator) {\r
- this.xInterpolator = xInterpolator;\r
- this.yInterpolator = yInterpolator;\r
- this.zInterpolator = zInterpolator;\r
- }\r
- \r
- public void interpolate(double delta) {\r
- double x = xInterpolator.evaluate(delta);\r
- double y = yInterpolator.evaluate(delta);\r
- double z = zInterpolator.evaluate(delta);\r
-\r
- node.setLocalTranslation(new Vector3f((float)x,(float)y,(float)z));\r
- }\r
- \r
- public void setTarget(Object target) {\r
- node = (Node)target;\r
- }\r
-\r
-}\r