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.