English中文

Cesium3DTilesVoxelProvider

new Cesium.Cesium3DTilesVoxelProvider(options)

A VoxelProvider 从 3D Tiles 瓷砖集中获取体素数据。 that fetches voxel data from a 3D Tiles tileset.

实现了 Implements the VoxelProvider interface.

该对象通常不直接实例化,使用 This object is normally not instantiated directly, use Cesium3DTilesVoxelProvider.fromUrl.
名称 Name 类型 Type 说明 Description
options Cesium3DTilesVoxelProvider.ConstructorOptions 描述初始化选项的对象 An object describing initialization options
实验性 Experimental

此功能不是最终版本,可能会在没有 Cesium 标准弃用政策的情况下进行更改。 This feature is not final and is subject to change without Cesium's standard deprecation policy.

另见: See:

继承 Extends

成员 Members

readonly availableLevels : number|undefined

包含图块集中可用图块的细节级别数。 The number of levels of detail containing available tiles in the tileset.
此图块集的元数据类。 The metadata class for this tileset.
获取元数据组件类型。 Gets the metadata component types.
获取图块每个维度的体素数。这对于数据集中的所有图块都是相同的。 Gets the number of voxels per dimension of a tile. This is the same for all tiles in the dataset.
从局部空间到全局空间的转变。 A transform from local space to global space.
默认值: Default Value: Matrix4.IDENTITY
获取最大边界。如果未定义,则将使用形状的默认最大边界。 Gets the maximum bounds. If undefined, the shape's default maximum bounds will be used instead.

readonly maximumTileCount : number|undefined

该提供程序存在的最大切片数。该值用作体素渲染器分配适当数量的 GPU 内存的提示。如果该值未知,则它可能是未定义的。 The maximum number of tiles that exist for this provider. This value is used as a hint to the voxel renderer to allocate an appropriate amount of GPU memory. If this value is not known it can be undefined.

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

获取元数据最大值。 Gets the metadata maximum values.
获取最小边界。如果未定义,则将使用形状的默认最小边界。 Gets the minimum bounds. If undefined, the shape's default minimum bounds will be used instead.

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

获取元数据最小值。 Gets the metadata minimum values.
获取元数据名称。 Gets the metadata names.
获取图块后的填充体素数。这可以提高对图块边缘进行采样时的渲染质量,但会增加内存使用量。 Gets the number of padding voxels after the tile. This improves rendering quality when sampling the edge of a tile, but it increases memory usage.
默认值: Default Value: Cartesian3.ZERO
获取图块之前的填充体素数。这可以提高对图块边缘进行采样时的渲染质量,但会增加内存使用量。 Gets the number of padding voxels before the tile. This improves rendering quality when sampling the edge of a tile, but it increases memory usage.
默认值: Default Value: Cartesian3.ZERO
得到 Gets the VoxelShapeType
从形状空间到局部空间的变换。 A transform from shape space to local space.
默认值: Default Value: Matrix4.IDENTITY
获取元数据类型。 Gets the metadata types.

方法 Methods

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

创建一个 Creates a Cesium3DTilesVoxelProvider 从 3D Tiles 瓷砖集中获取体素数据。 that fetches voxel data from a 3D Tiles tileset.
名称 Name 类型 Type 说明 Description
url Resource | string tileset JSON 文件的 URL The URL to a tileset JSON file
返回: Returns:
创建的提供者 The created provider
抛出: Throws:
  • RuntimeException : 根必须有内容 : Root must have content
  • RuntimeException :根图块内容必须具有 3DTILES_content_voxels 扩展名 : Root tile content must have 3DTILES_content_voxels extension
  • RuntimeException :根瓦片必须具有隐式瓦片 : Root tile must have implicit tiling
  • RuntimeException :图块集必须有元数据模式 : Tileset must have a metadata schema
  • RuntimeException :Cesium3DTilesVoxelProvider 中仅支持 box、region 和 3DTILES_bounding_volume_Column : Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider
示例: 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 图块的 X 坐标。 The tile's X coordinate.
tileY number 0 可选 optional 图块的 Y 坐标。 The tile's Y coordinate.
tileZ number 0 可选 optional 图块的 Z 坐标。 The tile's Z coordinate.
返回: Returns:
解析为包含图块数据的 VoxelContent 的承诺,如果无法在此帧安排请求,则为未定义。 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 构造函数的初始化选项 Initialization options for the Cesium3DTilesVoxelProvider constructor
属性: Properties:
名称 Name 类型 Type Attributes 默认值 Default 说明 Description
className string 描述体素元数据的图块模式中的类。 The class in the tileset schema describing voxel metadata.
names Array.<string> 元数据名称。 The metadata names.
types Array.<MetadataType> 元数据类型。 The metadata types.
componentTypes Array.<MetadataComponentType> 元数据组件类型。 The metadata component types.
shape VoxelShapeType The VoxelShapeType.
dimensions Cartesian3 平铺每个维度的体素数量。这对于数据集中的所有图块都是相同的。 The number of voxels per dimension of a tile. This is the same for all tiles in the dataset.
paddingBefore Cartesian3 <可选> &lt;optional>
Cartesian3.ZERO 平铺之前的填充体素的数量。这可以提高对图块边缘进行采样时的渲染质量,但会增加内存使用量。 The number of padding voxels before the tile. This improves rendering quality when sampling the edge of a tile, but it increases memory usage.
paddingAfter Cartesian3 <可选> &lt;optional>
Cartesian3.ZERO 平铺后的填充体素的数量。这可以提高对图块边缘进行采样时的渲染质量,但会增加内存使用量。 The number of padding voxels after the tile. This improves rendering quality when sampling the edge of a tile, but it increases memory usage.
globalTransform Matrix4 <可选> &lt;optional>
Matrix4.IDENTITY 从局部空间到全局空间的转变。 A transform from local space to global space.
shapeTransform Matrix4 <可选> &lt;optional>
Matrix4.IDENTITY 从形状空间到局部空间的变换。 A transform from shape space to local space.
minBounds Cartesian3 <可选> &lt;optional>
最小界限。 The minimum bounds.
maxBounds Cartesian3 <可选> &lt;optional>
最大界限。 The maximum bounds.
minimumValues Array.<Array.<number>> <可选> &lt;optional>
元数据最小值。 The metadata minimum values.
maximumValues Array.<Array.<number>> <可选> &lt;optional>
元数据最大值。 The metadata maximum values.
maximumTileCount number <可选> &lt;optional>
该提供程序存在的最大切片数。该值用作体素渲染器分配适当数量的 GPU 内存的提示。如果该值未知,则它可能是未定义的。 The maximum number of tiles that exist for this provider. This value is used as a hint to the voxel renderer to allocate an appropriate amount of GPU memory. If this value is not known it can be undefined.
需要帮助吗?获得答案的最快方法是从社区和团队那里获得答案 Need help? The fastest way to get answers is from the community and team on the Cesium Forum.