# VoxelCell

#### new Cesium.VoxelCell(primitive, tileIndex, sampleIndex)
engine/Source/Scene/VoxelCell.js 39

A cell from a `VoxelPrimitive`.

Provides access to properties associated with one cell of a voxel primitive.

Do not construct this directly. Access it through picking using `Scene#pickVoxel`.

Name | Type | Description
--- | --- | ---
`primitive` | VoxelPrimitive | The voxel primitive containing the cell
`tileIndex` | number | The index of the tile
`sampleIndex` | number | The index of the sample within the tile, containing metadata for this cell

##### Example:

    // On left click, display all the properties for a voxel cell in the console log.
    handler.setInputAction(function(movement) {
      const voxelCell = scene.pickVoxel(movement.position);
      if (voxelCell instanceof Cesium.VoxelCell) {
        const propertyIds = voxelCell.getPropertyIds();
        const length = propertyIds.length;
        for (let i = 0; i < length; ++i) {
          const propertyId = propertyIds[i];
          console.log(`{propertyId}: ${voxelCell.getProperty(propertyId)}`);
        }
      }
    }, Cesium.ScreenSpaceEventType.LEFT_CLICK);

##### Experimental

This feature is not final and is subject to change without Cesium's standard deprecation policy.

### Members

#### readonly orientedBoundingBox : OrientedBoundingBox
engine/Source/Scene/VoxelCell.js 229

Get a copy of the oriented bounding box containing the cell.

#### readonly primitive : VoxelPrimitive
engine/Source/Scene/VoxelCell.js 184

All objects returned by `Scene#pick` have a `primitive` property. This returns the VoxelPrimitive containing the cell.

#### readonly sampleIndex : number
engine/Source/Scene/VoxelCell.js 199

Get the sample index of the cell.

#### readonly tileIndex : number
engine/Source/Scene/VoxelCell.js 214

Get the index of the tile containing the cell.

### Methods

#### getNames() → Array.<string>
engine/Source/Scene/VoxelCell.js 251

Returns an array of metadata property names for the feature.

##### Returns:

The IDs of the feature's properties.

#### getProperty(name) → *
engine/Source/Scene/VoxelCell.js 269

Returns a copy of the value of the metadata in the cell with the given name.

Name | Type | Description
--- | --- | ---
`name` | string | The case-sensitive name of the property.

##### Returns:

The value of the property or `undefined` if the feature does not have this property.

##### Example:

    // Display all the properties for a voxel cell in the console log.
    const names = voxelCell.getNames();
    for (let i = 0; i < names.length; ++i) {
      const name = names[i];
      console.log(`{name}: ${voxelCell.getProperty(name)}`);
    }

#### hasProperty(name) → boolean
engine/Source/Scene/VoxelCell.js 242

Returns `true` if the feature contains this property.

Name | Type | Description
--- | --- | ---
`name` | string | The case-sensitive name of the property.

##### Returns:

Whether the feature contains this property.

Need help? The fastest way to get answers is from the community and team on the Cesium Forum.