SpatialTransform problem

Hello !



I have a little problem to animate a move between to point.

I have a client/server application. The server send to client new location of entitys every seconds.



If i just ajust localTranslation of my entities with "setLocalTranslation()", it work like charm. But when i want to use SpatialTransformer to do a smoother translation, nothing work (no error, but no movement)

I don't see where is my mistake.


         
//(Spatial)Target = entity to move
//(Vector3f)move = point to reach
                                target.clearControllers();
            SpatialTransformer moveAnim = new SpatialTransformer();
            moveAnim.setObject(target, 0, -1);
            moveAnim.setPosition(0, 0, target.getLocalTranslation());
            moveAnim.setPosition(0, 1, move);
         
            moveAnim.interpolateMissing();
            moveAnim.setActive(true);
            
                  
            target.addController(moveAnim);

Nope, that should be all you need -

e.g.


import com.jme.animation.SpatialTransformer;
import com.jme.app.SimpleGame;
import com.jme.math.Vector3f;
import com.jme.scene.shape.Sphere;

public class TransformerTest extends SimpleGame {

    public static void main(String[] args) {
        HelloAnimation app = new HelloAnimation();
        app.setConfigShowMode(ConfigShowMode.AlwaysShow);
        app.start();
    }

    Sphere s=new Sphere("My sphere",30,30,5);
    SpatialTransformer st = new SpatialTransformer(1);
    Vector3f move = new Vector3f(-100,-50,-200);
    int frames = 0;

    protected void simpleUpdate(){
   super.simpleUpdate();
   frames++;
   if( frames == 500 ){
       move.setX(100);
       st.setPosition(0, 0, s.getLocalTranslation());
       st.setPosition(0, 1, move);
   }
   if( frames == 1000 ){
       move.setY(50);
       st.setPosition(0, 0, s.getLocalTranslation());
       st.setPosition(0, 1, move);
   }
    }
   
    protected void simpleInitGame() {
   st.setObject(s, 0, -1);
   st.setPosition(0, 0, s.getLocalTranslation());
   st.setPosition(0, 1, move);
   st.interpolateMissing();
   st.setActive(true);
   s.addController(st);
   rootNode.attachChild(s);
    }
}