new FdPlaneViewCameraHelper()
无球场景下相机操作辅助类
Camera的一些设置函数如heading、pitch、lookAt、setView、flyTo等,由于其计算逻辑与椭球体相关,在无球的笛卡尔坐标系下不可用 为在无球的笛卡尔坐标系下提供类似的操作封装本类
方向角定义: 1.坐标系X轴正向朝东,Y轴正向朝北,Z轴正向朝上 2.偏航角(heading):相机方向与正北向的夹角,偏东为正 3.俯仰角(pitch):相机方向与水平面的夹角,向上为正
Example
Freedo.FdCamera.FdPlaneViewCameraHelper.flyToBoundingSphere(viewer.scene, tileset.boundingSphere, {
offset: new Freedo.HeadingPitchRange(0.0, -0.5, 0.0),
duration: 0.0
});
Methods
-
<static> cancelFlight()
-
取消相机飞行
-
<static> flyTo(scene, options)
-
相机飞行
Parameters:
Name Type Description sceneScene 场景对象
optionsObject 选项对象:
Properties
Name Type Argument Description destinationCartesian3 目标位置.
orientationObject <optional>
目标朝向: {direction:,up:} 或 {heading:,pitch:}.
durationNumber <optional>
飞行时间.
completeCamera~FlightCompleteCallback <optional>
完成时执行的回调函数.
cancelCamera~FlightCancelledCallback <optional>
取消时执行的回调函数.
easingFunctionEasingFunction | EasingFunction~Callback <optional>
插值方法.
-
<static> flyToBoundingSphere(scene, options)
-
相机飞行
Parameters:
Name Type Description sceneScene 场景对象
optionsObject 选项对象:
Properties
Name Type Argument Description destinationCartesian3 目标位置.
durationNumber <optional>
飞行时间.
offsetHeadingPitchRange <optional>
The offset from the target in the local east-north-up reference frame centered at the target.
completeCamera~FlightCompleteCallback <optional>
完成时执行的回调函数.
cancelCamera~FlightCancelledCallback <optional>
取消时执行的回调函数.
easingFunctionEasingFunction | EasingFunction~Callback <optional>
插值方法.
-
<static> lookAt(camera, target, offset)
-
设置相机视角
Parameters:
Name Type Description cameraCamera 相机对象
targetCartesian3 看向的位置.
offsetCartesian3 | HeadingPitchRange 相对target的偏移.
-
<static> setView(camera, options)
-
设置相机视角
Parameters:
Name Type Description cameraCamera 相机对象
optionsObject 选项对象:
Properties
Name Type Argument Description destinationCartesian3 目标位置.
orientationObject <optional>
目标朝向: {direction:,up:} 或 {heading:,pitch:}.