在三维场景中,选择了起始点和结束点后,然后沿线路飞行。在球面场景中可以实现此功能的代码,但是在平面场景中却无法实现。主要显示为,飞行时贴着平面场景的边缘飞行,到达目的地是再跳转到目的地。怎么办呢。
public FlyManager CurrentFlyManager
{
get
{
FlyManager currentFlyManager = null;
if (m_sceneControl.Scene.FlyManager != null)
{
currentFlyManager = m_sceneControl.Scene.FlyManager;
}
return currentFlyManager;
}
}
// 开始飞行
public void BeginFly(Double speed, Boolean isCircle)
{
CurrentFlyManager.Routes.Clear();
Route route = new Route();
route.FromGeoLine3D(m_line3D);
route.IsAltitudeFixed = false;
route.IsFlyAlongTheRoute = true;
route.IsHeadingFixed = false;
route.IsTiltFixed = false;
route.IsStopsVisible = false;
route.IsFlyingLoop = isCircle;
route.Speed = speed;
for (int i = 0; i < route.Stops.Count; i++)
{
Camera camera = route.Stops[i].Camera;
camera.Altitude = 11.9;
camera.Tilt = 60;
camera.Heading = 90;
route.Stops[i].Camera = camera;
route.Stops[i].TurnTime = 0.2;
}
CurrentFlyManager.Routes.Add(route);
Camera sceneCamera = new Camera(route.Stops[0].Camera.Longitude, route.Stops[0].Camera.Latitude, 300);
sceneCamera.Tilt = 45;
m_sceneControl.Scene.Camera = sceneCamera;
CurrentFlyManager.Play();
}