Hi guys. I have my main flycam viewport (default), and a second viewport (minimap) in the bottom right of the screen. The second viewport is parallel to the first, so simply mimics the main camera. I have this code to complete a motion path.
[java]
path = new MotionPath();
for (int i = 0; i < vList.size(); i++) {
path.addWayPoint(vList.get(i));
}
//cam.setLocation(fromVector);
player.setPhysicsLocation(fromVector);
camNode = new CameraNode("Motion cam", cam);
camNode.setControlDir(ControlDirection.SpatialToCamera);
camNode.setEnabled(false);
path.setCurveTension(0.83f);
cameraMotionControl = new MotionEvent(camNode, path);
rootNode.attachChild(camNode);
flyCam.setEnabled(false);
camNode.setEnabled(true);
cameraMotionControl.setSpeed(2.5f);
cameraMotionControl.setDirectionType(MotionEvent.Direction.Path);
cameraMotionControl.play();
path.addListener(new MotionPathListener() {
public void onWayPointReach(MotionEvent control, int wayPointIndex) {
if (path.getNbWayPoints() == wayPointIndex + 1) {
if (pathHighlight) {
removePathH();
flyCam.setEnabled(true);
cam.update();
}
//wayPointsText.setText(control.getSpatial().getName() + " Finish!!! ");
} else {
player.setPhysicsLocation(cam.getLocation());
}
//wayPointsText.setLocalTranslation((cam.getWidth() - wayPointsText.getLineWidth()) / 2, cam.getHeight(), 0);
}
});
[/java]
However, once it has finished I can’t seem to regain control of the scene with the original camera? When it’s finished, moving is still reflected in the second viewport, but the main viewport is stuck.