Cesium3DTilesVoxelProvider

new Cesium.Cesium3DTilesVoxelProvider(options)

A VoxelProvider 从 3D Tiles 图块集中获取体素数据。

实现 VoxelProvider 接口。

这个对象通常不会直接实例化,请使用 Cesium3DTilesVoxelProvider.fromUrl
Name Type Description
options Cesium3DTilesVoxelProvider.ConstructorOptions 描述初始化选项的对象
Experimental

此功能不是最终的,在没有 Cesium 的标准弃用政策的情况下可能会发生变化。

See:

Extends

Members

readonly availableLevels : number|undefined

包含图块集中可用图块的细节级别数。
此图块集的元数据类。
获取元数据组件类型。
获取图块的每个维度的体素数。数据集中的所有切片都是相同的。
从局部空间到全局空间的转换。
Default Value: Matrix4.IDENTITY
获取最大边界。 如果未定义,则将使用形状的默认最大边界。

readonly maximumTileCount : number|undefined

此提供商存在的最大磁贴数。 此值用作体素渲染器的提示,以分配适当数量的 GPU 内存。 如果此值未知,则可以未定义。

readonly maximumValues : Array.<Array.<number>>|undefined

获取元数据最大值。
获取最小边界。 如果未定义,则将使用形状的默认最小边界。

readonly minimumValues : Array.<Array.<number>>|undefined

获取元数据最小值。
获取元数据名称。
获取图块之后的填充体素数。这可以提高对图块边缘进行采样时的渲染质量,但会增加内存使用量。
Default Value: Cartesian3.ZERO
获取图块之前的填充体素数。这可以提高对图块边缘进行采样时的渲染质量,但会增加内存使用量。
Default Value: Cartesian3.ZERO
从形状空间到局部空间的转换。
Default Value: Matrix4.IDENTITY
获取元数据类型。

Methods

static Cesium.Cesium3DTilesVoxelProvider.fromUrl(url)Promise.<Cesium3DTilesVoxelProvider>

创建一个 Cesium3DTilesVoxelProvider,用于从 3D 瓦片图块集中获取体素数据。
Name Type Description
url Resource | string 瓦片集 JSON 文件的 URL
Returns:
创建的 provider
Throws:
  • RuntimeException : 根必须包含内容
  • RuntimeException : 根磁贴内容必须具有3DTILES_content_voxels扩展名
  • RuntimeException : 根平铺必须具有隐式平铺
  • RuntimeException : 瓦片集必须具有元数据架构
  • RuntimeException : Cesium3DTilesVoxelProvider 仅支持 box、region 和 3DTILES_bounding_volume_cylinder
Example:
try {
  const voxelProvider = await Cesium3DTilesVoxelProvider.fromUrl(
    "http://localhost:8002/tilesets/voxel/tileset.json"
  );
  const voxelPrimitive = new VoxelPrimitive({
    provider: voxelProvider,
    customShader: customShader,
  });
  scene.primitives.add(voxelPrimitive);
} catch (error) {
  console.error(`Error creating voxel primitive: ${error}`);
}
See:

requestData(options)Promise.<VoxelContent>|undefined

Requests the data for a given tile.
Name Type Description
options object optional Object with the following properties:
Name Type Default Description
tileLevel number 0 optional The tile's level.
tileX number 0 optional The tile's X coordinate.
tileY number 0 optional The tile's Y coordinate.
tileZ number 0 optional The tile's Z coordinate.
Returns:
A promise resolving to a VoxelContent containing the data for the tile, or undefined if the request could not be scheduled this frame.

Type Definitions

Cesium.Cesium3DTilesVoxelProvider.ConstructorOptions

Cesium3DTilesVoxelProvider 构造函数的初始化选项
Properties:
Name Type Attributes Default Description
className string 图块集架构中描述体素元数据的类。
names Array.<string> 元数据名称。
types Array.<MetadataType> 元数据类型。
componentTypes Array.<MetadataComponentType> 元数据组件类型。
shape VoxelShapeType VoxelShapeType
dimensions Cartesian3 瓦片的每个维度的体素数。数据集中的所有切片都是相同的。
paddingBefore Cartesian3 <optional>
Cartesian3.ZERO 图块之前的填充体素数。这可以提高对图块边缘进行采样时的渲染质量,但会增加内存使用量。
paddingAfter Cartesian3 <optional>
Cartesian3.ZERO 瓦片后填充体素的数量。这可以提高对图块边缘进行采样时的渲染质量,但会增加内存使用量。
globalTransform Matrix4 <optional>
Matrix4.IDENTITY 从局部空间到全局空间的变换。
shapeTransform Matrix4 <optional>
Matrix4.IDENTITY 从形状空间到局部空间的变换。
minBounds Cartesian3 <optional>
最小边界。
maxBounds Cartesian3 <optional>
最大边界。
minimumValues Array.<Array.<number>> <optional>
元数据最小值。
maximumValues Array.<Array.<number>> <optional>
元数据最大值。
maximumTileCount number <optional>
此提供程序存在的最大磁贴数。此值用作体素渲染器的提示,以分配适当数量的 GPU 内存。如果此值未知,则可以为 undefined。
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.