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
13 import javax.vecmath.Quat4d;
\r
15 import org.simantics.proconf.g3d.base.VecmathJmeTools;
\r
18 import com.jme.scene.Node;
\r
20 import org.simantics.animation.curve.SlerpCurve;
\r
23 public class SlerpInterpolator implements Interpolator{
\r
24 private SlerpCurve curve;
\r
26 //private TransformGroup group;
\r
27 //private Transform3D transform;
\r
28 private Node node = null;
\r
30 public SlerpInterpolator(SlerpCurve curve) {
\r
32 //transform = new Transform3D();
\r
35 public void interpolate(double delta) {
\r
36 Quat4d q = curve.evaluate(delta);
\r
37 //transform.set(new Quat4f(q));
\r
38 //group.setTransform(transform);
\r
39 node.setLocalRotation(VecmathJmeTools.get(q));
\r
42 public void setTarget(Object target) {
\r
43 //group = (TransformGroup)target;
\r
44 node = (Node)target;
\r