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 scene
Scene 场景对象
options
Object 选项对象:
Properties
Name Type Argument Description destination
Cartesian3 目标位置.
orientation
Object <optional>
目标朝向: {direction:,up:} 或 {heading:,pitch:}.
duration
Number <optional>
飞行时间.
complete
Camera~FlightCompleteCallback <optional>
完成时执行的回调函数.
cancel
Camera~FlightCancelledCallback <optional>
取消时执行的回调函数.
easingFunction
EasingFunction | EasingFunction~Callback <optional>
插值方法.
-
<static> flyToBoundingSphere(scene, options)
-
相机飞行
Parameters:
Name Type Description scene
Scene 场景对象
options
Object 选项对象:
Properties
Name Type Argument Description destination
Cartesian3 目标位置.
duration
Number <optional>
飞行时间.
offset
HeadingPitchRange <optional>
The offset from the target in the local east-north-up reference frame centered at the target.
complete
Camera~FlightCompleteCallback <optional>
完成时执行的回调函数.
cancel
Camera~FlightCancelledCallback <optional>
取消时执行的回调函数.
easingFunction
EasingFunction | EasingFunction~Callback <optional>
插值方法.
-
<static> lookAt(camera, target, offset)
-
设置相机视角
Parameters:
Name Type Description camera
Camera 相机对象
target
Cartesian3 看向的位置.
offset
Cartesian3 | HeadingPitchRange 相对target的偏移.
-
<static> setView(camera, options)
-
设置相机视角
Parameters:
Name Type Description camera
Camera 相机对象
options
Object 选项对象:
Properties
Name Type Argument Description destination
Cartesian3 目标位置.
orientation
Object <optional>
目标朝向: {direction:,up:} 或 {heading:,pitch:}.