# TimeDynamicPointCloud

#### new Cesium.TimeDynamicPointCloud(options)
Scene/TimeDynamicPointCloud.js 43

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` with its data property being an object containing a `uri` 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 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 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

#### readonly boundingSphere : BoundingSphere
Scene/TimeDynamicPointCloud.js 237

The bounding sphere of the frame being rendered. Returns `undefined` if no frame is being rendered.

#### clippingPlanes : ClippingPlaneCollection
Scene/TimeDynamicPointCloud.js 204

The `ClippingPlaneCollection` used to selectively disable rendering the point cloud.

#### frameChanged : Event
Scene/TimeDynamicPointCloud.js 169

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);
    });

#### frameFailed : Event
Scene/TimeDynamicPointCloud.js 154

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`: 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);
    });

#### maximumMemoryUsage : Number
Scene/TimeDynamicPointCloud.js 97

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:

- TimeDynamicPointCloud#totalMemoryUsageInBytes

#### modelMatrix : Matrix4
Scene/TimeDynamicPointCloud.js 65

A 4x4 transformation matrix that transforms the point cloud.

Default Value: `Matrix4.IDENTITY`

#### readonly readyPromise : Promise.<TimeDynamicPointCloud>
Scene/TimeDynamicPointCloud.js 254

Gets the promise that will be resolved when the point cloud renders a frame for the first time.

#### shading : PointCloudShading
Scene/TimeDynamicPointCloud.js 103

Options for controlling point size based on geometric error and eye dome lighting.

#### shadows : ShadowMode
Scene/TimeDynamicPointCloud.js 81

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`

#### show : Boolean
Scene/TimeDynamicPointCloud.js 57

Determines if the point cloud will be shown.

Default Value: `true`

#### style : Cesium3DTileStyle
Scene/TimeDynamicPointCloud.js 130

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:

- 3D Tiles Styling language

#### readonly totalMemoryUsageInBytes : Number
Scene/TimeDynamicPointCloud.js 223

The total amount of GPU memory in bytes used by the point cloud.

##### See:

- TimeDynamicPointCloud#maximumMemoryUsage

### Methods

#### destroy()
Scene/TimeDynamicPointCloud.js 809

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:

- TimeDynamicPointCloud#isDestroyed

#### isDestroyed() → Boolean
Scene/TimeDynamicPointCloud.js 790

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:

- TimeDynamicPointCloud#destroy

#### makeStyleDirty()
Scene/TimeDynamicPointCloud.js 283

Marks the point cloud's `TimeDynamicPointCloud#style` as dirty, which forces all points to re-evaluate the style in the next frame.