Hey everybody,
I will create more than one path in jMonkey and give them all the same properties. So I thought I could add them together like in a “super path” but I don’t know how. Can you help me?
[java]public void simpleInitApp() {
createScene();
cam.setLocation(new Vector3f(-15f, 20f, 63f));
// cam.lookAtDirection(0,10,0);
path1 = new MotionPath();
path1.addWayPoint(new Vector3f(0, 10, 0));
path1.addWayPoint(new Vector3f(0, 10, 10));
path1.addWayPoint(new Vector3f(10, 10, 10));
path1.addWayPoint(new Vector3f(10, 10, 12));
path1.enableDebugShape(assetManager, rootNode);
path2 = new MotionPath();
path2.addWayPoint(new Vector3f(0, 10, 0));
path2.addWayPoint(new Vector3f(0, 10, 10));
path2.addWayPoint(new Vector3f(10, 10, 10));
path2.addWayPoint(new Vector3f(10, 10, 8));
path.attachChild(path1); //Doesn't work
path.attachChild(path2);
motionControl = new MotionEvent(drohne,path1);
motionControl.setDirectionType(MotionEvent.Direction.PathAndRotation);
motionControl.setRotation(new Quaternion().fromAngleNormalAxis(-FastMath.HALF_PI, Vector3f.UNIT_Y));
motionControl.setInitialDuration(10f);
motionControl.setSpeed(2f);
guiFont = assetManager.loadFont("Interface/Fonts/Default.fnt");
final BitmapText wayPointsText = new BitmapText(guiFont, false);
wayPointsText.setSize(guiFont.getCharSet().getRenderedSize());[/java]
Thanks a lot!