MotionPath LoopMode not working?

Hi!
Playing around with MotionEvents I noticed, that it seems not to make a difference, if I set the events LoopMode to Cycle or to Loop. When setting it to Cycle, it should go backwards as soon as it reaches the last waypoint (as far as I understood), but it doesn’t.
A quick test-case:
[java]public class MotionPathTest extends SimpleApplication
{

public static void main(String[] args)
{
    new MotionPathTest().start();
}

MotionEvent event1,event2;
MotionPath path1 = new MotionPath();
Geometry geom = new Geometry("box", new Box(1, 2, 1));
Geometry geom2 = new Geometry("sphere", new Sphere(10, 20, 2));

@Override
public void simpleInitApp()
{
    cam.setLocation(new Vector3f(-17.273403f, -2.209958f, 73.43029f));
    cam.lookAt(geom.getWorldTranslation(), Vector3f.UNIT_Y);
    path1.addWayPoint(Vector3f.ZERO);
    path1.addWayPoint(new Vector3f(30, 0, 0));
    path1.addWayPoint(new Vector3f(30, 30, 0));
    path1.addWayPoint(new Vector3f(30, 30, 30));
    path1.addWayPoint(new Vector3f(0, 30, 30));
    path1.addWayPoint(new Vector3f(0, 0, 30));
    event1=new MotionEvent(geom, path1, LoopMode.Loop);
    event2=new MotionEvent(geom2, path1, LoopMode.Cycle);
    event1.setSpeed(2);
    event2.setSpeed(2.5f);
    event1.getPath().setPathSplineType(Spline.SplineType.CatmullRom);
    path1.enableDebugShape(assetManager, rootNode);
    flyCam.setMoveSpeed(100);
    geom.setMaterial(new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"));
    geom2.setMaterial(new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"));
    rootNode.attachChild(geom);
    rootNode.attachChild(geom2);
    event1.play();
    event2.play();
}

}[/java]
Do I do anything wrong (if so, what exactly?) or is it a bug?
Thank you.

1 Like

Looks like a bug, it was working at some point. i’m gonna look into it.
Thanks for the test case.

2 Likes

Hi again,
I hope I’m not bugging you but has it been fixed?
Before asking I searched in the issue-tracker of the google-code project but couldn’t find anything according to this topic.
If it has been fixed, will the next stable release be out during the next weeks / couple of months?
I’m not in a hurry and I know you probably can’t / don’t want to name specific times, but I would really like using the cycling-feature.

Thank you.

I didn’t look into it, but now i did…
It should work in last SVN.

1 Like