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:
特征是否包含此属性。