CesiumWidget 默认创建的.
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
下列属性的对象 :
|
Throws:
-
DeveloperError : options and options.canvas are required.
Example:
// Create scene without anisotropic texture filtering
const scene = new Cesium.Scene({
canvas : canvas,
contextOptions : {
allowTextureFilterAnisotropic : false
}
});
See:
Members
Scene#logarithmicDepthBuffer in newly constructed Scenes
此属性依赖于对碎片深度的支持 .
-
Default Value:
false
atmosphere : Atmosphere
Scene#skyAtmosphere which is responsible for rendering the sky.
backgroundColor : Color
Scene#skyBox is undefined.
-
Default Value:
Color.BLACK
See:
readonly camera : Camera
-
Default Value:
false
true if the Scene#clampToHeight and Scene#clampToHeightMostDetailed functions are supported.
-
Default Value:
true
决定命令执行的函数 。 如下所示:,
the function receives the command's owner as an argument, and returns a boolean indicating if the
命令应当执行.
默认为 NT 0 undefine NT 1 ,表示所有命令都已执行.
-
Default Value:
undefined
Example:
// Do not execute any commands.
scene.debugCommandFilter = function(command) {
return false;
};
// Execute only the billboard's commands. That is, only draw the billboard.
const billboards = new Cesium.BillboardCollection();
scene.debugCommandFilter = function(command) {
return command.owner === billboards;
};
When Scene.debugShowFrustums is true, this contains
属性,其中包含每个节点执行命令数的统计.
totalCommands is the total number of commands executed, ignoring
重叠。 #NT##0 commands InFrustums NT###1 是一个有次数的阵列
命令被冗余执行, e.g .,有多少命令与两个或两个重复
three frustums.
-
Default Value:
undefined
当 NT 0 真 NT 1 时,命令会随机遮蔽. 这个有用 以了解场景或模型的哪些部分 并可从批量处理中受益.
-
Default Value:
false
显示显示深度信息 .
-
Default Value:
1
每秒显示帧,每帧之间显示时间.
-
Default Value:
false
当 NT##0 真 NT 1 时,绘制大纲以显示相机frustums的边界
-
Default Value:
false
当 NT 0 true NT 1 时,命令根据它们的花纹进行遮蔽 重叠。 最近的十字架上的命令是红色的,命令在 最近的是绿色,最远处的命令是 蓝色 如果一个命令重叠了多个 frustum, 颜色组件 are combined, e.g., a command overlapping the first two frustums is tinted yellow.
-
Default Value:
false
See:
See:
readonly ellipsoid : Ellipsoid
这个值用于为多裂纹的每个节点创建近和远的值. 只用这个
when Scene#logarithmicDepthBuffer is false. When logarithmicDepthBuffer is
true, use Scene#logarithmicDepthFarToNearRatio.
-
Default Value:
1000.0
fog : Fog
-
Default Value:
2.2
globe : Globe
readonly groundPrimitives : PrimitiveCollection
-
Default Value:
false
-
Default Value:
true
readonly imageryLayers : ImageryLayerCollection
Scene#invertClassificationColor.
-
Default Value:
false
invertClassificationColor : Color
Scene#invertClassification is true.
当颜色的alpha小于1.0时,3D梯的未分类部分不会与3D NT %2 的分类位置正确混合
当颜色的α小于1.0时,WEBGL 深度 纹理和EXT frag 深度 NT 0 扩展必须是 NT 3
-
Default Value:
Color.WHITE
readonly lastRenderTime : JulianDate|undefined
light : Light
这个值用于为多裂纹的每个节点创建近和远的值. 只用这个
when Scene#logarithmicDepthBuffer is true. When logarithmicDepthBuffer is
false, use Scene#farToNearRatio.
-
Default Value:
1e9
readonly mapMode2D : MapMode2D
readonly mapProjection : MapProjection
-
Default Value:
new GeographicProjection()
- glGet with
ALIASED_LINE_WIDTH_RANGE.
See:
- glGet with
GL_MAX_CUBE_MAP_TEXTURE_SIZE.
See:
Scene#requestRenderMode is true, this value defines the maximum change in
允许在请求渲染前使用模拟时间。 数值较低者会增加帧数
和更高的数值减少了帧数。 如果 NT 0 未定义 NT 1 ,则更改为
模拟时间永远不会要求一个渲染.
此值会影响场景变化的渲染率,如照明,实体属性更新,
and animations.
-
Default Value:
0.0
See:
-
Default Value:
0.0
mode : SceneMode
-
Default Value:
SceneMode.SCENE3D
moon : Moon|undefined
Moon ~
-
Default Value:
undefined
morphComplete : Event
-
Default Value:
Event()
morphStart : Event
-
Default Value:
Event()
-
Default Value:
1.0
-
Default Value:
4
-
Default Value:
1.75e6
true if the Scene#pickPosition function is supported.
See:
true, enables picking translucent geometry using the depth buffer. Note that Scene#useDepthPicking must also be true for enabling this to work.
启用时性能下降。 有额外的绘图呼叫要写入深度 translucent geometry.
-
Default Value:
false
Example:
// picking the position of a translucent primitive
viewer.screenSpaceEventHandler.setInputAction(function onLeftClick(movement) {
const pickedFeature = viewer.scene.pick(movement.position);
if (!Cesium.defined(pickedFeature)) {
// nothing picked
return;
}
const worldPosition = viewer.scene.pickPosition(movement.position);
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
postProcessStages : PostProcessStageCollection
readonly postRender : Event
readonly postUpdate : Event
readonly preRender : Event
readonly preUpdate : Event
readonly primitives : PrimitiveCollection
readonly renderError : Event
render function.
Scene 实例和抛出的错误是传递给事件处理器的唯一两个参数.
默认情况下, 错误不会在此事件升起后重排, 但可以通过设置更改
the rethrowRenderErrors property.
Scene#requestRender
以此模式创建新框架。 在许多情况下,这在作出修改后是必要的
到现场在 NT 0 的其他地方.
-
Default Value:
false
See:
renderError event. If this property is true, the error is rethrown
after the event is raised. If this property is false, the render function
通常在升起事件后返回.
-
Default Value:
false
readonly screenSpaceCameraController : ScreenSpaceCameraController
shadowMap : ShadowMap
skyAtmosphere : SkyAtmosphere|undefined
-
Default Value:
undefined
skyBox : SkyBox|undefined
SkyBox used to draw the stars.
-
Default Value:
undefined
See:
true if specular environment maps are supported.
sphericalHarmonicCoefficients : Array.<Cartesian3>
sun : Sun|undefined
Sun.
-
Default Value:
undefined
-
Default Value:
true
terrainProvider : TerrainProvider
readonly terrainProviderChanged : Event
-
Default Value:
true
-
Default Value:
false
-
Default Value:
1.0
-
Default Value:
0.0
Methods
cartesianToCanvasCoordinates(position, result) → Cartesian2|undefined
| Name | Type | Description |
|---|---|---|
position |
Cartesian3 | 笛卡尔座标中的位置. |
result |
Cartesian2 | optional 可选对象返回转换为画布坐标的输入位置 . |
Returns:
unguide .
Example:
// Output the canvas position of longitude/latitude (0, 0) every time the mouse moves.
const scene = widget.scene;
const position = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
const handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
handler.setInputAction(function(movement) {
console.log(scene.cartesianToCanvasCoordinates(position));
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
clampToHeight(cartesian, objectsToExclude, width, result) → Cartesian3|undefined
此函数只抓住当前视图中渲染的地球牌和三维牌。 粘贴到 所有其它原始人,不管他们的能见度如何.
| Name | Type | Default | Description |
|---|---|---|---|
cartesian |
Cartesian3 | 笛卡尔的位置. | |
objectsToExclude |
Array.<object> | optional 列出原始物,实体,或三维梯状物特征,以不受夹击. | |
width |
number |
0.1
|
optional Width of the intersection volume in meters. |
result |
Cartesian3 | optional 可选对象返回夹住的位置 . |
Returns:
Throws:
-
DeveloperError : clampToHeight is only supported in 3D mode.
-
DeveloperError : clampToHeight requires depth texture support. Check clampToHeightSupported.
Example:
// Clamp an entity to the underlying scene geometry
const position = entity.position.getValue(Cesium.JulianDate.now());
entity.position = viewer.scene.clampToHeight(position);
See:
clampToHeightMostDetailed(cartesians, objectsToExclude, width) → Promise.<Array.<(Cartesian3|undefined)>>
Scene#clampToHeight query for an array of Cartesian3 positions
使用场景中3D 梯形的最大细节级别. 返回一个承诺,当
查询完成。 每个职位都有修改。 如果一个位置由于没有几何而不能被夹住
可以在那个位置进行采样,或者发生另一个错误,数组中的元素被设定为未定义.
| Name | Type | Default | Description |
|---|---|---|---|
cartesians |
Array.<Cartesian3> | 笛卡尔的姿势要用夹住的姿势更新. | |
objectsToExclude |
Array.<object> | optional 列出原始物,实体,或三维梯状物特征,以不受夹击. | |
width |
number |
0.1
|
optional Width of the intersection volume in meters. |
Returns:
undefined if they cannot be clamped.
Throws:
-
DeveloperError : clampToHeightMostDetailed is only supported in 3D mode.
-
DeveloperError : clampToHeightMostDetailed requires depth texture support. Check clampToHeightSupported.
Example:
const cartesians = [
entities[0].position.getValue(Cesium.JulianDate.now()),
entities[1].position.getValue(Cesium.JulianDate.now())
];
const promise = viewer.scene.clampToHeightMostDetailed(cartesians);
promise.then(function(updatedCartesians) {
entities[0].position = updatedCartesians[0];
entities[1].position = updatedCartesians[1];
}
See:
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 : This object was destroyed, i.e., destroy() was called.
Example:
scene = scene && scene.destroy();
See:
primitive property, for all primitives at
特定窗口坐标位置。 其他属性也可根据下列情况确定:
类型原始,可用于进一步识别所选对象。 原始人进入
名单由他们在现场的视觉顺序(前向后)排序.
| Name | Type | Default | Description |
|---|---|---|---|
windowPosition |
Cartesian2 | 要执行的窗口坐标 . | |
limit |
number | optional 如果供应,在收集了这么多采样后,停止钻探. | |
width |
number |
3
|
optional Width of the pick rectangle. |
height |
number |
3
|
optional Height of the pick rectangle. |
Returns:
Throws:
-
DeveloperError : windowPosition is undefined.
Example:
const pickedObjects = scene.drillPick(new Cesium.Cartesian2(100.0, 200.0));
See:
| Name | Type | Description |
|---|---|---|
format |
string | The texture format. May be the name of the format or the WebGL extension name, e.g. s3tc or WEBGL_compressed_texture_s3tc. |
Returns:
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.
See:
| Name | Type | Default | Description |
|---|---|---|---|
duration |
number |
2.0
|
optional 过渡动画完成的时间,以秒计. |
| Name | Type | Default | Description |
|---|---|---|---|
duration |
number |
2.0
|
optional 过渡动画完成的时间,以秒计. |
| Name | Type | Default | Description |
|---|---|---|---|
duration |
number |
2.0
|
optional 过渡动画完成的时间,以秒计. |
When a feature of a 3D Tiles tileset is picked, pick returns a Cesium3DTileFeature object.
| Name | Type | Default | Description |
|---|---|---|---|
windowPosition |
Cartesian2 | Window coordinates to perform picking on. | |
width |
number |
3
|
optional Width of the pick rectangle. |
height |
number |
3
|
optional Height of the pick rectangle. |
Returns:
undefined if nothing is at the location.
Example:
// On mouse over, color the feature yellow.
handler.setInputAction(function(movement) {
const feature = scene.pick(movement.endPosition);
if (feature instanceof Cesium.Cesium3DTileFeature) {
feature.color = Cesium.Color.YELLOW;
}
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
| Name | Type | Default | Description |
|---|---|---|---|
windowPosition |
Cartesian2 | Window coordinates to perform picking on. | |
width |
number |
3
|
optional Width of the pick rectangle. |
height |
number |
3
|
optional Height of the pick rectangle. |
Returns:
undefined if nothing is at the location.
Example:
// On mouse over, color the feature yellow.
handler.setInputAction(function(movement) {
const feature = scene.pickAsync(movement.endPosition).then(function(feature) {
if (feature instanceof Cesium.Cesium3DTileFeature) {
feature.color = Cesium.Color.YELLOW;
}
});
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
See:
pickMetadata(windowPosition, schemaId, className, propertyName) → MetadataValue|undefined
| Name | Type | Description |
|---|---|---|
windowPosition |
Cartesian2 | 要执行的窗口坐标 . |
schemaId |
string | undefined |
用于选择值的元数据计划的ID
from. If this is undefined, then it will pick the values from the object
符合给定的类名和财产名的, 不论计划编号. |
className |
string | 要选择的元数据类名称 values from |
propertyName |
string | 要选择的元数据属性名称 values from |
Returns:
Experimental
This feature is not final and is subject to change without Cesium's standard deprecation policy.
pickMetadataSchema(windowPosition) → MetadataSchema|undefined
| Name | Type | Description |
|---|---|---|
windowPosition |
Cartesian2 | 要执行的窗口坐标 . |
Returns:
undefined if there is no object with
在给定位置上关联元数据.
Experimental
This feature is not final and is subject to change without Cesium's standard deprecation policy.
pickPosition(windowPosition, result) → Cartesian3
从2D的深度缓冲器重建的位置可能与那些稍有不同 重建于3D和哥伦布景区. 这是因为分配的不同 透视和正图投影的深度值.
Set Scene#pickTranslucentDepth to true to include the depth of
半透明原始人;否则,这基本上是通过半透明原始人采摘的.
| Name | Type | Description |
|---|---|---|
windowPosition |
Cartesian2 | 要执行的窗口坐标 . |
result |
Cartesian3 | optional 用于恢复结果的对象. |
Returns:
Throws:
-
DeveloperError : Picking from the depth buffer is not supported. Check pickPositionSupported.
pickVoxel(windowPosition, width, height) → VoxelCell|undefined
VoxelCell for the voxel sample rendered at a particular window coordinate,
如果该位置没有调色器 .
| Name | Type | Default | Description |
|---|---|---|---|
windowPosition |
Cartesian2 | Window coordinates to perform picking on. | |
width |
number |
3
|
optional Width of the pick rectangle. |
height |
number |
3
|
optional Height of the pick rectangle. |
Returns:
undefined if no voxel is rendered at that position.
Example:
On left click, report the value of the "color" property at that voxel sample.
handler.setInputAction(function(movement) {
const voxelCell = scene.pickVoxel(movement.position);
if (defined(voxelCell)) {
console.log(voxelCell.getProperty("color"));
}
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
Experimental
This feature is not final and is subject to change without Cesium's standard deprecation policy.
CesiumWidget 将自动完成.
| Name | Type | Description |
|---|---|---|
time |
JulianDate | optional 模拟时间. |
Scene#requestRenderMode is set to true.
The render rate will not exceed the CesiumWidget#targetFrameRate.
undefined if there was no
场景几何到样本高度。 输入位置的高度被忽略. 可能用于夹住对象到
地球,三维梯,或原始人 在现场.
此函数仅从当前视图中渲染的地球牌和三维牌的高度样本 。 样本高度 来自其他原始人 不管他们的能见度.
| Name | Type | Default | Description |
|---|---|---|---|
position |
Cartographic | 绘图位置来取样高度. | |
objectsToExclude |
Array.<object> | optional 列出原始物,实体,或3D梯状物特征列表,不从中取样高度. | |
width |
number |
0.1
|
optional Width of the intersection volume in meters. |
Returns:
Throws:
-
DeveloperError : sampleHeight is only supported in 3D mode.
-
DeveloperError : sampleHeight requires depth texture support. Check sampleHeightSupported.
Example:
const position = new Cesium.Cartographic(-1.31968, 0.698874);
const height = viewer.scene.sampleHeight(position);
console.log(height);
See:
sampleHeightMostDetailed(positions, objectsToExclude, width) → Promise.<Array.<(Cartographic|undefined)>>
Scene#sampleHeight query for an array of Cartographic positions
使用场景中3D 梯形的最大细节级别. 输入位置的高度被忽略.
返回一个在查询完成后解决的许诺 。 每点高度都会被修改到位.
如果一个高度不能确定,因为无法在该地点取样,或者发生另一个错误,
高度设置为 NT 0 未定义 NT 1 .
| Name | Type | Default | Description |
|---|---|---|---|
positions |
Array.<Cartographic> | 以取样高度更新的制图位置. | |
objectsToExclude |
Array.<object> | optional 列出原始物,实体,或3D梯状物特征列表,不从中取样高度. | |
width |
number |
0.1
|
optional Width of the intersection volume in meters. |
Returns:
undefined if the height cannot be determined.
Throws:
-
DeveloperError : sampleHeightMostDetailed is only supported in 3D mode.
-
DeveloperError : sampleHeightMostDetailed requires depth texture support. Check sampleHeightSupported.
Example:
const positions = [
new Cesium.Cartographic(-1.31968, 0.69887),
new Cesium.Cartographic(-1.10489, 0.83923)
];
const promise = viewer.scene.sampleHeightMostDetailed(positions);
promise.then(function(updatedPosition) {
// positions[0].height and positions[1].height have been updated.
// updatedPositions is just a reference to positions.
}
See:
setTerrain(terrain) → Terrain
| Name | Type | Description |
|---|---|---|
terrain |
Terrain | 地形提供者 Aync 帮助器 |
Returns:
Examples:
// Use Cesium World Terrain
scene.setTerrain(Cesium.Terrain.fromWorldTerrain());
// Use a custom terrain provider
const terrain = new Cesium.Terrain(Cesium.CesiumTerrainProvider.fromUrl("https://myTestTerrain.com"));
scene.setTerrain(terrain);
terrain.errorEvent.addEventListener(error => {
alert(`Encountered an error while creating terrain! ${error}`);
});