Cesium3DTilesVoxelProvider

new Cesium.Cesium3DTilesVoxelProvider(options)

从 3D Tiles 瓦片集获取体素数据的 VoxelProvider

实现 VoxelProvider 接口。

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

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

See:

Extends

Members

readonly availableLevels : number|undefined

瓦片集中包含可用瓦片的细节级别数量。
此瓦片集的元数据类。
获取元数据组件类型。
获取瓦片每个维度的体素数量。对于数据集中的所有瓦片都是相同的。
从局部空间到全局空间的变换。
Default Value: Matrix4.IDENTITY
获取最大边界。 如果为 undefined,将改用形状的默认最大边界。

readonly maximumTileCount : number|undefined

此提供程序存在的最大瓦片数量。 该值用作体素渲染器分配适量 GPU 内存的提示。 如果不知道此值,可以设为 undefined。

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

获取元数据最大值。
获取最小边界。 如果为 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>

创建从 3D Tiles 瓦片集获取体素数据的 Cesium3DTilesVoxelProvider
Name Type Description
url Resource | string 瓦片集 JSON 文件的 URL
Returns:
创建的提供程序
Throws:
  • RuntimeException : 根节点必须包含内容
  • RuntimeException : 根瓦片内容必须包含 3DTILES_content_voxels 扩展
  • RuntimeException : 根瓦片必须包含隐式瓦片化
  • RuntimeException : 瓦片集必须包含元数据 schema
  • 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 描述体素元数据的瓦片集 schema 中的类。
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.