English中文

TimeDynamicPointCloud

new Cesium.TimeDynamicPointCloud(options)

提供时间动态点云数据的回放。 Provides playback of time-dynamic point cloud data.

点云帧的预取间隔由平均帧加载时间和当前时钟速度确定。如果中间帧无法及时加载以满足播放速度,则会跳过它们。如果帧足够小或者时钟足够慢,则不会跳过任何帧。 Point cloud frames are prefetched in intervals determined by the average frame load time and the current clock speed. If intermediate frames cannot be loaded in time to meet playback speed, they will be skipped. If frames are sufficiently small or the clock is sufficiently slow then no frames will be skipped.

名称 Name 类型 Type 说明 Description
options object 具有以下属性的对象: Object with the following properties:
名称 Name 类型 Type 默认值 Default 说明 Description
clock Clock A Clock 确定时间维度的值时使用的实例。 instance that is used when determining the value for the time dimension.
intervals TimeIntervalCollection A TimeIntervalCollection 其 data 属性是一个包含 with its data property being an object containing a uri 到 3D 平铺点云平铺和可选的 to a 3D Tiles Point Cloud tile and an optional transform.
show boolean true 可选 optional 确定是否显示点云。 Determines if the point cloud will be shown.
modelMatrix Matrix4 Matrix4.IDENTITY 可选 optional 变换点云的 4x4 变换矩阵。 A 4x4 transformation matrix that transforms the point cloud.
shadows ShadowMode ShadowMode.ENABLED 可选 optional 确定点云是否投射或接收来自光源的阴影。 Determines whether the point cloud casts or receives shadows from light sources.
maximumMemoryUsage number 256 可选 optional 点云可以使用的最大内存量(以 MB 为单位)。 The maximum amount of memory in MB that can be used by the point cloud.
shading object 可选 optional 构建选项 Options for constructing a PointCloudShading 控制点衰减和眼顶照明的对象。 object to control point attenuation and eye dome lighting.
style Cesium3DTileStyle 可选 optional 样式,使用定义 The style, defined using the 3D Tiles Styling language,应用于点云中的每个点。 , applied to each point in the point cloud.
clippingPlanes ClippingPlaneCollection 可选 optional The ClippingPlaneCollection 用于选择性地禁用点云渲染。 used to selectively disable rendering the point cloud.

成员 Members

正在渲染的帧的边界球体。退货 The bounding sphere of the frame being rendered. Returns undefined 如果没有渲染任何帧。 if no frame is being rendered.
The ClippingPlaneCollection 用于选择性地禁用点云渲染。 used to selectively disable rendering the point cloud.
触发该事件以指示渲染了新帧。 The event fired to indicate that a new frame was rendered.

时间动态点云 The time dynamic point cloud TimeDynamicPointCloud 被传递给事件监听器。 is passed to the event listener.

默认值: Default Value: new Event()
示例: Example:
pointCloud.frameChanged.addEventListener(function(timeDynamicPointCloud) {
    viewer.camera.viewBoundingSphere(timeDynamicPointCloud.boundingSphere);
});
触发该事件以指示帧加载失败。如果对其 uri 的请求失败或由于内容无效而导致处理失败,则框架可能无法加载。 The event fired to indicate that a frame failed to load. A frame may fail to load if the request for its uri fails or processing fails due to invalid content.

如果没有事件侦听器,错误消息将记录到控制台。 If there are no event listeners, error messages will be logged to the console.

传递给侦听器的错误对象包含两个属性: The error object passed to the listener contains two properties:

  • uri:失败帧的 uri。 : the uri of the failed frame.
  • message: 错误信息。 : the error 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 为单位)。 The maximum amount of GPU memory (in MB) that may be used to cache point cloud frames.

未加载或渲染的帧将被卸载以强制执行此操作。 Frames that are not being loaded or rendered are unloaded to enforce this.

如果减小该值会导致卸载图块,则将在下一帧卸载图块。 If decreasing this value results in unloading tiles, the tiles are unloaded the next frame.

默认值: Default Value: 256
另见: See:
变换点云的 4x4 变换矩阵。 A 4x4 transformation matrix that transforms the point cloud.
默认值: Default Value: Matrix4.IDENTITY
用于根据几何误差和眼罩照明控制点大小的选项。 Options for controlling point size based on geometric error and eye dome lighting.
确定点云是否投射或接收来自光源的阴影。 Determines whether the point cloud casts or receives shadows from light sources.

启用阴影会对性能产生影响。投射阴影的点云必须渲染两次,一次从相机渲染,另一次从灯光的角度渲染。 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
确定是否显示点云。 Determines if the point cloud will be shown.
默认值: Default Value: true
样式,使用定义 The style, defined using the 3D Tiles Styling language,应用于点云中的每个点。 , applied to each point in the point cloud.

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 内存总量(以字节为单位)。 The total amount of GPU memory in bytes used by the point cloud.
另见: See:

方法 Methods

销毁该对象持有的 WebGL 资源。销毁对象可以确定性地释放 WebGL 资源,而不是依赖垃圾收集器来销毁该对象。 Destroys the WebGL resources held by this object. Destroying an object allows for deterministic release of WebGL resources, instead of relying on the garbage collector to destroy this object.

一旦对象被销毁,就不应再使用;调用除 Once an object is destroyed, it should not be used; calling any function other than isDestroyed 将导致 will result in a DeveloperError 例外。因此,分配返回值( exception. Therefore, assign the return value (undefined) 到对象,如示例中所做的那样。 ) to the object as done in the example.
抛出: Throws:
  • DeveloperError : This object was destroyed, i.e., destroy() was called.
示例: Example:
pointCloud = pointCloud && pointCloud.destroy();
另见: See:
如果该对象被销毁则返回 true;否则为假。 Returns true if this object was destroyed; otherwise, false.

如果该对象被破坏,则不应使用它;调用除 If this object was destroyed, it should not be used; calling any function other than isDestroyed 将导致 will result in a DeveloperError exception.
返回: Returns:
true 如果该物体被摧毁;否则, if this object was destroyed; otherwise, false.
另见: See:
标记点云的 Marks the point cloud's TimeDynamicPointCloud#style 为脏,这会迫使所有点重新评估下一帧中的样式。 as dirty, which forces all points to re-evaluate the style in the next frame.
需要帮助吗?获得答案的最快方法是从社区和团队那里获得答案 Need help? The fastest way to get answers is from the community and team on the Cesium Forum.