一个基元,用于呈现来自
VoxelProvider
的体素数据。
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
optional
对象,具有以下属性:
|
Experimental
此功能不是最终的,在没有 Cesium 的标准弃用政策的情况下可能会发生变化。
See:
Members
allTilesLoaded : Event
The event fired to indicate that all tiles that meet the screen space error this frame are loaded. The voxel
primitive is completely loaded for this view.
This event is fired at the end of the frame after the scene is rendered.
Example:
voxelPrimitive.allTilesLoaded.addEventListener(function() {
console.log('All tiles are loaded');
});
包含图块集中可用图块的细节级别数。
readonly boundingSphere : BoundingSphere
Gets the bounding sphere.
clippingPlanes : ClippingPlaneCollection
The
ClippingPlaneCollection
used to selectively disable rendering the primitive.
customShader : CustomShader
获取或设置custom shader. If undefined,
VoxelPrimitive.DefaultCustomShader
is set.
readonly customShaderCompilationEvent : Event
Gets an event that is raised whenever a custom shader is compiled.
获取或设置是否 to render debug visualizations.
获取或设置是否 to test against depth when rendering.
readonly dimensions : Cartesian3
Gets the voxel dimensions.
获取或设置是否 the primitive should update when the view changes.
initialTilesLoaded : Event
The event fired to indicate that all tiles that meet the screen space error this frame are loaded. This event
is fired once when all tiles in the initial view are loaded.
This event is fired at the end of the frame after the scene is rendered.
Example:
voxelPrimitive.initialTilesLoaded.addEventListener(function() {
console.log('Initial tiles are loaded');
});
See:
loadProgress : Event
The event fired to indicate progress of loading new tiles. This event is fired when a new tile
is requested, when a requested tile is finished downloading, and when a downloaded tile has been
processed and is ready to render.
The number of pending tile requests, numberOfPendingRequests
, and number of tiles
processing, numberOfTilesProcessing
are passed to the event listener.
This event is fired at the end of the frame after the scene is rendered.
Example:
voxelPrimitive.loadProgress.addEventListener(function(numberOfPendingRequests, numberOfTilesProcessing) {
if ((numberOfPendingRequests === 0) && (numberOfTilesProcessing === 0)) {
console.log('Finished loading');
return;
}
console.log(`Loading: requests: ${numberOfPendingRequests}, processing: ${numberOfTilesProcessing}`);
});
maxBounds : Cartesian3
获取或设置maximum bounds in the shape's local coordinate system.
Voxel data is stretched or squashed to fit the bounds.
maxClippingBounds : Cartesian3
获取或设置maximum clipping location in the shape's local coordinate system.
Any voxel content outside the range is clipped.
Gets the maximum value per channel of the voxel data.
minBounds : Cartesian3
获取或设置minimum bounds in the shape's local coordinate system.
Voxel data is stretched or squashed to fit the bounds.
minClippingBounds : Cartesian3
获取或设置minimum clipping location in the shape's local coordinate system.
Any voxel content outside the range is clipped.
Gets the minimum value per channel of the voxel data.
readonly modelMatrix : Matrix4
Gets the model matrix.
获取或设置nearest sampling.
readonly orientedBoundingBox : OrientedBoundingBox
Gets the oriented bounding box.
readonly provider : VoxelProvider
Gets the
VoxelProvider
associated with this primitive.
Gets a value indicating whether or not the primitive is ready for use.
获取或设置screen space error in pixels. If the screen space size
of a voxel is greater than the screen space error, the tile is subdivided.
Lower screen space error corresponds with higher detail rendering, but could
result in worse performance and higher memory consumption.
readonly shape : VoxelShapeType
Gets the shape type.
获取或设置是否 this primitive should be displayed.
获取或设置step size multiplier used during raymarching.
The lower the value, the higher the rendering quality, but
also the worse the performance.
tileFailed : Event
The event fired to indicate that a tile's content failed to load.
Example:
voxelPrimitive.tileFailed.addEventListener(function() {
console.log('An error occurred loading tile.');
});
tileLoad : Event
The event fired to indicate that a tile's content was loaded.
This event is fired during the tileset traversal while the frame is being rendered so that updates to the tile take effect in the same frame. Do not create or modify Cesium entities or primitives during the event listener.
Example:
voxelPrimitive.tileLoad.addEventListener(function() {
console.log('A tile was loaded.');
});
tileUnload : Event
The event fired to indicate that a tile's content was unloaded.
Example:
voxelPrimitive.tileUnload.addEventListener(function() {
console.log('A tile was unloaded from the cache.');
});
tileVisible : Event
This event fires once for each visible tile in a frame.
This event is fired during the traversal while the frame is being rendered.
Example:
voxelPrimitive.tileVisible.addEventListener(function() {
console.log('A tile is visible.');
});
Methods
Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
release of WebGL resources, instead of relying on the garbage collector to destroy this object.
Once an object is destroyed, it should not be used; calling any function other than
Once an object is destroyed, it should not be used; calling any function other than
isDestroyed
will result in a DeveloperError
exception. Therefore,
assign the return value (undefined
) to the object as done in the example.
Throws:
-
DeveloperError : 这个物体被摧毁了,destroy().
Example:
voxelPrimitive = voxelPrimitive && voxelPrimitive.destroy();
See:
Returns true if this object was destroyed; otherwise, false.
If this object was destroyed, it should not be used; calling any function other than
If this object was destroyed, it should not be used; calling any function other than
isDestroyed
will result in a DeveloperError
exception.
Returns:
true
if this object was destroyed; otherwise, false
.