| Name | Type | Description |
|---|---|---|
primitive |
VoxelPrimitive | 包含该单元的体素图元 |
tileIndex |
number | 瓦片的索引 |
sampleIndex |
number | 瓦片内样本的索引,包含此单元的 metadata |
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
获取包含该单元的有向包围盒的副本。
readonly primitive : VoxelPrimitive
所有由
Scene#pick 返回的对象都具有一个 primitive 属性。此方法返回
包含该单元的 VoxelPrimitive。
获取该单元的采样索引。
获取包含该单元的瓦片索引。
Methods
返回该要素(feature)的 metadata 属性名称数组。
Returns:
该要素的属性 ID。
返回该单元中指定名称的 metadata 值的副本。
| Name | Type | Description |
|---|---|---|
name |
string | 该属性的区分大小写的名称。 |
Returns:
该属性的值;如果要素不具有此属性,则为
undefined。
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)}`);
}
如果要素包含此属性则返回
true。
| Name | Type | Description |
|---|---|---|
name |
string | 该属性的区分大小写的名称。 |
Returns:
要素是否包含此属性。
