new Globe(ellipsoidopt)
The globe rendered in the scene, including its terrain (
Globe#terrainProvider
)
and imagery layers (Globe#imageryLayers
). Access the globe using Scene#globe
.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
ellipsoid |
Ellipsoid |
<optional> |
Ellipsoid.WGS84 | Determines the size and shape of the globe. |
- Source:
Members
baseColor :Color
Gets or sets the color of the globe when no imagery is available.
Type:
- Source:
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.
Type:
- Boolean
- Default Value:
- false
- Source:
ellipsoid :Ellipsoid
Gets an ellipsoid describing the shape of this globe.
Type:
- Source:
enableLighting :Boolean
Enable lighting the globe with the sun as a light source.
Type:
- Boolean
- Default Value:
- false
- Source:
imageryLayers :ImageryLayerCollection
Gets the collection of image layers that will be rendered on this globe.
Type:
- Source:
lightingFadeInDistance :Number
The distance where lighting resumes. This only takes effect
when
enableLighting
is true
.
Type:
- Number
- Default Value:
- 9000000.0
- Source:
lightingFadeOutDistance :Number
The distance where everything becomes lit. This only takes effect
when
enableLighting
is true
.
Type:
- Number
- Default Value:
- 6500000.0
- Source:
maximumScreenSpaceError :Number
The maximum screen-space error used to drive level-of-detail refinement. Higher
values will provide better performance but lower visual quality.
Type:
- Number
- Default Value:
- 2
- Source:
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.
Type:
- String
- Default Value:
- buildModuleUrl('Assets/Textures/waterNormalsSmall.jpg')
- Source:
shadows :ShadowMode
Determines whether the globe casts or receives shadows from each light source. 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.
Type:
- ShadowMode
- Default Value:
- ShadowMode.RECEIVE_ONLY
- Source:
show :Boolean
Determines if the globe will be shown.
Type:
- Boolean
- Default Value:
- true
- Source:
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
terrainProvider
does not provide a water mask.
Type:
- Boolean
- Default Value:
- true
- Source:
terrainProvider :TerrainProvider
The terrain provider providing surface geometry for this globe.
Type:
- Source:
(readonly) terrainProviderChanged :Event
Gets an event that's raised when the terrain provider is changed
Type:
- Source:
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.
Type:
- Number
- Default Value:
- 100
- Source:
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.
Type:
- Source:
Methods
destroy() → {undefined}
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.
- Source:
- See:
Throws:
-
This object was destroyed, i.e., destroy() was called.
- Type
- DeveloperError
Returns:
- Type
- undefined
Example
globe = globe && globe.destroy();
getHeight(cartographic) → {Number|undefined}
Get the height of the surface at a given cartographic.
Parameters:
Name | Type | Description |
---|---|---|
cartographic |
Cartographic | The cartographic for which to find the height. |
- Source:
Returns:
The height of the cartographic or undefined if it could not be found.
- Type
- Number | undefined
isDestroyed() → {Boolean}
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.
- Source:
- See:
Returns:
True if this object was destroyed; otherwise, false.
- Type
- Boolean
pick(ray, scene, resultopt) → {Cartesian3|undefined}
Find an intersection between a ray and the globe surface that was rendered. The ray must be given in world coordinates.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
ray |
Ray | The ray to test for intersection. | |
scene |
Scene | The scene. | |
result |
Cartesian3 |
<optional> |
The object onto which to store the result. |
- Source:
Returns:
The intersection or
undefined
if none was found.
- Type
- Cartesian3 | undefined
Example
// find intersection of ray through a pixel and the globe
var ray = viewer.camera.getPickRay(windowCoordinates);
var intersection = globe.pick(ray, scene);