Appearance
KBE3D / KBCore / Cesium / Globe
类: Globe
The globe rendered in the scene, including its terrain (Globe#terrainProvider) and imagery layers (Globe#imageryLayers). Access the globe using Scene#globe.
参数
Determines the size and shape of the globe.
属性
show
show:
boolean
Determines if the globe will be shown.
maximumScreenSpaceError
maximumScreenSpaceError:
number
The maximum screen-space error used to drive level-of-detail refinement. Higher values will provide better performance but lower visual quality.
tileCacheSize
tileCacheSize:
number
The size of the terrain tile cache, expressed as a number of tiles. Any additional tiles beyond this number will be freed, as long as they aren't needed for rendering this frame. A larger number will consume more memory but will show detail faster when, for example, zooming out and then back in.
loadingDescendantLimit
loadingDescendantLimit:
number
Gets or sets the number of loading descendant tiles that is considered "too many". If a tile has too many loading descendants, that tile will be loaded and rendered before any of its descendants are loaded and rendered. This means more feedback for the user that something is happening at the cost of a longer overall load time. Setting this to 0 will cause each tile level to be loaded successively, significantly increasing load time. Setting it to a large number (e.g. 1000) will minimize the number of tiles that are loaded but tend to make detail appear all at once after a long wait.
preloadAncestors
preloadAncestors:
boolean
Gets or sets a value indicating whether the ancestors of rendered tiles should be preloaded. Setting this to true optimizes the zoom-out experience and provides more detail in newly-exposed areas when panning. The down side is that it requires loading more tiles.
preloadSiblings
preloadSiblings:
boolean
Gets or sets a value indicating whether the siblings of rendered tiles should be preloaded. Setting this to true causes tiles with the same parent as a rendered tile to be loaded, even if they are culled. Setting this to true may provide a better panning experience at the cost of loading more tiles.
fillHighlightColor
fillHighlightColor:
Color
The color to use to highlight terrain fill tiles. If undefined, fill tiles are not highlighted at all. The alpha value is used to alpha blend with the tile's actual color. Because terrain fill tiles do not represent the actual terrain surface, it may be useful in some applications to indicate visually that they are not to be trusted.
enableLighting
enableLighting:
boolean
Enable lighting the globe with the scene's light source.
lambertDiffuseMultiplier
lambertDiffuseMultiplier:
number
A multiplier to adjust terrain lambert lighting. This number is multiplied by the result of <code>czm_getLambertDiffuse</code> in GlobeFS.glsl. This only takes effect when <code>enableLighting</code> is <code>true</code>.
dynamicAtmosphereLighting
dynamicAtmosphereLighting:
boolean
Enable dynamic lighting effects on atmosphere and fog. This only takes effect when <code>enableLighting</code> is <code>true</code>.
dynamicAtmosphereLightingFromSun
dynamicAtmosphereLightingFromSun:
boolean
Whether dynamic atmosphere lighting uses the sun direction instead of the scene's light direction. This only takes effect when <code>enableLighting</code> and <code>dynamicAtmosphereLighting</code> are <code>true</code>.
showGroundAtmosphere
showGroundAtmosphere:
boolean
Enable the ground atmosphere, which is drawn over the globe when viewed from a distance between <code>lightingFadeInDistance</code> and <code>lightingFadeOutDistance</code>.
atmosphereLightIntensity
atmosphereLightIntensity:
number
The intensity of the light that is used for computing the ground atmosphere color.
atmosphereRayleighCoefficient
atmosphereRayleighCoefficient:
Cartesian3
The Rayleigh scattering coefficient used in the atmospheric scattering equations for the ground atmosphere.
atmosphereMieCoefficient
atmosphereMieCoefficient:
Cartesian3
The Mie scattering coefficient used in the atmospheric scattering equations for the ground atmosphere.
atmosphereRayleighScaleHeight
atmosphereRayleighScaleHeight:
number
The Rayleigh scale height used in the atmospheric scattering equations for the ground atmosphere, in meters.
atmosphereMieScaleHeight
atmosphereMieScaleHeight:
number
The Mie scale height used in the atmospheric scattering equations for the ground atmosphere, in meters.
atmosphereMieAnisotropy
atmosphereMieAnisotropy:
number
The anisotropy of the medium to consider for Mie scattering. <p> Valid values are between -1.0 and 1.0. </p>
lightingFadeOutDistance
lightingFadeOutDistance:
number
The distance where everything becomes lit. This only takes effect when <code>enableLighting</code> or <code>showGroundAtmosphere</code> is <code>true</code>.
lightingFadeInDistance
lightingFadeInDistance:
number
The distance where lighting resumes. This only takes effect when <code>enableLighting</code> or <code>showGroundAtmosphere</code> is <code>true</code>.
nightFadeOutDistance
nightFadeOutDistance:
number
The distance where the darkness of night from the ground atmosphere fades out to a lit ground atmosphere. This only takes effect when <code>showGroundAtmosphere</code>, <code>enableLighting</code>, and <code>dynamicAtmosphereLighting</code> are <code>true</code>.
nightFadeInDistance
nightFadeInDistance:
number
The distance where the darkness of night from the ground atmosphere fades in to an unlit ground atmosphere. This only takes effect when <code>showGroundAtmosphere</code>, <code>enableLighting</code>, and <code>dynamicAtmosphereLighting</code> are <code>true</code>.
showWaterEffect
showWaterEffect:
boolean
True if an animated wave effect should be shown in areas of the globe covered by water; otherwise, false. This property is ignored if the <code>terrainProvider</code> does not provide a water mask.
depthTestAgainstTerrain
depthTestAgainstTerrain:
boolean
True if primitives such as billboards, polylines, labels, etc. should be depth-tested against the terrain surface, or false if such primitives should always be drawn on top of terrain unless they're on the opposite side of the globe. The disadvantage of depth testing primitives against terrain is that slight numerical noise or terrain level-of-detail switched can sometimes make a primitive that should be on the surface disappear underneath it.
shadows
shadows:
ShadowMode
Determines whether the globe casts or receives shadows from light sources. Setting the globe to cast shadows may impact performance since the terrain is rendered again from the light's perspective. Currently only terrain that is in view casts shadows. By default the globe does not cast shadows.
atmosphereHueShift
atmosphereHueShift:
number
The hue shift to apply to the atmosphere. Defaults to 0.0 (no shift). A hue shift of 1.0 indicates a complete rotation of the hues available.
atmosphereSaturationShift
atmosphereSaturationShift:
number
The saturation shift to apply to the atmosphere. Defaults to 0.0 (no shift). A saturation shift of -1.0 is monochrome.
atmosphereBrightnessShift
atmosphereBrightnessShift:
number
The brightness shift to apply to the atmosphere. Defaults to 0.0 (no shift). A brightness shift of -1.0 is complete darkness, which will let space show through.
showSkirts
showSkirts:
boolean
Whether to show terrain skirts. Terrain skirts are geometry extending downwards from a tile's edges used to hide seams between neighboring tiles. Skirts are always hidden when the camera is underground or translucency is enabled.
backFaceCulling
backFaceCulling:
boolean
Whether to cull back-facing terrain. Back faces are not culled when the camera is underground or translucency is enabled.
vertexShadowDarkness
vertexShadowDarkness:
number
Determines the darkness of the vertex shadow. This only takes effect when <code>enableLighting</code> is <code>true</code>.
ellipsoid
ellipsoid:
Ellipsoid
Gets an ellipsoid describing the shape of this globe.
imageryLayers
imageryLayers:
ImageryLayerCollection
Gets the collection of image layers that will be rendered on this globe.
imageryLayersUpdatedEvent
readonlyimageryLayersUpdatedEvent:Event
Gets an event that's raised when an imagery layer is added, shown, hidden, moved, or removed.
tilesLoaded
readonlytilesLoaded:boolean
Returns <code>true</code> when the tile load queue is empty, <code>false</code> otherwise. When the load queue is empty, all terrain and imagery for the current view have been loaded.
baseColor
baseColor:
Color
Gets or sets the color of the globe when no imagery is available.
clippingPlanes
clippingPlanes:
ClippingPlaneCollection
A property specifying a ClippingPlaneCollection used to selectively disable rendering on the outside of each plane.
clippingPolygons
clippingPolygons:
ClippingPolygonCollection
A property specifying a ClippingPolygonCollection used to selectively disable rendering inside or outside a list of polygons.
cartographicLimitRectangle
cartographicLimitRectangle:
Rectangle
A property specifying a Rectangle used to limit globe rendering to a cartographic area. Defaults to the maximum extent of cartographic coordinates.
oceanNormalMapUrl
oceanNormalMapUrl:
string
The normal map to use for rendering waves in the ocean. Setting this property will only have an effect if the configured terrain provider includes a water mask.
terrainProvider
terrainProvider:
TerrainProvider
The terrain provider providing surface geometry for this globe.
terrainProviderChanged
readonlyterrainProviderChanged:Event
Gets an event that's raised when the terrain provider is changed
tileLoadProgressEvent
tileLoadProgressEvent:
Event
Gets an event that's raised when the length of the tile load queue has changed since the last render frame. When the load queue is empty, all terrain and imagery for the current view have been loaded. The event passes the new length of the tile load queue.
material
material:
Material|undefined
Gets or sets the material appearance of the Globe. This can be one of several built-in Material objects or a custom material, scripted with Fabric.
undergroundColor
undergroundColor:
Color
The color to render the back side of the globe when the camera is underground or the globe is translucent, blended with the globe color based on the camera's distance. <br /><br /> To disable underground coloring, set <code>undergroundColor</code> to <code>undefined</code>.
undergroundColorAlphaByDistance
undergroundColorAlphaByDistance:
NearFarScalar
Gets or sets the near and far distance for blending Globe#undergroundColor with the globe color. The alpha will interpolate between the NearFarScalar#nearValue and NearFarScalar#farValue while the camera distance falls within the lower and upper bounds of the specified NearFarScalar#near and NearFarScalar#far. Outside of these ranges the alpha remains clamped to the nearest bound. If undefined, the underground color will not be blended with the globe color. <br /> <br /> When the camera is above the ellipsoid the distance is computed from the nearest point on the ellipsoid instead of the camera's position.
translucency
translucency:
GlobeTranslucency
Properties for controlling globe translucency.
方法
pick()
pick(
ray:Ray,scene:Scene,result?:Cartesian3):Cartesian3|undefined
Find an intersection between a ray and the globe surface that was rendered. The ray must be given in world coordinates.
参数
ray
The ray to test for intersection.
scene
The scene.
result?
The object onto which to store the result.
返回
Cartesian3 | undefined
The intersection or undefined if none was found.
示例
ts
// find intersection of ray through a pixel and the globe
const ray = viewer.camera.getPickRay(windowCoordinates);
const intersection = globe.pick(ray, scene);getHeight()
getHeight(
cartographic:Cartographic):number|undefined
Get the height of the surface at a given cartographic.
参数
cartographic
The cartographic for which to find the height.
返回
number | undefined
The height of the cartographic or undefined if it could not be found.
isDestroyed()
isDestroyed():
boolean
Returns true if this object was destroyed; otherwise, false. <br /><br /> If this object was destroyed, it should not be used; calling any function other than <code>isDestroyed</code> will result in a DeveloperError exception.
返回
boolean
True if this object was destroyed; otherwise, false.
destroy()
destroy():
void
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. <br /><br /> Once an object is destroyed, it should not be used; calling any function other than <code>isDestroyed</code> will result in a DeveloperError exception. Therefore, assign the return value (<code>undefined</code>) to the object as done in the example.
返回
void
示例
ts
globe = globe && globe.destroy();构造函数
构造函数
new Globe(
ellipsoid?:Ellipsoid):Globe
参数
ellipsoid?
返回
Globe
