渲染类,游戏引擎交互场景,可以通过场景设置与游戏引擎的连接方式,渲染和移除物体,也可使用场景内置方法,如:快速移动到目标位置、巡游等等
new CloudRenderApp(config)
参数说明:
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
object | 配置信息 Properties
|
父类
- EventDispatcher
方法
SetPlanePOIMode(options)
设置非球面视角POI显示模式
参数说明:
Name | Type | Description | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
选项 Properties
|
Swtich3DTilesMode(options)
切换指定3dtiles的渲染模式
参数说明:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
options |
参数 Properties
|
addToScene(obj)
动态添加obj到场景
参数说明:
Name | Type | Description |
---|---|---|
obj |
* | 需要被添加的对象 |
buildingGrowthAnimate(options)
建筑生长动画效果
参数说明:
Name | Type | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object | 动画选项 Properties
|
||||||||||||||||||||||||||||||
option.ColorHeight |
number | 建筑切割区域厚度,默认为100, 单位厘米 |
changeResolution(width, height)
改变分辨率
参数说明:
Name | Type | Description |
---|---|---|
width |
number | 宽度 |
height |
number | 高度 |
changeTime(hour, minute)
根据目标时间修改时间
参数说明:
Name | Type | Default | Description |
---|---|---|---|
hour |
number |
8
|
24小时制,例如:22表示晚上10点 |
minute |
number |
10
|
60分钟制,例如:30表示30分 |
changeWeather(weatherType)
根据传入的UDS字段来设置天气类型
参数说明:
Name | Type | Description |
---|---|---|
weatherType |
* | UDS字段 |
closeEdit()
关闭编辑,关闭后通过editResult事件返回绘制信息,建议在此方法之前添加editResult事件,否则首次无法获取信息
destoryObject(obj)
销毁物体,并释放内存
参数说明:
Name | Type | Description |
---|---|---|
obj |
* |
enable3DTilesByName(options)
通过名称启用或禁用3dtiles
参数说明:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
options |
选项 Properties
|
enableDataLayerByName(dataLayerName, visible)
开关数据层的显示根据名称
参数说明:
Name | Type | Description |
---|---|---|
dataLayerName |
string | 图层或者数据层名字 |
visible |
boolean | 显隐 |
enableEdit(drawOrMeasure, type, style)
开始编辑绘制
参数说明:
Name | Type | Description |
---|---|---|
drawOrMeasure |
string | 是绘制还是量测,默认值 draw,可选measure |
type |
type | 类型。点线面,可选point,line,polygon,measurearea,measureline,locationpoint,surfaceline |
style |
object | 样式配置 |
eventListenerUpdate(obj)
更新事件监听器
参数说明:
Name | Type | Description |
---|---|---|
obj |
对象 |
excuteEngineConsoleCommand(command)
执行UE的控制台命令
参数说明:
Name | Type | Description |
---|---|---|
command |
要执行的命令 |
exit()
退出客户端系统
focusOn(object, options)
移动相机和视口到给定物体的区域,会根据物体的包围盒自动计算最佳视口,也可以设置最终相机的状态和移动过程的事件,轨迹等参数,如果给了回调函数,移动过程技术后,会触发回调函数
参数说明:
Name | Type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
object |
object | 物体(必选) |
|||||||||||||||||||||
options |
object | {duration,preload,index,rotation,flyOverLongitude,callback} Properties
|
getAltitudeFromCoordinate(params, callback)
获取指定坐标位置的高程
参数说明:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
Properties
|
|||||||||
callback |
* | 返回结果的回调函数 |
hidden3DTilesItem(options)
隐藏3dtiles中的部分元素
参数说明:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
options |
选项 Properties
|
initCamera()
初始化相机,并监听相机回调
initObjectBBox()
初始化拾取物体的包围盒
interval()
定时更新
moveCamera(options)
移动摄像机
参数说明:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object | 包含以下参数: Properties
|
moveTo(location, rotation, options)
移动相机和视口到给定位置,可以设置最终相机的状态和移动过程的事件,轨迹等参数,如果给了回调函数,移动过程技术后,会触发回调函数
参数说明:
Name | Type | Description | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
location |
object | 目标点的经纬度坐标值{x,y,z}或者Vector3,单位度,(必选) |
|||||||||||||||||||||||||||||||||
rotation |
object | {roll,pitch,yaw} 翻滚角,俯仰角,平扫角,默认为{roll:0,pitch:0,yaw:0} |
|||||||||||||||||||||||||||||||||
options |
object | {duration,preload,detectLength,flyOverLongitude,zoom,callback} Properties
|
navigateByKeypoints(points, options)
根据关键点进行路径巡航
参数说明:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
points |
Array | 经纬度坐标点数组,[[lon,lat,alt,roll,pitch,yaw],[lon,lat,alt,roll,pitch,yaw],[lon,lat,alt,roll,pitch,yaw],[lon,lat,alt,roll,pitch,yaw]] |
||||||||||||||||||||||||||||||||||||
options |
object |
Properties
|
pauseNavigation(options)
暂停巡航
参数说明:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
options |
object |
Properties
|
project(vector, callback)
世界坐标转屏幕坐标
world space into the camera's normalized device coordinate (NDC)
参数说明:
Name | Type | Description |
---|---|---|
vector |
object | 经纬度坐标{x:,y:,z:} |
callback |
function | 计算结果回调函数 |
removeAllEditObjects(drawOrMeasure, classes)
移除所有的编辑几何体
参数说明:
Name | Type | Default | Description |
---|---|---|---|
drawOrMeasure |
string |
all
|
全部测绘还是绘制项或量测项,默认值 all,可选measure,draw,all |
classes |
string | 删除形状类型,默认值 ['point', 'line', 'polygon', 'surfaceLine'] |
removeAllFromScene()
从场景中移除所有物体,并销毁
removeFromScene(obj)
从场景中移除物体,并销毁
参数说明:
Name | Type | Description |
---|---|---|
obj |
* |
restartGame()
回到场景初始状态
restartLevel()
关卡重置,已弃用
resumeNavigation(options)
继续巡航
参数说明:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
options |
object |
Properties
|
rotateCamera(options)
移动摄像机
参数说明:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object | 包含以下参数: Properties
|
sendStringBufferData(messageType, descriptorString, total, index)
将数据转成arrayBuffer发送到UE
参数说明:
Name | Type | Default | Description |
---|---|---|---|
messageType |
number | 消息类型(必选) |
|
descriptorString |
string | 消息(必选) |
|
total |
number |
1
|
总传输次数 |
index |
number |
1
|
当前传输次数 |
setFPS(status)
设置帧率
参数说明:
Name | Type | Default | Description |
---|---|---|---|
status |
false
|
是否显示帧率,默认为false |
setWorldCenterPoint(longitude, latitude, altitude)
设置场景中心点位置
参数说明:
Name | Type | Default | Description |
---|---|---|---|
longitude |
number | 经度 |
|
latitude |
number | 纬度 |
|
altitude |
number |
10
|
高度 |
setupModelInfo(url, body, header, staticResourceURL)
获取资产管理平台所有模型信息
参数说明:
Name | Type | Description |
---|---|---|
url |
string | 地址,必须 |
body |
object | 模型信息请求体内容,必须 |
header |
object | 模型信息请求header,可选 |
staticResourceURL |
string | 静态资源地址请求url,可选 |
stopNavigation(options)
终止巡航
参数说明:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
Properties
|
unproject(vector, callback)
屏幕坐标转世界坐标
the camera's normalized device coordinate (NDC) space into world space
参数说明:
Name | Type | Description |
---|---|---|
vector |
object | 屏幕坐标{x:,y:} |
callback |
function | 计算结果回调函数 |
zoomIn(multiplier)
缩进
参数说明:
Name | Type | Default | Description |
---|---|---|---|
multiplier |
1
|
缩进倍数,默认为1 |
zoomOut(multiplier)
缩远
参数说明:
Name | Type | Default | Description |
---|---|---|---|
multiplier |
1
|
缩小的倍数,默认为1 |
- 参数说明
- 父类
- 方法
- SetPlanePOIMode
- Swtich3DTilesMode
- addToScene
- buildingGrowthAnimate
- changeResolution
- changeTime
- changeWeather
- closeEdit
- destoryObject
- enable3DTilesByName
- enableDataLayerByName
- enableEdit
- eventListenerUpdate
- excuteEngineConsoleCommand
- exit
- focusOn
- getAltitudeFromCoordinate
- hidden3DTilesItem
- initCamera
- initObjectBBox
- interval
- moveCamera
- moveTo
- navigateByKeypoints
- pauseNavigation
- project
- removeAllEditObjects
- removeAllFromScene
- removeFromScene
- restartGame
- restartLevel
- resumeNavigation
- rotateCamera
- sendStringBufferData
- setFPS
- setWorldCenterPoint
- setupModelInfo
- stopNavigation
- unproject
- zoomIn
- zoomOut