Cesium3DTileset.fromUrl
.
Name | Type | Description |
---|---|---|
options |
Cesium3DTileset.ConstructorOptions | An 描述初始化选项的对象 |
Throws:
-
DeveloperError : The tileset must be 3D Tiles version 0.0 or 1.0.
Examples:
try {
const tileset = await Cesium.Cesium3DTileset.fromUrl(
"http://localhost:8002/tilesets/Seattle/tileset.json"
);
scene.primitives.add(tileset);
} catch (error) {
console.error(`Error creating tileset: ${error}`);
}
// Turn on camera collisions with the tileset.
try {
const tileset = await Cesium.Cesium3DTileset.fromUrl(
"http://localhost:8002/tilesets/Seattle/tileset.json",
{ enableCollision: true }
);
scene.primitives.add(tileset);
} catch (error) {
console.error(`Error creating tileset: ${error}`);
}
// Common setting for the skipLevelOfDetail optimization
const tileset = await Cesium.Cesium3DTileset.fromUrl(
"http://localhost:8002/tilesets/Seattle/tileset.json", {
skipLevelOfDetail: true,
baseScreenSpaceError: 1024,
skipScreenSpaceErrorFactor: 16,
skipLevels: 1,
immediatelyLoadDesiredLevelOfDetail: false,
loadSiblings: false,
cullWithChildrenBounds: true
});
scene.primitives.add(tileset);
// Common settings for the dynamicScreenSpaceError optimization
const tileset = await Cesium.Cesium3DTileset.fromUrl(
"http://localhost:8002/tilesets/Seattle/tileset.json", {
dynamicScreenSpaceError: true,
dynamicScreenSpaceErrorDensity: 2.0e-4,
dynamicScreenSpaceErrorFactor: 24.0,
dynamicScreenSpaceErrorHeightFalloff: 0.25
});
scene.primitives.add(tileset);
See:
Members
allTilesLoaded : Event
此事件在场景渲染后的帧结束时触发。
-
Default Value:
new Event()
Example:
tileset.allTilesLoaded.addEventListener(function() {
console.log('All tiles are loaded');
});
See:
请参阅 asset schema reference 在 3D Tiles 规范中了解完整的属性集。
-
Default Value:
true
Deprecated: true
仅在 Cesium3DTileset#skipLevelOfDetail
为 true
时使用。
-
Default Value:
1024
readonly boundingSphere : BoundingSphere
Example:
const tileset = await Cesium.Cesium3DTileset.fromUrl("http://localhost:8002/tilesets/Seattle/tileset.json");
viewer.scene.primitives.add(tileset);
// Set the camera to view the newly added tileset
viewer.camera.viewBoundingSphere(tileset.boundingSphere, new Cesium.HeadingPitchRange(0, -0.5, 0));
未在视图中的图块将被卸载以强制执行此操作。
如果减小此值导致卸载图块,则会在下一帧卸载图块。
如果需要大小大于 cacheBytes
的切片才能满足
所需屏幕空间误差,由 Cesium3DTileset#maximumScreenSpaceError
确定,
对于当前视图,则加载的瓦片的内存使用量将超过
cacheBytes
最多增加 maximumCacheOverflowBytes
。
例如,如果 cacheBytes
为 500000,但为 600000 字节
的瓦片需要满足屏幕空间错误,则 600000 字节的瓦片
可能会加载(如果 maximumCacheOverflowBytes
至少为 100000)。
当这些图块离开视野时,它们将被卸载。
-
Default Value:
536870912
See:
readonly classificationType : ClassificationType
此选项仅适用于包含批处理 3D 模型的瓦片集, glTF 内容、几何数据或矢量数据。即使未定义,vector 和几何数据必须呈现为分类,并将默认为 在地形和其他 3D 瓦片集上渲染。
当为批处理 3D 模型和 glTF 瓦片集启用时,有一些 glTF 的要求/限制:
- glTF 不能包含变形目标、皮肤或动画。
- glTF 不能包含
EXT_mesh_gpu_instancing
扩展。 - 只有带有 TRIANGLES 的网格才能用于对其他资产进行分类。
- 网格必须防水。
- 需要
POSITION
语义。 - 如果
_BATCHID
秒和索引缓冲区都存在,则具有相同批处理 ID 的所有索引必须占据索引缓冲区的连续部分。 - 如果存在没有索引缓冲区的
_BATCHID
个,则具有相同批处理 ID 的所有位置必须占据位置缓冲区的连续部分。
此外,点或实例化 3D 不支持分类 模型。
接受分类的 3D 瓦片或地形必须是不透明的。
-
Default Value:
undefined
Experimental
此功能使用的是 3D Tiles 规范的一部分,该规范不是最终版本,并且可能会在没有 Cesium 标准弃用策略的情况下进行更改。
clippingPlanes : ClippingPlaneCollection
ClippingPlaneCollection
。
clippingPolygons : ClippingPolygonCollection
ClippingPolygonCollection
。
Cesium3DTileset#colorBlendMode
为 MIX
时,用于在源颜色和特征颜色之间线性插值的值。
值为 0.0 时,将生成源颜色,而值为 1.0 时,将生成特征颜色,介于两者之间的任何值
导致源颜色和特征颜色的混合。
-
Default Value:
0.5
colorBlendMode : Cesium3DTileColorBlendMode
-
Default Value:
Cesium3DTileColorBlendMode.HIGHLIGHT
-
Default Value:
true
-
Default Value:
60.0
customShader : CustomShader|undefined
Model
的内容。将自定义着色器与
Cesium3DTileStyle
可能会导致未定义的行为。
-
Default Value:
undefined
Experimental
此功能使用的是 3D Tiles 规范的一部分,该规范并非最终版本,并且可能会在没有 Cesium 标准弃用政策的情况下进行更改。
如果为 true,则为每个平铺分配随机颜色。 这对于可视化 哪些特征属于哪些瓦片,尤其是使用加法细化 WHERE 特征 来自父切片的要素可以与来自子切片的要素交错。
-
Default Value:
false
确定是否只应使用上一帧中的平铺进行渲染。 这 有效地将 tileset “冻结”到前一帧,以便可以缩放 出来,看看渲染了什么。
-
Default Value:
false
如果为 true,则渲染每个可见瓦片的边界体积。 边界体积为 如果磁贴具有内容边界卷或为空,则为白色;否则,它将变为红色。 不符合 屏幕空间错误,并且仍在优化其后代是黄色的。
-
Default Value:
false
如果为 true,则渲染每个可见图块内容的边界体积。边界体积为 如果磁贴具有内容边界体积,则为蓝色;否则为红色。
-
Default Value:
false
如果为 true,则绘制标签以指示每个图块的几何误差。
-
Default Value:
false
如果为 true,则绘制标签以指示每个瓦片的几何图形和纹理内存使用情况。
-
Default Value:
false
如果为 true,则绘制标签以指示每个图块的命令、点、三角形和功能的数量。
-
Default Value:
false
如果为 true,则绘制标签以指示每个图块的 URL。
-
Default Value:
false
如果为 true,则呈现每个图块的查看器请求量。
-
Default Value:
false
如果为 true,则将每个瓦片的内容呈现为线框。
-
Default Value:
false
当相机靠近图块集的地平面并查看 地平线。此外,对于紧密拟合的边界体积(如框和区域),结果更加准确。
-
Default Value:
true
Fog#density
类似,此选项控制 Cesium3DTileset#dynamicScreenSpaceError
的摄像机距离
优化适用。较大的值将导致靠近摄像机的图块受到影响。此值必须为
非负数。
此优化的工作原理是消除像钟形曲线一样的相机距离的平铺屏幕空间误差 (SSE)。
这具有选择远离摄像机的低分辨率图块的效果。在相机附近,不进行调整
䍬。对于较远的图块,SSE 最多可降低 Cesium3DTileset#dynamicScreenSpaceErrorFactor
(以误差像素为单位)。
增加密度会使钟形曲线变窄,因此更靠近摄像机的平铺会受到影响。这是类比的 将雾移近摄像机。
当密度为 0 时,优化对瓦片集没有影响。
-
Default Value:
2.0e-4
Cesium3DTileset#dynamicScreenSpaceError
的优化强度
地平线上的瓷砖。较大的值会导致加载较低分辨率的图块,从而略微提高运行时性能
降低视觉质量。该值必须为非负数。
更具体地说,此参数表示磁贴的屏幕空间误差 (SSE) 的最大调整值(以像素为单位)
远离相机。有关如何操作的更多详细信息,请参阅 Cesium3DTileset#dynamicScreenSpaceErrorDensity
此优化有效。
当 SSE 因子设置为 0 时,优化将对图块集没有影响。
-
Default Value:
24.0
Cesium3DTileset#dynamicScreenSpaceError
的“街道级别”的图块集高度比率
优化。当摄像头低于此高度时,动态屏幕空间误差优化将具有最大值
效果,并且它将在此值以上滚降。有效值介于 0.0 和 1.0 之间。
-
Default Value:
0.25
readonly ellipsoid : Ellipsoid
true
,则允许摄像机碰撞或拾取的碰撞。虽然这是真的
,但如果 ScreenSpaceCameraController#enableCollisionDetection
为 true,则相机将被阻止进入或低于图块集表面。如果图块集包含具有大量顶点的图块,则这可能会对性能产生影响。
-
Default Value:
false
readonly environmentMapManager : DynamicEnvironmentMapManager
Example:
// 将用于图块集环境贴图的地面颜色更改为森林绿色
const environmentMapManager = tileset.environmentMapManager;
environmentMapManager.groundColor = Cesium.Color.fromCssColorString("#203b34");
Experimental
此功能使用的是 3D Tiles 规范的一部分,该规范并非最终版本,并且可能会在没有 Cesium 标准弃用政策的情况下进行更改。
extras
属性,其中包含特定于应用程序的元数据。
如果 extras
不存在,则返回 undefined
。
对于EXT_mesh_features,这是要素 ID 的 label 属性,或者 “featureId_N”(其中 N 是 featureIds 数组中的索引),否则 指定。EXT_feature_metadata没有 label 字段,因此 要素 ID 集始终标记为“featureId_N”,其中 N 是 所有特征 ID 的列表,其中特征 ID 属性列在前面 特征 ID 纹理。
如果 featureIdLabel 设置为整数 N,则将其转换为 字符串 “featureId_N” 自动。如果每个基元和 存在每个实例的功能 ID,实例功能 ID 采用 优先权。
Experimental
此功能使用的是 3D Tiles 规范的一部分,该规范不是最终版本,并且可能会在没有 Cesium 标准弃用策略的情况下进行更改。
Cesium3DTileset#foveatedScreenSpaceError
为 true 时使用,以控制确定延迟哪些图块的圆锥体大小。
此圆锥体内的图块会立即加载。圆锥体外的图块可能会根据它们在圆锥体外的距离以及 Cesium3DTileset#foveatedInterpolationCallback
和 Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation
进行延迟。
将此设置为 0.0 意味着圆锥体将是摄像机位置及其视图方向形成的线。将此设置为 1.0 意味着圆锥体包含摄像机的整个视野,实质上会禁用该效果。
-
Default Value:
0.3
foveatedInterpolationCallback : Cesium3DTileset.foveatedInterpolationCallback
Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation
和 Cesium3DTileset#maximumScreenSpaceError
之间插值。
Cesium3DTileset#foveatedScreenSpaceError
为 true 时使用,以控制凹圆锥体外磁贴的起始屏幕空间误差松弛。
根据提供的 Cesium3DTileset#foveatedInterpolationCallback
,从此值开始,将引发屏幕空间错误,直到 Cesium3DTileset#maximumScreenSpaceError
。
-
Default Value:
0.0
Cesium3DTileset#foveatedConeSize
确定的屏幕中央的图块。
-
Default Value:
true
Cesium3DTileset#foveatedScreenSpaceError
为 true 时用于控制
在相机停止移动后,延迟图块开始加载之前要等待多长时间(以秒为单位)。
此时间延迟可防止在摄像机移动时请求屏幕边缘的磁贴。
将此设置为 0.0 将立即请求任何给定视图中的所有图块。
-
Default Value:
0.2
imageBasedLighting : ImageBasedLighting
仅在 Cesium3DTileset#skipLevelOfDetail
为 true
时使用。
-
Default Value:
false
initialTilesLoaded : Event
此事件在场景渲染后的帧结束时触发。
-
Default Value:
new Event()
Example:
tileset.initialTilesLoaded.addEventListener(function() {
console.log('Initial tiles are loaded');
});
See:
如果 instanceFeatureIdLabel 设置为整数 N,则将其转换为 字符串 “instanceFeatureId_N” 自动。 如果每个基元和每个实例的特征 ID 都存在,则 实例功能 ID 优先。
Experimental
此功能使用的是 3D Tiles 规范的一部分,该规范不是最终版本,并且可能会在没有 Cesium 标准弃用策略的情况下进行更改。
lightColor : Cartesian3
undefined
the scene's light color is used instead.
For example, disabling additional light sources by setting
tileset.imageBasedLighting.imageBasedLightingFactor = new Cartesian2(0.0, 0.0)
will make the tileset much darker. Here, increasing the intensity of the light source will make the tileset brighter.
-
Default Value:
undefined
loadProgress : Event
待处理磁贴请求的数量、numberOfPendingRequests
和磁贴数量
processing,numberOfTilesProcessing
将传递给事件侦听器。
此事件在场景渲染后的帧结束时触发。
-
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}`);
});
仅在 Cesium3DTileset#skipLevelOfDetail
为 true
时使用。
-
Default Value:
false
如果切片大小大于 cacheBytes
加上 maximumCacheOverflowBytes
需要满足所需的屏幕空间误差,由
Cesium3DTileset#maximumScreenSpaceError
表示当前视图,则
Cesium3DTileset#memoryAdjustedScreenSpaceError
将被调整
直到平铺所需的满足调整后的屏幕空间误差 使用较少
大于 cacheBytes
加上 maximumCacheOverflowBytes
。
-
Default Value:
536870912
See:
瓦片的屏幕空间误差大致相当于如果
半径等于瓦片的几何误差,则在瓦片的位置渲染。如果此值超过
maximumScreenSpaceError
磁贴细化为其后代。
根据图块集,可能需要调整 maximumScreenSpaceError
以实现适当的平衡。
值越高,性能越好,但视觉质量越低。
-
Default Value:
16
modelMatrix : Matrix4
-
Default Value:
Matrix4.IDENTITY
Example:
// Adjust a tileset's height from the globe's surface.
const heightOffset = 20.0;
const boundingSphere = tileset.boundingSphere;
const cartographic = Cesium.Cartographic.fromCartesian(boundingSphere.center);
const surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0.0);
const offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, heightOffset);
const translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3());
tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation);
outlineColor : Color
-
Default Value:
Color.BLACK
pointCloudShading : PointCloudShading
-
Default Value:
false
-
Default Value:
true
tileset.show
为 false
时预加载瓦片。加载瓦片,就好像瓦片集可见一样,但不渲染它们。
-
Default Value:
false
progressiveResolutionHeightFraction*screenHeight
的降低屏幕分辨率误差等于或高于或更高的磁贴将首先优先处理。这有助于在继续加载全分辨率图块的同时快速关闭图块层。
-
Default Value:
0.3
请参阅 properties 架构参考 在 3D Tiles 规范中了解完整的属性集。
Example:
console.log(`Maximum building height: ${tileset.properties.height.maximum}`);
console.log(`Minimum building height: ${tileset.properties.height.minimum}`);
See:
readonly resource : Resource
readonly root : Cesium3DTile
启用阴影会影响性能。投射阴影的图块集必须渲染两次,一次从摄像机渲染,另一次从光源的角度渲染。
仅当 Viewer#shadows
为 true
时,才会渲染阴影。
-
Default Value:
ShadowMode.ENABLED
-
Default Value:
true
-
Default Value:
false
-
Default Value:
true
替换优化遍历的常见策略是将树的所有级别存储在内存中,并且需要 在父项可以优化之前加载所有子项。通过此优化,可以跳过树的级别 完全,子项可以与父项一起呈现。在以下情况下,瓦片集需要的内存要少得多 使用此优化。
-
Default Value:
false
仅在 Cesium3DTileset#skipLevelOfDetail
为 true
时使用。
-
Default Value:
1
<= 100 / skipScreenSpaceErrorFactor
。
仅在 Cesium3DTileset#skipLevelOfDetail
为 true
时使用。
-
Default Value:
16
splitDirection : SplitDirection
SplitDirection
。
-
Default Value:
SplitDirection.NONE
style : Cesium3DTileStyle|undefined
分配 undefined
以删除样式,这将恢复视觉效果
未应用样式时,图块集的外观为默认值。
样式应用于 Cesium3DTileset#tileVisible
之前的瓦片
事件,因此 tileVisible
中的代码可以手动设置特征的
属性(例如 color 和 show)。什么时候
为新样式分配任何手动设置的属性都将被覆盖。
使用始终为 “true” 的条件为所有不是 “true” 的对象指定 Color 被原有疾病覆盖。否则,默认颜色 Cesium.Color.White 将被使用。同样,使用始终为 “true” 条件来指定 show 属性 对于未被预先存在的条件覆盖的所有对象。否则, 将使用默认的显示值 true。
-
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:
tileFailed : Event
如果没有事件侦听器,错误消息将记录到控制台。
传递给侦听器的 error 对象包含两个属性:
URL
:失败磁贴的 URL。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}`);
});
tileLoad : Event
加载的 Cesium3DTile
将传递给事件侦听器。
此事件在图块集遍历期间触发,同时渲染帧 以便对图块的更新在同一帧中生效。 请勿创建或修改 事件侦听器期间的 Cesium 实体或基元。
-
Default Value:
new Event()
Example:
tileset.tileLoad.addEventListener(function(tile) {
console.log('A tile was loaded.');
});
true
,则加载满足此帧的屏幕空间错误的所有图块。图块集为
完全加载此视图。
-
Default Value:
false
See:
tileUnload : Event
将卸载的 Cesium3DTile
传递给事件侦听器。
此事件在帧被卸载之前立即触发 rendered 的 Alpha S Interface,以便事件侦听器可以访问瓦片的内容。 不创建 或在事件侦听器期间修改 Cesium 实体或基元。
-
Default Value:
new Event()
Example:
tileset.tileUnload.addEventListener(function(tile) {
console.log('A tile was unloaded from the cache.');
});
See:
tileVisible : Event
可见的 Cesium3DTile
被传递给事件侦听器。
此事件在图块集遍历期间触发,同时渲染帧 以便对图块的更新在同一帧中生效。 请勿创建或修改 事件侦听器期间的 Cesium 实体或基元。
-
Default Value:
new Event()
Examples:
tileset.tileVisible.addEventListener(function(tile) {
if (tile.content instanceof Cesium.Model3DTileContent) {
console.log('A 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) {
const content = tile.content;
const featuresLength = content.featuresLength;
for (let i = 0; i < featuresLength; i+=2) {
content.getFeature(i).color = Cesium.Color.fromRandom();
}
});
-
Default Value:
false
Experimental
此功能使用的是 3D Tiles 规范的一部分,该规范不是最终版本,并且可能会在没有 Cesium 标准弃用策略的情况下进行更改。
Cesium3DTileFeature.getPolylinePositions
.
-
Default Value:
false
Experimental
此功能使用的是 3D Tiles 规范的一部分,该规范不是最终版本,并且可能会在没有 Cesium 标准弃用策略的情况下进行更改。
Methods
static Cesium.Cesium3DTileset.fromIonAssetId(assetId, options) → Promise.<Cesium3DTileset>
Name | Type | Description |
---|---|---|
assetId |
number | 铯离子资产 ID。 |
options |
Cesium3DTileset.ConstructorOptions | optional 一个描述初始化选项的对象 |
Returns:
Throws:
-
RuntimeError : When the tileset asset version is not 0.0, 1.0, or 1.1, or when the tileset contains a required extension that is not supported.
- Cesium3DTileset#fromUrl
Example:
// Load a Cesium3DTileset with a Cesium ion asset ID of 124624234
try {
const tileset = await Cesium.Cesium3DTileset.fromIonAssetId(124624234);
scene.primitives.add(tileset);
} catch (error) {
console.error(`Error creating tileset: ${error}`);
}
See:
static Cesium.Cesium3DTileset.fromUrl(url, options) → Promise.<Cesium3DTileset>
Name | Type | Description |
---|---|---|
url |
Resource | string | 图块集 JSON 文件的 URL。 |
options |
Cesium3DTileset.ConstructorOptions | optional 一个描述初始化选项的对象 |
Returns:
Throws:
-
RuntimeError : When the tileset asset version is not 0.0, 1.0, or 1.1, or when the tileset contains a required extension that is not supported.
- Cesium3DTileset#fromIonAssetId
Examples:
try {
const tileset = await Cesium.Cesium3DTileset.fromUrl(
"http://localhost:8002/tilesets/Seattle/tileset.json"
);
scene.primitives.add(tileset);
} catch (error) {
console.error(`Error creating tileset: ${error}`);
}
// Common setting for the skipLevelOfDetail optimization
const tileset = await Cesium.Cesium3DTileset.fromUrl(
"http://localhost:8002/tilesets/Seattle/tileset.json", {
skipLevelOfDetail: true,
baseScreenSpaceError: 1024,
skipScreenSpaceErrorFactor: 16,
skipLevels: 1,
immediatelyLoadDesiredLevelOfDetail: false,
loadSiblings: false,
cullWithChildrenBounds: true
});
scene.primitives.add(tileset);
// Common settings for the dynamicScreenSpaceError optimization
const tileset = await Cesium.Cesium3DTileset.fromUrl(
"http://localhost:8002/tilesets/Seattle/tileset.json", {
dynamicScreenSpaceError: true,
dynamicScreenSpaceErrorDensity: 2.0e-4,
dynamicScreenSpaceErrorFactor: 24.0,
dynamicScreenSpaceErrorHeightFalloff: 0.25
});
scene.primitives.add(tileset);
See:
Name | Type | Description |
---|---|---|
tilesetUrl |
Resource | string | 需要获取的 json 文件的 url |
Returns:
一旦对象被销毁,就不应该使用它;调用
isDestroyed
将导致 DeveloperError
异常。 因此
将返回值 (undefined
) 分配给对象,如示例中所示。
Throws:
-
DeveloperError : 这个物体被摧毁了,destroy().
Example:
tileset = tileset && tileset.destroy();
See:
Name | Type | Description |
---|---|---|
cartographic |
Cartographic | 要为其查找高度的制图。 |
scene |
Scene | 正在进行可视化的场景。 |
Returns:
Example:
const tileset = await Cesium.Cesium3DTileset.fromIonAssetId(124624234);
scene.primitives.add(tileset);
const height = tileset.getHeight(scene.camera.positionCartographic, scene);
则为 true
;否则为 false
。
Name | Type | Description |
---|---|---|
extensionName |
string | 要检查的扩展名。 |
Returns:
true
,如果图块集 JSON 文件在 extensionsUsed 中列出扩展名;否则为 false
。
Returns:
true
,如果此对象被销毁;否则为 false
。
Cesium3DTileset#style
标记为 dirty,这将强制所有
功能重新评估样式,在下一帧中每个都是可见的。
Cesium3DTileset#cacheBytes
.
图块卸载发生在下一帧,以保留所有 WebGL 删除调用 在渲染循环中。
Type Definitions
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
show |
boolean |
<optional> |
true | 确定是否显示图块集。 |
modelMatrix |
Matrix4 |
<optional> |
Matrix4.IDENTITY | 一个 4x4 变换矩阵,用于变换瓦片集的根瓦片。 |
modelUpAxis |
Axis |
<optional> |
Axis.Y | 在加载瓦片内容的模型时,哪个轴被认为是向上的。 |
modelForwardAxis |
Axis |
<optional> |
Axis.X | 在加载瓦片内容的模型时,哪个轴被视为向前。 |
shadows |
ShadowMode |
<optional> |
ShadowMode.ENABLED | 确定图块集是投射还是接收来自光源的阴影。 |
maximumScreenSpaceError |
number |
<optional> |
16 | 用于驱动细节层次细化的最大屏幕空间误差。 |
cacheBytes |
number |
<optional> |
536870912 | 如果缓存包含当前视图不需要的切片,则切片缓存将被修剪到的大小(以字节为单位)。 |
maximumCacheOverflowBytes |
number |
<optional> |
536870912 | 如果当前视图需要超过 Cesium3DTileset#cacheBytes ,则允许缓存空间的最大额外内存(以字节为单位)。 |
cullWithChildrenBounds |
boolean |
<optional> |
true | 优化选项。是否使用其子边界体积的并集来剔除平铺。 |
cullRequestsWhileMoving |
boolean |
<optional> |
true | 优化选项。不要请求由于摄像机移动而返回时可能未使用的图块。此优化仅适用于固定图块集。 |
cullRequestsWhileMovingMultiplier |
number |
<optional> |
60.0 | 优化选项。移动时剔除请求中使用的乘数。较大的剔除较为激进,较小的剔除较不激进。 |
preloadWhenHidden |
boolean |
<optional> |
false | 当 tileset.show 为 false 时预加载瓦片。加载瓦片,就好像瓦片集可见一样,但不渲染它们。 |
preloadFlightDestinations |
boolean |
<optional> |
true | 优化选项。当摄像机正在飞行时,在摄像机的飞行目的地预加载切片。 |
preferLeaves |
boolean |
<optional> |
false | 优化选项。喜欢先加载叶子。 |
dynamicScreenSpaceError |
boolean |
<optional> |
true | 优化选项。对于街道级别的地平线视图,请使用远离摄像机的较低分辨率图块。这减少了加载的数据量并缩短了图块集加载时间,但远处的视觉质量会略有下降。 |
dynamicScreenSpaceErrorDensity |
number |
<optional> |
2.0e-4 | 与 Fog#density 类似,此选项控制应用 Cesium3DTileset#dynamicScreenSpaceError 优化的摄像机距离。较大的值将导致靠近摄像机的图块受到影响。 |
dynamicScreenSpaceErrorFactor |
number |
<optional> |
24.0 | 一个参数,用于控制地平线上图格的 Cesium3DTileset#dynamicScreenSpaceError 优化强度。较大的值会导致加载较低分辨率的图块,从而提高运行时性能,但会降低视觉质量。 |
dynamicScreenSpaceErrorHeightFalloff |
number |
<optional> |
0.25 | 图块集高度的比率,它决定了“街道级别”摄像机视图的位置。当摄像机低于此高度时,Cesium3DTileset#dynamicScreenSpaceError 优化将产生最大效果,并且它将在此值以上滚降。 |
progressiveResolutionHeightFraction |
number |
<optional> |
0.3 | 优化选项。如果介于 (0.0, 0.5) 之间,则 progressiveResolutionHeightFraction*screenHeight 的降低屏幕分辨率误差等于或高于或更高的磁贴将首先优先处理。这有助于在继续加载全分辨率图块的同时快速关闭图块层。 |
foveatedScreenSpaceError |
boolean |
<optional> |
true | 优化选项。通过暂时提高屏幕边缘图块的屏幕空间误差,优先在屏幕中心加载图块。一旦加载了由 Cesium3DTileset#foveatedConeSize 确定的屏幕中心的所有图块,屏幕空间错误就会恢复正常。 |
foveatedConeSize |
number |
<optional> |
0.1 | 优化选项。当 Cesium3DTileset#foveatedScreenSpaceError 为 true 时使用,以控制确定延迟哪些图块的圆锥体大小。此圆锥体内的切片将立即加载。圆锥体外的图块可能会根据它们在圆锥体外的距离及其屏幕空间误差而延迟。这由 Cesium3DTileset#foveatedInterpolationCallback 和 Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation 控制。将此设置为 0.0 意味着圆锥体将是摄像机位置及其视图方向形成的线。将此设置为 1.0 意味着圆锥体包含摄像机的整个视野,从而禁用该效果。 |
foveatedMinimumScreenSpaceErrorRelaxation |
number |
<optional> |
0.0 | 优化选项。当 Cesium3DTileset#foveatedScreenSpaceError 为 true 时使用,以控制凹圆锥体外磁贴的起始屏幕空间误差松弛。根据提供的 {@link@link Cesium3DTileset#foveatedInterpolationCallback},将从图块集值开始引发屏幕空间错误,最高为 { Cesium3DTileset#maximumScreenSpaceError}。 |
foveatedInterpolationCallback |
Cesium3DTileset.foveatedInterpolationCallback |
<optional> |
Math.lerp | 优化选项。当 Cesium3DTileset#foveatedScreenSpaceError 为 true 时使用,以控制在注视点圆锥体之外的图块的屏幕空间误差增加多少,在 Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation 和 Cesium3DTileset#maximumScreenSpaceError 之间插值 |
foveatedTimeDelay |
number |
<optional> |
0.2 | 优化选项。当 Cesium3DTileset#foveatedScreenSpaceError 为 true 时使用,以控制在摄像机停止移动后,延迟图块开始加载之前等待多长时间(以秒为单位)。此时间延迟可防止在摄像机移动时请求屏幕边缘周围的图块。将此设置为 0.0 将立即请求任何给定视图中的所有图块。 |
skipLevelOfDetail |
boolean |
<optional> |
false | 优化选项。确定在遍历期间是否应应用细节级别跳过。 |
baseScreenSpaceError |
number |
<optional> |
1024 | 当 skipLevelOfDetail 为 true 时,在跳过细节级别之前必须达到的屏幕空间错误。 |
skipScreenSpaceErrorFactor |
number |
<optional> |
16 | 当 skipLevelOfDetail 为 true 时,定义要跳过的最小屏幕空间误差的乘数。与 skipLevels 结合使用,以确定要加载的图块。 |
skipLevels |
number |
<optional> |
1 | 当 skipLevelOfDetail 为 true 时,一个常量,用于定义加载瓦片时要跳过的最小级别数。当它为 0 时,不会跳过任何级别。与 skipScreenSpaceErrorFactor 结合使用,以确定要加载的图块。 |
immediatelyLoadDesiredLevelOfDetail |
boolean |
<optional> |
false | 当 skipLevelOfDetail 为 true 时,将仅下载满足最大屏幕空间错误的磁贴。跳过因素将被忽略,仅加载所需的切片。 |
loadSiblings |
boolean |
<optional> |
false | 当 skipLevelOfDetail 为 true 时,确定在遍历期间是否始终下载可见瓦片的同级。 |
clippingPlanes |
ClippingPlaneCollection |
<optional> |
用于选择性地禁用图块集渲染的 ClippingPlaneCollection 。 |
|
clippingPolygons |
ClippingPolygonCollection |
<optional> |
用于选择性地禁用渲染图块集的 ClippingPolygonCollection 。 |
|
classificationType |
ClassificationType |
<optional> |
确定地形和/或 3D 瓦片是否由此瓦片集进行分类。请参阅 Cesium3DTileset#classificationType 了解有关限制和限制的详细信息。 |
|
ellipsoid |
Ellipsoid |
<optional> |
Ellipsoid.WGS84 | 决定地球大小和形状的椭球体。 |
pointCloudShading |
object |
<optional> |
用于构建 PointCloudShading 对象的选项,以根据几何误差和照明控制点衰减。 |
|
lightColor |
Cartesian3 |
<optional> |
对模型进行着色时的光色。如果undefined ,则使用场景的 light 颜色。 |
|
imageBasedLighting |
ImageBasedLighting |
<optional> |
用于管理此图块集的基于图像的光照的属性。 | |
environmentMapOptions |
DynamicEnvironmentMapManager.ConstructorOptions |
<optional> |
用于管理此图块集上的动态环境地图的属性。 | |
backFaceCulling |
boolean |
<optional> |
true | 是否剔除背面的几何体。如果为 true,则背面剔除由 glTF 材质的 doubleSided 属性确定;如果为 false,则禁用背面剔除。 |
enableShowOutline |
boolean |
<optional> |
true | 是否为使用 CESIUM_primitive_outline 扩展。可以将其设置为 false,以避免在加载时对几何体进行额外处理。如果为 false,则忽略 showOutlines 和 outlineColor 选项。 |
showOutline |
boolean |
<optional> |
true | 是否显示使用 CESIUM_primitive_outline 扩展。如果为 true,则显示轮廓。如果为 false,则不显示轮廓。 |
outlineColor |
Color |
<optional> |
Color.BLACK | 渲染轮廓时要使用的颜色。 |
vectorClassificationOnly |
boolean |
<optional> |
false | 表示只应使用瓦片集的矢量瓦片进行分类。 |
vectorKeepDecodedPositions |
boolean |
<optional> |
false | 矢量瓦片是否应在内存中保留解码的位置。这与 Cesium3DTileFeature.getPolylinePositions 一起使用。 |
featureIdLabel |
string | number |
<optional> |
“featureId_0” | 用于选取和样式的特征 ID 集的标签。对于 EXT_mesh_features,这是特征 ID 的 label 属性,如果未指定,则为 “featureId_N”(其中 N 是 featureIds 数组中的索引)。EXT_feature_metadata没有标注字段,因此此类要素 ID 集始终标记为“featureId_N”,其中 N 是所有要素 ID 列表中的索引,其中要素 ID 属性列在要素 ID 纹理之前。如果 featureIdLabel 是整数 N,则会自动转换为字符串 featureId_N。如果每个基元和每个实例的特征 ID 都存在,则实例特征 ID 优先。 |
instanceFeatureIdLabel |
string | number |
<optional> |
“instanceFeatureId_0” | 用于选取和样式的实例特征 ID 集的标签。如果 instanceFeatureIdLabel 设置为整数 N,则会自动转换为字符串 instanceFeatureId_N。如果每个基元和每个实例的特征 ID 都存在,则实例特征 ID 优先。 |
showCreditsOnScreen |
boolean |
<optional> |
false | 是否在屏幕上显示此图块集的制作人员名单。 |
splitDirection |
SplitDirection |
<optional> |
SplitDirection.NONE | 应用于此图块集的 SplitDirection 分割。 |
enableCollision |
boolean |
<optional> |
false | 如果为 true ,则为摄像机或 CPU 拾取启用碰撞。虽然这是真的 ,但如果 ScreenSpaceCameraController#enableCollisionDetection 为 true,则相机将无法低于图块集表面。 |
projectTo2D |
boolean |
<optional> |
false | 是否将瓦片集精确投影为 2D。如果为 true,则图块集将精确投影到 2D,但会使用更多内存来执行此操作。如果为 false,则图块集将使用较少的内存,并且仍将以 2D / CV 模式渲染,但其投影位置可能不准确。创建图块集后,无法设置此项。 |
enablePick |
boolean |
<optional> |
false | 在使用 WebGL 1 时,是否允许使用 pick 进行碰撞和 CPU 拾取。如果使用 WebGL 2 或更高版本,则此选项将被忽略。如果使用 WebGL 1 并且这是真的,则 pick 操作将正常工作,但它会使用更多内存来执行此操作。如果使用 WebGL 1 运行并且为 false,则模型将使用更少的内存,但 pick 将始终返回 undefined 。加载图块集后无法设置此项。 |
debugHeatmapTilePropertyName |
string |
<optional> |
要作为热图着色的图块变量。所有渲染的瓦片都将相对于彼此的指定变量值进行着色。 | |
debugFreezeFrame |
boolean |
<optional> |
false | 仅用于调试。确定是否只应使用上一帧中的平铺进行渲染。 |
debugColorizeTiles |
boolean |
<optional> |
false | 仅用于调试。如果为 true,则为每个平铺分配随机颜色。 |
enableDebugWireframe |
boolean |
<optional> |
false | 仅用于调试。要使 debugWireframe 在 WebGL1 中工作,必须如此。创建图块集后,无法设置此项。 |
debugWireframe |
boolean |
<optional> |
false | 仅用于调试。如果为 true,则将每个图块的内容渲染为线框。 |
debugShowBoundingVolume |
boolean |
<optional> |
false | 仅用于调试。如果为 true,则渲染每个图块的边界体积。 |
debugShowContentBoundingVolume |
boolean |
<optional> |
false | 仅用于调试。如果为 true,则渲染每个图块内容的边界体积。 |
debugShowViewerRequestVolume |
boolean |
<optional> |
false | 仅用于调试。如果为 true,则呈现每个图块的查看器请求量。 |
debugShowGeometricError |
boolean |
<optional> |
false | 仅用于调试。如果为 true,则绘制标签以指示每个图块的几何误差。 |
debugShowRenderingStatistics |
boolean |
<optional> |
false | 仅用于调试。如果为 true,则绘制标签以指示每个图块的命令、点、三角形和功能的数量。 |
debugShowMemoryUsage |
boolean |
<optional> |
false | 仅用于调试。如果为 true,则绘制标签以指示每个图块使用的纹理和几何内存(以 MB 为单位)。 |
debugShowUrl |
boolean |
<optional> |
false | 仅用于调试。如果为 true,则绘制标签以指示每个图块的 URL。 |
Cesium3DTileset#foveatedScreenSpaceError
为 true 时用作回调,以控制在注视点圆锥体之外的图块的屏幕空间误差的提高程度,
在 Cesium3DTileset#foveatedMinimumScreenSpaceErrorRelaxation
和 Cesium3DTileset#maximumScreenSpaceError
之间插值。
Name | Type | Description |
---|---|---|
p |
number | 要插值的起始值。 |
q |
number | 要插值的结束值。 |
time |
number |
插值时间一般在 [0.0, 1.0] 范围内。 |
Returns:
-
Default Value:
Math.lerp