Skip to content

KBE3D / KBCore / Cesium / Cesium3DTilesVoxelProvider

类: Cesium3DTilesVoxelProvider

A VoxelProvider that fetches voxel data from a 3D Tiles tileset. <p> Implements the VoxelProvider interface. </p> <div class="notice"> This object is normally not instantiated directly, use Cesium3DTilesVoxelProvider.fromUrl. </div>

参数

An object describing initialization options

继承

属性

globalTransform

readonly globalTransform: Matrix4

A transform from local space to global space.

重写了

VoxelProvider.globalTransform


shapeTransform

readonly shapeTransform: Matrix4

A transform from shape space to local space.

重写了

VoxelProvider.shapeTransform


shape

readonly shape: VoxelShapeType

Gets the VoxelShapeType

重写了

VoxelProvider.shape


minBounds

readonly minBounds: Cartesian3 | undefined

Gets the minimum bounds. If undefined, the shape's default minimum bounds will be used instead.

重写了

VoxelProvider.minBounds


maxBounds

readonly maxBounds: Cartesian3 | undefined

Gets the maximum bounds. If undefined, the shape's default maximum bounds will be used instead.

重写了

VoxelProvider.maxBounds


dimensions

readonly dimensions: Cartesian3

Gets the number of voxels per dimension of a tile. This is the same for all tiles in the dataset.

重写了

VoxelProvider.dimensions


paddingBefore

readonly paddingBefore: Cartesian3

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.

重写了

VoxelProvider.paddingBefore


paddingAfter

readonly paddingAfter: Cartesian3

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.

重写了

VoxelProvider.paddingAfter


className

readonly className: string

The metadata class for this tileset.


names

readonly names: string[]

Gets the metadata names.

重写了

VoxelProvider.names


types

readonly types: MetadataType[]

Gets the metadata types.

重写了

VoxelProvider.types


componentTypes

readonly componentTypes: MetadataComponentType[]

Gets the metadata component types.

重写了

VoxelProvider.componentTypes


minimumValues

readonly minimumValues: number[][] | undefined

Gets the metadata minimum values.

重写了

VoxelProvider.minimumValues


maximumValues

readonly maximumValues: number[][] | undefined

Gets the metadata maximum values.

重写了

VoxelProvider.maximumValues


maximumTileCount

readonly maximumTileCount: number | undefined

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.

重写了

VoxelProvider.maximumTileCount


availableLevels

readonly availableLevels: number | undefined

The number of levels of detail containing available tiles in the tileset.

方法

fromUrl()

static fromUrl(url: string | Resource): Promise<Cesium3DTilesVoxelProvider>

Creates a Cesium3DTilesVoxelProvider that fetches voxel data from a 3D Tiles tileset.

参数

url

The URL to a tileset JSON file

string | Resource

返回

Promise<Cesium3DTilesVoxelProvider>

The created provider

示例

ts
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}`);
}

requestData()

requestData(options?: { tileLevel?: number; tileX?: number; tileY?: number; tileZ?: number; }): Promise<VoxelContent> | undefined

Requests the data for a given tile.

参数

options?

Object with the following properties:

tileLevel?

number

The tile's level.

tileX?

number

The tile's X coordinate.

tileY?

number

The tile's Y coordinate.

tileZ?

number

The tile's Z coordinate.

返回

Promise<VoxelContent> | undefined

A promise resolving to a VoxelContent containing the data for the tile, or undefined if the request could not be scheduled this frame.

重写了

VoxelProvider.requestData

构造函数

构造函数

new Cesium3DTilesVoxelProvider(options: ConstructorOptions): Cesium3DTilesVoxelProvider

参数

options

ConstructorOptions

返回

Cesium3DTilesVoxelProvider

重写了

VoxelProvider.constructor

KBE3D @3.0.0 Copyright © 2024-present KBE3D