| Name | Type | Description |
|---|---|---|
primitive |
VoxelPrimitive | 包含该单元的体素原语。 |
tileIndex |
number | 瓦片的索引。 |
sampleIndex |
number | 瓦片内样本的索引,包含此单元的元数据。 |
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
该功能尚未最终确定,可能会根据 Cesium 的标准弃用政策而发生变化
Members
readonly orientedBoundingBox : OrientedBoundingBox
获取包含该单元的有向包围盒的副本。
readonly primitive : VoxelPrimitive
从
Scene#pick 返回的所有对象都有一个 primitive 属性。此属性返回
包含该单元的 VoxelPrimitive。
获取单元的样本索引。
获取包含该单元的瓦片的索引。
Methods
返回特征的元数据属性名称数组。
Returns:
特征属性的ID。
返回具有给定名称的单元中元数据值的副本。
| 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:
特征是否包含此属性。
