Camera
camera.focus聚焦相机到对象输入
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
target | string | 是 | ObjectId | 场景中的任意对象 |
tag | string | 是 | — | — |
attach | string | 是 | default | default/true/false,目标是相机对象并且相机是子物体才能吸附 可选值: defaulttruefalse |
调用
typescript
piclient.emit("camera.focus",{
target: "ObjectId", //场景中的任意对象id target和tag二选一填写就可以
tag: "",//场景中的任意对象标记
attach: "default", //default/true/false,目标是相机对象并且相机是子物体才能吸附
})
camera.fly相机飞行输入
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
target | string | 是 | ObjectId | 场景中的任意对象 |
tag | string | 是 | — | — |
engine | string | 是 | 0.0, 0.0, 0.0 | 引擎坐标 |
rotation | string | 是 | 0.0, 0.0, 0.0 | 旋转 roll, pitch, yaw的角度值 |
geo | string | 否 | 0.0, 0.0, 0.0 | 经度,纬度,高程 组成的格式,高程可选 |
time | string | 是 | 3.0 | 飞行时长,单位秒 |
调用
typescript
piclient.emit("camera.fly",{
target: "", //场景中的任意对象
tag: "",
engine: "0.0, 0.0, 0.0", //引擎坐标
rotation: "0.0, 0.0, 0.0", //旋转 roll, pitch, yaw的角度值
geo: "0.0, 0.0, 0.0", //经度,纬度,高程 组成的格式,高程可选
time: "3.0", //飞行时长,单位秒
})
camera.animControl相机动画控制相机动画控制,设置动画时长,播放,暂停,停止
输入
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
target | string | 是 | ObjectId | 场景中的任意对象 |
totalTime | string | 是 | 3.5 | 动画的播放时长 |
bFromStart | string | 是 | true | 是否从头开始播放 |
playState | string | 是 | toggle | 动画的播放状态stop/pause/play/toggle 可选值: stoppauseplaytoggle |
调用
typescript
piclient.emit("camera.animControl",{
target: "ObjectId", //场景中的任意对象
totalTime: "3.5", //动画的播放时长
bFromStart: "true", //是否从头开始播放
playState: "toggle", //动画的播放状态stop/pause/play/toggle
})
camera.cameraSpeed相机-移动速度相机移动速度
输入
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
cameraSpeed | string | 是 | 4.0 | 相机移动速率调整 |
调用
typescript
piclient.emit("camera.cameraSpeed",{
cameraSpeed: "4.0", //相机移动速率调整
})
camera.setViewMode相机-视角模式视角模式,漫游,第一人称,第三人称,无人机
输入
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
viewMode | string | 是 | auto | auto/fpp/tpp/drone/ 自由视角漫游-auto,第一人称-fpp,第三人称-tpp,无人机视角-drone 可选值: autofpptppdrone |
调用
typescript
piclient.emit("camera.setViewMode",{
viewMode: "auto",//auto/fpp/tpp/drone/ 自由视角漫游-auto,第一人称-fpp,第三人称-tpp,无人机视角-drone
})
camera.setObserverMode相机-观察模式局部观察物体模式
输入
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
target | string | 是 | ObjectName | 场景中的物体 |
调用
typescript
piclient.emit("camera.setObserverMode",{
target: "ObjectName", //场景中的物体
})
camera.lookAt相机观察物体相机_观察物体
输入
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
target | string | 是 | ObjectId | 场景中的任意对象 |
tag | string | 是 | — | — |
offset | string | 是 | 0.0, 0.0, 0.0 | 引擎坐标cm(0,0,0) |
time | string | 是 | 3.0 | 飞行时长,单位秒 |
调用
typescript
piclient.emit("camera.lookAt",{
target: "ObjectId", //场景中的任意对象
tag: "",
offset: "0.0, 0.0, 0.0", //引擎坐标cm(0,0,0)
time: "3.0", //飞行时长,单位秒
})
camera.info相机信息相机_信息
输入
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
status | boolean | 是 | true | true |
调用
typescript
piclient.emit("camera.info",{
status: true, //true
})
camera.toggleVRMode相机-VR模式VR操作模式,进入,退出
输入
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
enter | string | 是 | true | 进入VR模式 |
调用
typescript
piclient.emit("camera.toggleVRMode",{
enter: "true", //进入VR模式
})
camera.move相机移动相机_移动
输入
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
MoveForward | string | 是 | 1.0 | 单位cm |
MoveRight | string | 是 | 1.0 | 单位cm |
MoveHeight | string | 是 | 1.0 | 单位cm |
调用
typescript
piclient.emit("camera.move",{
MoveForward: "1.0", //单位cm
MoveRight: "1.0", //单位cm
MoveHeight: "1.0", //单位cm
})
camera.Rotate相机旋转相机_旋转
输入
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
RotateX | string | 是 | 1.0 | 角度 |
RotateY | string | 是 | 1.0 | 角度 |
调用
typescript
piclient.emit("camera.Rotate",{
RotateX: "1.0", //角度
RotateY: "1.0", //角度
})
camera.zoom相机-缩放控制相机缩放值
输入
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
value | number | 是 | 0.0 | 缩放值 |
调用
typescript
piclient.emit("camera.zoom",{
value: 0.0, //缩放值
})