TimeDynamicPointCloud

new Cesium.TimeDynamicPointCloud(options)

提供时间动态点云数据的播放功能。

点云帧按照由平均帧加载时间和当前时钟速度决定的间隔进行预取。 如果中间帧无法及时加载以满足播放速度,它们将被跳过。如果帧足够 小或时钟足够慢,则不会跳过任何帧。

Name Type Description
options object Object with the following properties:
Name Type Default Description
clock Clock 一个 Clock 实例,用于在确定时间维度的值时使用。
intervals TimeIntervalCollection 一个 TimeIntervalCollection,其 data 属性为一个对象,包含指向 3D Tiles 点云瓦片的 uri 以及一个可选的 transform
show boolean true optional 确定是否显示该点云。
modelMatrix Matrix4 Matrix4.IDENTITY optional 变换该点云的 4x4 变换矩阵。
shadows ShadowMode ShadowMode.ENABLED optional 确定该点云是否投射或接收来自光源的阴影。
maximumMemoryUsage number 256 optional 该点云可使用的最大内存(以 MB 为单位)。
shading object optional 用于构造 PointCloudShading 对象的选项,以控制点衰减和眼睛穹顶光照。
style Cesium3DTileStyle optional 应用于点云中每个点的样式,使用 3D Tiles 样式语言 定义。
clippingPlanes ClippingPlaneCollection optional 用于选择性禁用点云渲染的 ClippingPlaneCollection

Members

正在渲染的帧的包围球。如果没有正在渲染的帧,则返回 undefined
用于选择性禁用点云渲染的 ClippingPlaneCollection
指示已渲染新帧时触发的事件。

时间动态点云 TimeDynamicPointCloud 会传递给事件监听器。

Default Value: new Event()
Example:
pointCloud.frameChanged.addEventListener(function(timeDynamicPointCloud) {
    viewer.camera.viewBoundingSphere(timeDynamicPointCloud.boundingSphere);
});
指示某帧加载失败而触发的事件。如果对其 uri 的请求失败,或由于内容无效导致处理失败, 该帧可能无法加载。

如果没有事件监听器,错误消息将被记录到控制台。

传递给监听器的错误对象包含两个属性:

  • uri:失败帧的 uri。
  • message:错误消息。
Default Value: new Event()
Example:
pointCloud.frameFailed.addEventListener(function(error) {
    console.log(`An error occurred loading frame: ${error.uri}`);
    console.log(`Error: ${error.message}`);
});
可用于缓存点云帧的最大 GPU 内存量(以 MB 为单位)。

未处于加载或渲染状态的帧将被卸载以强制执行此限制。

如果减小此值导致瓦片被卸载,这些瓦片将在下一帧被卸载。

Default Value: 256
See:
变换该点云的 4x4 变换矩阵。
Default Value: Matrix4.IDENTITY
基于几何误差和眼睛穹顶光照控制点大小的选项。
确定该点云是否投射或接收来自光源的阴影。

Enabling shadows has a performance impact. A point cloud that casts shadows must be rendered twice, once from the camera and again from the light's point of view.

Shadows are rendered only when Viewer#shadows is true.

Default Value: ShadowMode.ENABLED
确定是否显示该点云。
Default Value: true
应用于点云中每个点的样式,使用 3D Tiles 样式语言 定义。

Assign undefined to remove the style, which will restore the visual appearance of the point cloud to its default when no style was applied.

Example:
pointCloud.style = new Cesium.Cesium3DTileStyle({
   color : {
       conditions : [
           ['${Classification} === 0', 'color("purple", 0.5)'],
           ['${Classification} === 1', 'color("red")'],
           ['true', '${COLOR}']
       ]
   },
   show : '${Classification} !== 2'
});
See:

readonly totalMemoryUsageInBytes : number

该点云使用的 GPU 内存总量(以字节为单位)。
See:

Methods

销毁此对象持有的 WebGL 资源。销毁对象可以实现对 WebGL 资源的确定性 释放,而不是依赖垃圾回收器来销毁此对象。

对象一旦被销毁就不应再使用;调用除 isDestroyed 以外的任何函数都将导致 DeveloperError 异常。因此, 应像示例中那样将返回值(undefined)赋给该对象。
Throws:
Example:
pointCloud = pointCloud && pointCloud.destroy();
See:
如果此对象已被销毁则返回 true,否则返回 false。

如果此对象已被销毁,则不应再使用;调用除 isDestroyed 以外的任何函数都将导致 DeveloperError 异常。
Returns:
true 表示此对象已被销毁,否则为 false
See:
将点云的 TimeDynamicPointCloud#style 标记为脏,从而强制所有 点在下一帧重新评估样式。
需要帮助?获取答案的最快方式是在 Cesium 论坛 上向社区和团队提问。