Cesium3DTileset

new Cesium.Cesium3DTileset(options)

3D Tiles tileset, 用于流式传输海量异构三维地理空间数据集。
Name Type Description
options Object 具有以下属性的对象:
Name Type Default Description
url Resource | String | Promise.<Resource> | Promise.<String> tileset JSON文件的url。
show Boolean true optional 确定是否显示平铺集。
modelMatrix Matrix4 Matrix4.IDENTITY optional 一个4x4变换矩阵,用于变换tileset的根分片。
shadows ShadowMode ShadowMode.ENABLED optional 确定平铺集是投射还是接收来自光源的阴影。
maximumScreenSpaceError Number 16 optional 用于驱动详细程度细化的最大屏幕空间错误。
maximumMemoryUsage Number 512 optional 分片集可以使用的最大内存量(MB)。
cullWithChildrenBounds Boolean true optional 优化选项。是否使用子边界卷的并集剔除分幅。
cullRequestsWhileMoving Boolean true optional 优化选项。不要要求瓷砖可能会因为相机的移动而在回来时被使用。此优化仅适用于固定平铺。
cullRequestsWhileMovingMultiplier Number 60.0 optional 优化选项。移动时用于剔除请求的乘数。规模越大,淘汰的力度越大,规模越小,淘汰的力度就越小。
preloadWhenHidden Boolean false optionaltileset.showfalse时,预加载瓷砖。加载平铺,如同平铺集可见,但不渲染它们。
preloadFlightDestinations Boolean true optional 优化选项。相机飞行时,在相机的飞行目的地预加载瓷砖。
preferLeaves Boolean false optional 优化选项。喜欢先装树叶。
dynamicScreenSpaceError Boolean false optional 优化选项。减少离相机较远的平铺的屏幕空间误差。
dynamicScreenSpaceErrorDensity Number 0.00278 optional 密度用于调整动态屏幕空间误差,类似于雾密度。
dynamicScreenSpaceErrorFactor Number 4.0 optional 用于增加计算的动态屏幕空间误差的系数。
dynamicScreenSpaceErrorHeightFalloff Number 0.25 optional 密度开始衰减时瓷砖集高度的比率。
progressiveResolutionHeightFraction Number 0.3 optional 优化选项。如果介于(0.0,0.5]之间,屏幕空间误差小于或等于progressiveResolutionHeightFraction*screenHeight的屏幕空间误差将优先考虑。这有助于在全分辨率磁贴继续加载的同时快速放下平铺层。
foveatedScreenSpaceError Boolean true optional 优化选项。通过暂时提高屏幕边缘上平铺的屏幕空间错误,优先加载屏幕中心的平铺。一旦加载了Cesium3DTileset#foveatedConeSize确定的屏幕中心的所有平铺,屏幕空间错误将恢复正常。
foveatedConeSize Number 0.1 optional 优化选项。当Cesium3DTileset#foveatedScreenSpaceError为真时使用,用于控制确定哪些瓷砖被延迟的圆锥体大小。此圆锥体内的瓷砖将立即加载。锥体外的平铺可能会根据它们在锥体外的距离以及它们的屏幕空间误差而延迟。由Cesium3DTileset#foveatedInterpolationCallbackCesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation控制。将该值设置为0.0意味着圆锥体将是由摄影机位置及其视图方向形成的线。将该值设置为1.0意味着圆锥体将覆盖摄影机的整个视野,从而禁用该效果。
foveatedMinimumScreenSpaceErrorRelaxation Number 0.0 optional 优化选项。当Cesium3DTileset#foveatedScreenSpaceError为真时使用,用于控制中心凹圆锥外瓷砖的起始屏幕空间误差松弛。根据提供的Cesium3DTileset#foveatedInterpolationCallback,屏幕空间错误将从tileset值开始提升到Cesium3DTileset#maximumScreenSpaceError
foveatedInterpolationCallback Cesium3DTileset.foveatedInterpolationCallback Math.lerp optional 优化选项。当Cesium3DTileset#foveatedScreenSpaceError为真时使用,用于控制将中心凹圆锥体外的平铺的屏幕空间误差提高多少,在Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxationCesium3DTileset#maximumScreenSpaceError之间插值
foveatedTimeDelay Number 0.2 optional 优化选项。在61秒后延迟加载66秒后才开始加载控制是真的。此时间延迟可防止在相机移动时请求屏幕边缘的平铺。将此值设置为0.0将立即请求任何给定视图中的所有平铺。
skipLevelOfDetail Boolean false optional 优化选项。确定在遍历期间是否应应用详细级别跳过。
baseScreenSpaceError Number 1024 optionalskipLevelOfDetailtrue时,跳过详细级别之前必须达到的屏幕空间错误。
skipScreenSpaceErrorFactor Number 16 optionalskipLevelOfDetailtrue时,定义要跳过的最小屏幕空间错误的乘数。与skipLevels结合使用,以确定要加载的瓷砖。
skipLevels Number 1 optionalskipLevelOfDetailtrue时,这是一个常量,定义加载平铺时要跳过的最小级别数。为0时,不跳过任何级别。与skipScreenSpaceErrorFactor结合使用,以确定要加载的瓷砖。
immediatelyLoadDesiredLevelOfDetail Boolean false optionalskipLevelOfDetailtrue时,只下载满足最大屏幕空间错误的磁贴。跳过因子被忽略,只加载所需的分片。
loadSiblings Boolean false optionalskipLevelOfDetailtrue时,确定在遍历期间是否总是下载可见分片的同级。
clippingPlanes ClippingPlaneCollection optional ClippingPlaneCollection用于有选择地禁用渲染tileset。
classificationType ClassificationType optional 确定地形、三维分幅还是两者都将按此分幅集分类。有关限制和限制的详细信息,请参见Cesium3DTileset#classificationType
ellipsoid Ellipsoid Ellipsoid.WGS84 optional 确定球体的形状。
pointCloudShading Object optional 构建PointCloudShading对象以控制基于几何误差和照明的点衰减的选项。
imageBasedLightingFactor Cartesian2 new Cartesian2(1.0, 1.0) optional 缩放来自地球、天空、大气和星空盒的漫反射和高光图像照明。
lightColor Cartesian3 optional 为模型着色时的灯光颜色。当undefined时,将使用场景的浅色。
luminanceAtZenith Number 0.2 optional 太阳在天顶的亮度,单位为千坎德拉每平方米,用于此模型的程序环境贴图。
sphericalHarmonicCoefficients Array.<Cartesian3> optional 三阶球面调和系数用于图像照明的漫反射颜色。
specularEnvironmentMaps String optional KTX文件的URL,该文件包含高光照明的立方体贴图和卷曲的镜面反射mipmap。
backFaceCulling Boolean true optional 是否选择背面几何图形。如果为真,背面剔除由glTF材质的双面属性决定;如果为false,则禁用背面剔除。
debugHeatmapTilePropertyName String optional 要作为热图着色的tile变量。所有渲染的瓷砖都将相对于彼此指定的变量值进行着色。
debugFreezeFrame Boolean false optional 仅用于调试。确定是否只应使用上一帧中的平铺进行渲染。
debugColorizeTiles Boolean false optional 仅用于调试。如果为true,则为每个平铺指定随机颜色。
debugWireframe Boolean false optional 仅用于调试。如果为true,则将每个平铺的内容渲染为线框。
debugShowBoundingVolume Boolean false optional 仅用于调试。如果为true,则渲染每个平铺的边界体积。
debugShowContentBoundingVolume Boolean false optional 仅用于调试。如果为true,则渲染每个平铺内容的边界体积。
debugShowViewerRequestVolume Boolean false optional 仅用于调试。当查看器呈现每个卷的请求为true时。
debugShowGeometricError Boolean false optional 仅用于调试。如果为true,则绘制标签以指示每个平铺的几何错误。
debugShowRenderingStatistics Boolean false optional 仅用于调试。如果为true,则绘制标签以指示每个平铺的命令、点、三角形和要素的数量。
debugShowMemoryUsage Boolean false optional 仅用于调试。如果为true,则绘制标签以指示每个平铺使用的纹理和几何体内存(以兆字节为单位)。
debugShowUrl Boolean false optional 仅用于调试。如果为true,则绘制标签以指示每个平铺的url。
Throws:
Examples:
var tileset = scene.primitives.add(new Cesium.Cesium3DTileset({
     url : 'http://localhost:8002/tilesets/Seattle/tileset.json'
}));
// Common setting for the skipLevelOfDetail optimization
var tileset = scene.primitives.add(new Cesium.Cesium3DTileset({
     url : 'http://localhost:8002/tilesets/Seattle/tileset.json',
     skipLevelOfDetail : true,
     baseScreenSpaceError : 1024,
     skipScreenSpaceErrorFactor : 16,
     skipLevels : 1,
     immediatelyLoadDesiredLevelOfDetail : false,
     loadSiblings : false,
     cullWithChildrenBounds : true
}));
// Common settings for the dynamicScreenSpaceError optimization
var tileset = scene.primitives.add(new Cesium.Cesium3DTileset({
     url : 'http://localhost:8002/tilesets/Seattle/tileset.json',
     dynamicScreenSpaceError : true,
     dynamicScreenSpaceErrorDensity : 0.00278,
     dynamicScreenSpaceErrorFactor : 4.0,
     dynamicScreenSpaceErrorHeightFalloff : 0.25
}));
See:

Members

激发的事件,以指示符合此帧的屏幕空间错误的所有平铺都已加载。瓷砖集 已为此视图完全加载。

This event is fired at the end of the frame after the scene is rendered.

Default Value: new Event()
Example:
tileset.allTilesLoaded.addEventListener(function() {
    console.log('All tiles are loaded');
});
See:

readonly asset : Object

获取tileset的asset object属性,该属性包含关于tileset的元数据。

See the asset schema reference in the 3D Tiles spec for the full set of properties.

backFaceCulling : Boolean

是否剔除背面几何图形。如果为true,则确定背面剔除 通过glTF材质的doubleSided属性;如果为false,则禁用背面消隐。
Default Value: true

readonly deprecated basePath : String

tileset JSON文件中的非绝对路径相对于的基路径。

Deprecated: true

baseScreenSpaceError : Number

在跳过详细级别之前必须达到的屏幕空间错误。

Only used when Cesium3DTileset#skipLevelOfDetail is true.

Default Value: 1024

readonly boundingSphere : BoundingSphere

瓷砖集的边界球体。
Example:
var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
    url : 'http://localhost:8002/tilesets/Seattle/tileset.json'
}));

tileset.readyPromise.then(function(tileset) {
    // Set the camera to view the newly added tileset
    viewer.camera.viewBoundingSphere(tileset.boundingSphere, new Cesium.HeadingPitchRange(0, -0.5, 0));
});

readonly classificationType : ClassificationType

确定地形、三维分幅还是两者都将按此分幅集分类。

This option is only applied to tilesets containing batched 3D models, geometry data, or vector data. Even when undefined, vector data and geometry data must render as classifications and will default to rendering on both terrain and other 3D Tiles tilesets.

When enabled for batched 3D model tilesets, there are a few requirements/limitations on the glTF:

  • POSITION and _BATCHID semantics are required.
  • All indices with the same batch id must occupy contiguous sections of the index buffer.
  • All shaders and techniques are ignored. The generated shader simply multiplies the position by the model-view-projection matrix.
  • The only supported extensions are CESIUM_RTC and WEB3D_quantized_attributes.
  • Only one node is supported.
  • Only one mesh per node is supported.
  • Only one primitive per mesh is supported.
Default Value: undefined
Experimental

This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.

ClippingPlaneCollection用于选择性地禁用对tileset的渲染。

colorBlendAmount : Number

定义当Cesium3DTileset#colorBlendModeMIX时用于在源颜色和特征颜色之间进行线性插值的值。 值0.0将生成源颜色,而值1.0将生成特征颜色,其中任何值介于两者之间 导致源颜色和特征颜色的混合。
Default Value: 0.5
定义从CesumAPI或声明性样式设置的每特征颜色如何与源颜色混合 原始特征,例如瓷砖中的glTF材质或逐点颜色。
Default Value: Cesium3DTileColorBlendMode.HIGHLIGHT

cullRequestsWhileMoving : Boolean

优化选项。不要要求那些可能会因为相机的移动而重新使用的瓷砖。此优化仅适用于固定瓷砖集。
Default Value: true

cullRequestsWhileMovingMultiplier : Number

优化选项。移动时用于剔除请求的乘数。规模越大,淘汰的力度越大,规模越小,淘汰的力度就越小。
Default Value: 60.0

debugColorizeTiles : Boolean

此属性仅用于调试;它不针对生产用途进行优化。

When true, assigns a random color to each tile. This is useful for visualizing what features belong to what tiles, especially with additive refinement where features from parent tiles may be interleaved with features from child tiles.

Default Value: false

debugFreezeFrame : Boolean

此属性仅用于调试;它不针对生产用途进行优化。

Determines if only the tiles from last frame should be used for rendering. This effectively "freezes" the tileset to the previous frame so it is possible to zoom out and see what was rendered.

Default Value: false

debugShowBoundingVolume : Boolean

此属性仅用于调试;它不针对生产用途进行优化。

When true, renders the bounding volume for each visible tile. The bounding volume is white if the tile has a content bounding volume or is empty; otherwise, it is red. Tiles that don't meet the screen space error and are still refining to their descendants are yellow.

Default Value: false

debugShowContentBoundingVolume : Boolean

此属性仅用于调试;它不针对生产用途进行优化。

When true, renders the bounding volume for each visible tile's content. The bounding volume is blue if the tile has a content bounding volume; otherwise it is red.

Default Value: false

debugShowGeometricError : Boolean

此属性仅用于调试;它不针对生产用途进行优化。

When true, draws labels to indicate the geometric error of each tile.

Default Value: false

debugShowMemoryUsage : Boolean

此属性仅用于调试;它不针对生产用途进行优化。

When true, draws labels to indicate the geometry and texture memory usage of each tile.

Default Value: false

debugShowRenderingStatistics : Boolean

此属性仅用于调试;它不针对生产用途进行优化。

When true, draws labels to indicate the number of commands, points, triangles and features of each tile.

Default Value: false

debugShowUrl : Boolean

此属性仅用于调试;它不针对生产用途进行优化。

When true, draws labels to indicate the url of each tile.

Default Value: false

debugShowViewerRequestVolume : Boolean

此属性仅用于调试;它不针对生产用途进行优化。

When true, renders the viewer request volume for each tile.

Default Value: false

debugWireframe : Boolean

此属性仅用于调试;它不针对生产用途进行优化。

When true, renders each tile's content as a wireframe.

Default Value: false

dynamicScreenSpaceError : Boolean

优化选项。tileset是否应基于动态屏幕空间错误进行优化。更远的瓷砖 “离开”将使用比“近距离”平铺更低的细节进行渲染。这样可以减少渲染次数,从而提高性能 并提出较少的请求,但可能会导致远处瓷砖的视觉质量略有下降。 该算法偏向于“街景”,即摄像机靠近地砖组的地平面并进行观察 在地平线上。此外,对于紧密拟合的边界体积(如长方体和区域),结果更精确。
Default Value: false

dynamicScreenSpaceErrorDensity : Number

确定用于调整动态屏幕空间误差的密度的标量,类似于Fog。增加这个 值具有增加所有平铺的最大屏幕空间误差的效果,但以非线性方式。 误差从0.0开始,呈指数增长,直到达到中点,然后逐渐接近1.0。 这有助于在所有瓷砖中保持较近瓷砖的高细节,而在其他瓷砖中保持较低的细节 超过一定的距离,误差大约为1.0。

The dynamic error is in the range [0.0, 1.0) and is multiplied by dynamicScreenSpaceErrorFactor to produce the final dynamic error. This dynamic error is then subtracted from the tile's actual screen space error.

Increasing dynamicScreenSpaceErrorDensity has the effect of moving the error midpoint closer to the camera. It is analogous to moving fog closer to the camera.

Default Value: 0.00278

dynamicScreenSpaceErrorFactor : Number

用于增加动态屏幕空间误差的平铺屏幕空间误差的系数。随着该值的增加,平铺数量减少 是要求渲染和瓷砖在远处将有较低的细节。如果设置为零,该功能将被禁用。
Default Value: 4.0

dynamicScreenSpaceErrorHeightFalloff : Number

密度开始衰减时瓷砖集高度的比率。如果摄像机低于这个高度 将应用完全计算的密度,否则密度将下降。这会在 街景。

Valid values are between 0.0 and 1.0.

Default Value: 0.25
获取描述球体形状的椭球体。

readonly extensions : Object

获取tileset的extensions对象属性。

readonly extras : *

返回tileset JSON顶层的extras属性,该属性包含特定于应用程序的元数据。 如果extras不存在,则返回undefined
See:

foveatedConeSize : Number

优化选项。当Cesium3DTileset#foveatedScreenSpaceError为真时使用,用于控制确定哪些瓷砖被延迟的圆锥体大小。 此圆锥体内的瓷砖将立即加载。锥体外的瓷砖可能会根据它们在锥体外的距离以及Cesium3DTileset#foveatedInterpolationCallbackCesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation延迟。 将该值设置为0.0意味着圆锥体将是由摄影机位置及其视图方向形成的线。将该值设置为1.0意味着圆锥体会覆盖摄影机的整个视野,基本上会禁用该效果。
Default Value: 0.3
获取或设置一个回调函数,以控制在中心凹圆锥外的平铺的屏幕空间错误的大小, 在Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxationCesium3DTileset#maximumScreenSpaceError之间插值。

foveatedMinimumScreenSpaceErrorRelaxation : Number

优化选项。当Cesium3DTileset#foveatedScreenSpaceError为真时使用,用于控制中心凹圆锥外瓷砖的起始屏幕空间误差松弛。 根据提供的Cesium3DTileset#foveatedInterpolationCallback,屏幕空间错误将从该值开始提升到Cesium3DTileset#maximumScreenSpaceError
Default Value: 0.0

foveatedScreenSpaceError : Boolean

优化选项。通过临时升高 屏幕边缘的平铺出现屏幕空间错误。屏幕空间错误立即恢复正常 将加载屏幕中心由Cesium3DTileset#foveatedConeSize确定的瓷砖。
Default Value: true

foveatedTimeDelay : Number

优化选项。当Cesium3DTileset#foveatedScreenSpaceError为真控制时使用 相机停止移动后等待延迟的磁贴开始加载之前的秒数。 此时间延迟可防止在相机移动时请求屏幕边缘的平铺。 将此值设置为0.0将立即请求任何给定视图中的所有平铺。
Default Value: 0.2

imageBasedLightingFactor : Cartesian2

铯增加了来自地球、天空、大气层和星空盒的照明。这个笛卡尔是用来缩放决赛的 从这些光源到最终颜色的漫反射和高光照明。值为0.0将禁用这些光源。
Default Value: Cartesian2(1.0, 1.0)

immediatelyLoadDesiredLevelOfDetail : Boolean

如果为true,则只下载满足最大屏幕空间错误的磁贴。 跳过因子被忽略,只加载所需的分片。

Only used when Cesium3DTileset#skipLevelOfDetail is true.

Default Value: false

initialTilesLoaded : Event

激发的事件,以指示符合此帧的屏幕空间错误的所有平铺都已加载。本次活动 在加载初始视图中的所有平铺时激发一次。

This event is fired at the end of the frame after the scene is rendered.

Default Value: new Event()
Example:
tileset.initialTilesLoaded.addEventListener(function() {
    console.log('Initial tiles are loaded');
});
See:
为模型着色时的灯光颜色。当undefined时,将使用场景的浅色。

For example, disabling additional light sources by setting model.imageBasedLightingFactor = new Cartesian2(0.0, 0.0) will make the model much darker. Here, increasing the intensity of the light source will make the model brighter.

Default Value: undefined
为指示加载新平铺的进度而激发的事件。此事件在新平铺时激发 当请求的磁贴下载完毕,并且下载的磁贴已被 已处理并准备渲染。

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.

Default Value: new Event()
Example:
tileset.loadProgress.addEventListener(function(numberOfPendingRequests, numberOfTilesProcessing) {
    if ((numberOfPendingRequests === 0) && (numberOfTilesProcessing === 0)) {
        console.log('Stopped loading');
        return;
    }

    console.log('Loading: requests: ' + numberOfPendingRequests + ', processing: ' + numberOfTilesProcessing);
});

loadSiblings : Boolean

确定在遍历期间是否始终下载可见分片的同级。 这可能有助于确保当查看器向左/向右旋转时,平铺已经可用。

Only used when Cesium3DTileset#skipLevelOfDetail is true.

Default Value: false

luminanceAtZenith : Number

太阳在天顶的亮度,单位为千坎德拉每平方米,用于此模型的程序环境贴图。 在未定义Cesium3DTileset#specularEnvironmentMapsCesium3DTileset#sphericalHarmonicCoefficients时使用。
Default Value: 0.2

maximumMemoryUsage : Number

可用于缓存磁贴的最大GPU内存量(以MB为单位)。该值估计自 加载的平铺的几何体、纹理和批处理表纹理。对于点云,此值也 每个点包含元数据。

Tiles not in view are unloaded to enforce this.

If decreasing this value results in unloading tiles, the tiles are unloaded the next frame.

If tiles sized more than maximumMemoryUsage are needed to meet the desired screen space error, determined by Cesium3DTileset#maximumScreenSpaceError, for the current view, then the memory usage of the tiles loaded will exceed maximumMemoryUsage. For example, if the maximum is 256 MB, but 300 MB of tiles are needed to meet the screen space error, then 300 MB of tiles may be loaded. When these tiles go out of view, they will be unloaded.

Default Value: 512
See:

maximumScreenSpaceError : Number

用于驱动详细程度细化的最大屏幕空间错误。此值有助于确定平铺 细化到它的后代,因此在平衡性能和视觉质量方面起着重要作用。

A tile's screen space error is roughly equivalent to the number of pixels wide that would be drawn if a sphere with a radius equal to the tile's geometric error were rendered at the tile's position. If this value exceeds maximumScreenSpaceError the tile refines to its descendants.

Depending on the tileset, maximumScreenSpaceError may need to be tweaked to achieve the right balance. Higher values provide better performance but lower visual quality.

Default Value: 16
一个4x4变换矩阵,用于变换整个tileset。
Default Value: Matrix4.IDENTITY
Example:
// Adjust a tileset's height from the globe's surface.
var heightOffset = 20.0;
var boundingSphere = tileset.boundingSphere;
var cartographic = Cesium.Cartographic.fromCartesian(boundingSphere.center);
var surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0);
var offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, heightOffset);
var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3());
tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation);
基于几何误差和眼罩照明控制点大小的选项。

preferLeaves : Boolean

优化选项。喜欢先装树叶。
Default Value: false

preloadFlightDestinations : Boolean

优化选项。在相机飞行时在相机的飞行目的地取回瓷砖。
Default Value: true

preloadWhenHidden : Boolean

tileset.showfalse时,预加载瓷砖。加载平铺,如同平铺集可见,但不渲染它们。
Default Value: false

progressiveResolutionHeightFraction : Number

优化选项。如果介于(0.0,0.5]之间,则屏幕空间误差小于等于progressiveResolutionHeightFraction*screenHeight的分片将优先考虑。这有助于在全分辨率磁贴继续加载的同时快速放下平铺层。
Default Value: 0.3

readonly properties : Object

获取tileset的properties dictionary对象,该对象包含有关每个功能属性的元数据。

See the properties schema reference in the 3D Tiles spec for the full set of properties.

Example:
console.log('Maximum building height: ' + tileset.properties.height.maximum);
console.log('Minimum building height: ' + tileset.properties.height.minimum);
See:

readonly ready : Boolean

true时,tileset的根tile被加载,tileset准备渲染。 在解析Cesium3DTileset#readyPromise之前,它被设置为true
Default Value: false

readonly readyPromise : Promise.<Cesium3DTileset>

获取将在加载tileset的根分片并且tileset准备呈现时解析的承诺。

This promise is resolved at the end of the frame before the first frame the tileset is rendered in.

Example:
tileset.readyPromise.then(function(tileset) {
    // tile.properties is not defined until readyPromise resolves.
    var properties = tileset.properties;
    if (Cesium.defined(properties)) {
        for (var name in properties) {
            console.log(properties[name]);
        }
    }
});
根平铺。
确定平铺集是投射还是接收来自光源的阴影。

Enabling shadows has a performance impact. A tileset that casts shadows must be rendered twice, once from the camera and again from the light's point of view.

Shadows are rendered only when Viewer#shadows is true.

Default Value: ShadowMode.ENABLED
确定是否显示tileset。
Default Value: true

skipLevelOfDetail : Boolean

优化选项。确定在遍历期间是否应应用详细级别跳过。

The common strategy for replacement-refinement traversal is to store all levels of the tree in memory and require all children to be loaded before the parent can refine. With this optimization levels of the tree can be skipped entirely and children can be rendered alongside their parents. The tileset requires significantly less memory when using this optimization.

Default Value: false

skipLevels : Number

定义加载平铺时要跳过的最小级别数的常量。为0时,不跳过任何级别。 例如,如果平铺为标高1,则除非平铺的标高大于2,否则不会载入平铺。

Only used when Cesium3DTileset#skipLevelOfDetail is true.

Default Value: 1

skipScreenSpaceErrorFactor : Number

定义要跳过的最小屏幕空间错误的乘数。 例如,如果一个磁贴的屏幕空间误差为100,则不会加载任何磁贴,除非它们 是离开或有一个屏幕空间错误<= 100 / skipScreenSpaceErrorFactor

Only used when Cesium3DTileset#skipLevelOfDetail is true.

Default Value: 16

specularEnvironmentMaps : String

KTX文件的URL,该文件包含高光照明的立方体贴图和卷曲的镜面反射mipmap。
Demo:
See:

sphericalHarmonicCoefficients : Array.<Cartesian3>

三阶球面调和系数用于图像照明的漫反射颜色。当undefined时,漫射辐照度 根据大气颜色计算。

There are nine Cartesian3 coefficients. The order of the coefficients is: L00, L1-1, L10, L11, L2-2, L2-1, L20, L21, L22

这些值可以通过使用cmgen工具对环境图进行预处理来获得 Google's Filament project这还将生成一个KTX文件,该文件可以 供应至Cesium3DTileset#specularEnvironmentMaps
Demo:
See:
样式,使用 3D Tiles Styling language, 应用于平铺集中的每个要素。

Assign undefined to remove the style, which will restore the visual appearance of the tileset to its default when no style was applied.

The style is applied to a tile before the Cesium3DTileset#tileVisible event is raised, so code in tileVisible can manually set a feature's properties (e.g. color and show) after the style is applied. When a new style is assigned any manually set properties are overwritten.

Default Value: undefined
Example:
tileset.style = new Cesium.Cesium3DTileStyle({
   color : {
       conditions : [
           ['${Height} >= 100', 'color("purple", 0.5)'],
           ['${Height} >= 50', 'color("red")'],
           ['true', 'color("blue")']
       ]
   },
   show : '${Height} > 0',
   meta : {
       description : '"Building id ${id} has height ${Height}."'
   }
});
See:
为指示磁贴内容加载失败而激发的事件。

If there are no event listeners, error messages will be logged to the console.

The error object passed to the listener contains two properties:

  • url: the url of the failed tile.
  • message: the error message.
Default Value: new Event()
Example:
tileset.tileFailed.addEventListener(function(error) {
    console.log('An error occurred loading tile: ' + error.url);
    console.log('Error: ' + error.message);
});
激发以指示磁贴内容已加载的事件。

The loaded Cesium3DTile is passed to the event listener.

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.

Default Value: new Event()
Example:
tileset.tileLoad.addEventListener(function(tile) {
    console.log('A tile was loaded.');
});

readonly tilesLoaded : Boolean

true时,符合屏幕空间误差的所有瓷砖都被加载。瓷砖是 此视图已完全加载。
Default Value: false
See:
激发以指示磁贴内容已卸载的事件。

The unloaded Cesium3DTile is passed to the event listener.

This event is fired immediately before the tile's content is unloaded while the frame is being rendered so that the event listener has access to the tile's content. Do not create or modify Cesium entities or primitives during the event listener.

Default Value: new Event()
Example:
tileset.tileUnload.addEventListener(function(tile) {
    console.log('A tile was unloaded from the cache.');
});
See:
此事件对帧中的每个可见平铺触发一次。这可用于手动 设计瓷砖样式。

The visible Cesium3DTile is passed to the event listener.

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.

Default Value: new Event()
Examples:
tileset.tileVisible.addEventListener(function(tile) {
    if (tile.content instanceof Cesium.Batched3DModel3DTileContent) {
        console.log('A Batched 3D Model tile is visible.');
    }
});
// Apply a red style and then manually set random colors for every other feature when the tile becomes visible.
tileset.style = new Cesium.Cesium3DTileStyle({
    color : 'color("red")'
});
tileset.tileVisible.addEventListener(function(tile) {
    var content = tile.content;
    var featuresLength = content.featuresLength;
    for (var i = 0; i < featuresLength; i+=2) {
        content.getFeature(i).color = Cesium.Color.fromRandom();
    }
});

readonly timeSinceLoad : Number

返回自加载和首次更新tileset以来的时间(以毫秒为单位)。

readonly totalMemoryUsageInBytes : Number

平铺集使用的GPU内存总量(字节)。该值估计自 加载的平铺的几何体、纹理和批处理表纹理。对于点云,此值也 每个点包含元数据。
See:

readonly url : String

tileset JSON文件的url。

Methods

static Cesium.Cesium3DTileset.loadJson(tilesetUrl)Promise.<Object>

提供一个钩子来重写用于请求tileset json的方法 从远程服务器获取tileset时很有用
Name Type Description
tilesetUrl Resource | String 要获取的json文件的url
Returns:
一个使用获取的json数据解析的承诺


销毁此对象持有的WebGL资源。销毁一个对象允许确定性 释放WebGL资源,而不是依赖垃圾回收器销毁此对象。 一旦一个对象被销毁,就不应该使用它;调用除 isDestroyed将导致DeveloperError异常。因此, 如示例所示,将返回值(undefined)分配给对象。
Throws:
Example:
tileset = tileset && tileset.destroy();
See:

hasExtension(extensionName)Boolean

true如果tileset JSON文件在所使用的扩展中列出扩展名,则为false
Name Type Description
extensionName String 要检查的扩展名的名称。
Returns:
true如果tileset JSON文件在所使用的扩展中列出扩展名,则为false

isDestroyed()Boolean



如果此对象已销毁,则返回true;否则返回false。 如果此对象已被销毁,则不应使用它;调用除 isDestroyed将导致DeveloperError异常。
Returns:
如果此对象被销毁,则为true;否则为false
See:
将瓷砖集的Cesium3DTileset#style标记为脏的,这将强制所有 在下一帧中重新评估样式的特征每个都是可见的。

trimLoadedTiles()

卸载未在上一帧中选择的所有平铺。这可以用来 显式管理磁贴缓存并减少下面加载的磁贴总数 Cesium3DTileset#maximumMemoryUsage

Tile unloads occur at the next frame to keep all the WebGL delete calls within the render loop.

Type Definitions

Cesium.Cesium3DTileset.foveatedInterpolationCallback(p, q, time)Number

优化选项。当Cesium3DTileset#foveatedScreenSpaceError为真时用作回调函数,用于控制将中心凹圆锥外的平铺的屏幕空间错误提高多少, 在Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxationCesium3DTileset#maximumScreenSpaceError之间插值。
Name Type Description
p Number 要插值的起始值。
q Number 要插值的结束值。
time Number 插值时间一般在[0.0, 1.0]范围内。
Returns:
内插值。
Default Value: Math.lerp