Cesium for Unity 1.15.2
Loading...
Searching...
No Matches
CesiumForUnity.Cesium3DTileset Class Reference

A tileset in the 3D Tiles format. More...

Inheritance diagram for CesiumForUnity.Cesium3DTileset:

Public Member Functions

void Dispose ()
 
delegate void TilesetLoadFailureDelegate (Cesium3DTilesetLoadFailureDetails details)
 Encapsulates a method that receives details of a tileset load failure.
 
partial float ComputeLoadProgress ()
 Estimate the percentage of the tiles for the current view that have been loaded.
 
partial void RecreateTileset ()
 Destroy and recreate the tilset.
 
partial void FocusTileset ()
 Zoom the Editor camera to this tileset.
 
partial Task< CesiumSampleHeightResultSampleHeightMostDetailed (params double3[] longitudeLatitudeHeightPositions)
 Initiates an asynchronous query for the height of this tileset at a list of cartographic positions, where the longitude (X) and latitude (Y) are given in degrees.
 

Properties

bool showCreditsOnScreen [get, set]
 Whether or not to force this tileset's credits to be shown on the main screen.
 
CesiumDataSource tilesetSource [get, set]
 The source of the data for this tileset: Cesium ion or a regular URL.
 
string url [get, set]
 The URL from which to load the tileset.
 
long ionAssetID [get, set]
 The Cesium ion asset ID from which to load the tileset.
 
string ionAccessToken [get, set]
 The Cesium ion access token to use when loading the tileset from Cesium ion.
 
CesiumIonServer ionServer [get, set]
 The Cesium ion server from which this tileset is loaded.
 
float maximumScreenSpaceError [get, set]
 The maximum number of pixels of error when rendering this tileset.
 
bool preloadAncestors [get, set]
 Whether to preload ancestor tiles.
 
bool preloadSiblings [get, set]
 Whether to preload sibling tiles.
 
bool forbidHoles [get, set]
 Whether to prevent refinement of a parent tile when a child isn't done loading.
 
uint maximumSimultaneousTileLoads [get, set]
 The maximum number of tiles that may be loaded simultaneously.
 
long maximumCachedBytes [get, set]
 The maximum number of bytes that may be cached for this tileset.
 
uint loadingDescendantLimit [get, set]
 The number of loading descendents a tile should allow before deciding to render itself instead of waiting.
 
bool enableFrustumCulling [get, set]
 Whether to cull tiles that are outside the frustum.
 
bool enableFogCulling [get, set]
 Whether to cull tiles that are occluded by fog.
 
bool enforceCulledScreenSpaceError [get, set]
 Whether a specified screen-space error should be enforced for tiles that are outside the frustum or hidden in fog.
 
float culledScreenSpaceError [get, set]
 The screen-space error to be enforced for tiles that are outside the frustum or hidden in fog.
 
Material opaqueMaterial [get, set]
 The Material to use to render opaque parts of tiles.
 
bool generateSmoothNormals [get, set]
 Whether to generate smooth normals when normals are missing in the glTF.
 
CesiumPointCloudShading pointCloudShading [get]
 The CesiumPointCloudShading attached to this tileset.
 
bool suspendUpdate [get, set]
 Pauses level-of-detail and culling updates of this tileset.
 
bool showTilesInHierarchy [get, set]
 Whether to show tiles as individual game objects in the hierarchy window.
 
bool updateInEditor [get, set]
 If true, this tileset is ticked/updated in the editor.
 
bool logSelectionStats [get, set]
 Whether to log details about the tile selection process.
 
bool createPhysicsMeshes [get, set]
 Whether to generate physics meshes for this tileset.
 

Events

static TilesetLoadFailureDelegate OnCesium3DTilesetLoadFailure
 An event that is raised when the tileset encounters an error that prevents it from loading.
 
Action< GameObject > OnTileGameObjectCreated
 Occurs when a new GameObject is instantiated for a Tile in the tileset.
 

Detailed Description

A tileset in the 3D Tiles format.

3D Tiles

is an open specification for sharing, visualizing, fusing, and interacting with massive heterogenous 3D geospatial content across desktop, web, and mobile applications. The tileset is streamed incrementally into Unity based on the current camera view(s).

A GameObject with this component must be nested inside one with a CesiumGeoreference component. The georeference controls how this tileset is mapped into the Unity world.

In most cases, the Transform of the GameObject that contains this component, and its ancestors, should be an identity transform: 0 position, 0 rotation, 1 scale. Otherwise, this tileset will be misaligned with other globe tilesets. However, it is sometimes useful to purposely offset a tileset.

Definition at line 53 of file Cesium3DTileset.cs.

Member Function Documentation

◆ ComputeLoadProgress()

partial float CesiumForUnity.Cesium3DTileset.ComputeLoadProgress ( )

Estimate the percentage of the tiles for the current view that have been loaded.

Returns
A float value between 0 and 100 representing the load progress.

◆ Dispose()

void CesiumForUnity.Cesium3DTileset.Dispose ( )
inline

Definition at line 55 of file Cesium3DTileset.cs.

◆ FocusTileset()

partial void CesiumForUnity.Cesium3DTileset.FocusTileset ( )

Zoom the Editor camera to this tileset.

This method does nothing outside of the Editor.

◆ RecreateTileset()

partial void CesiumForUnity.Cesium3DTileset.RecreateTileset ( )

Destroy and recreate the tilset.

All tiles are unloaded, and then the tileset is reloaded based on the current view.

◆ SampleHeightMostDetailed()

partial Task< CesiumSampleHeightResult > CesiumForUnity.Cesium3DTileset.SampleHeightMostDetailed ( params double3[] longitudeLatitudeHeightPositions)

Initiates an asynchronous query for the height of this tileset at a list of cartographic positions, where the longitude (X) and latitude (Y) are given in degrees.

The most detailed available tiles are used to determine each height.

The height of the input positions is ignored, unless height sampling fails at that location. The output height is expressed in meters above the ellipsoid (usually WGS84), which should not be confused with a height above mean sea level.

Use WaitForTask inside a coroutine to wait for the asynchronous height query to complete.

Parameters
longitudeLatitudeHeightPositionsThe cartographic positions for which to sample heights. The X component is the Longitude (degrees), the Y component is the Latitude (degrees), and the Z component is the Height (meters).
Returns
An asynchronous task that will provide the requested heights when complete.

◆ TilesetLoadFailureDelegate()

delegate void CesiumForUnity.Cesium3DTileset.TilesetLoadFailureDelegate ( Cesium3DTilesetLoadFailureDetails details)

Encapsulates a method that receives details of a tileset load failure.

Parameters
detailsThe details of the load failure.

Property Documentation

◆ createPhysicsMeshes

bool CesiumForUnity.Cesium3DTileset.createPhysicsMeshes
getset

Whether to generate physics meshes for this tileset.

Disabling this option will improve the performance of tile loading, but it will no longer be possible to collide with the tileset since the physics meshes will not be created.

Definition at line 692 of file Cesium3DTileset.cs.

◆ culledScreenSpaceError

float CesiumForUnity.Cesium3DTileset.culledScreenSpaceError
getset

The screen-space error to be enforced for tiles that are outside the frustum or hidden in fog.

When enableFrustumCulling and enableFogCulling are both true, tiles outside the view frustum or hidden in fog are effectively ignored, and so their level-of-detail doesn't matter. And in this scenario, this property is ignored.

However, when either of those flags are false, these "would-be-culled" tiles continue to be processed, and the question arises of how to handle their level-of-detail. When this property is false, refinement terminates at these tiles, no matter what their current screen-space error. The tiles are available for physics, shadows, etc., but their level-of-detail may be very low.

When set to true, these tiles are refined until they achieve the specified "Culled Screen Space Error". This allows control over the minimum quality of these would-be-culled tiles.

Definition at line 517 of file Cesium3DTileset.cs.

◆ enableFogCulling

bool CesiumForUnity.Cesium3DTileset.enableFogCulling
getset

Whether to cull tiles that are occluded by fog.

This does not refer to the atmospheric fog rendered by Unity, but to an internal representation of fog: Depending on the height of the camera above the ground, tiles that are far away (close to the horizon) will be culled when this flag is enabled.

Note that this will always be disabled if useLodTransitions is set to true.

Definition at line 441 of file Cesium3DTileset.cs.

◆ enableFrustumCulling

bool CesiumForUnity.Cesium3DTileset.enableFrustumCulling
getset

Whether to cull tiles that are outside the frustum.

By default this is true, meaning that tiles that are not visible with the current camera configuration will be ignored. It can be set to false, so that these tiles are still considered for loading, refinement and rendering.

This will cause more tiles to be loaded, but helps to avoid holes and provides a more consistent mesh, which may be helpful for physics and shadows.

Note that frustum calling will be disabled if useLodTransitions is set to true.

Definition at line 414 of file Cesium3DTileset.cs.

◆ enforceCulledScreenSpaceError

bool CesiumForUnity.Cesium3DTileset.enforceCulledScreenSpaceError
getset

Whether a specified screen-space error should be enforced for tiles that are outside the frustum or hidden in fog.

When enableFrustumCulling and enableFogCulling are both true, tiles outside the view frustum or hidden in fog are effectively ignored, and so their level-of-detail doesn't matter. And in this scenario, this property is ignored.

However, when either of those flags are false, these "would-be-culled" tiles continue to be processed, and the question arises of how to handle their level-of-detail. When this property is false, refinement terminates at these tiles, no matter what their current screen-space error. The tiles are available for physics, shadows, etc., but their level-of-detail may be very low.

When set to true, these tiles are refined until they achieve the specified culledScreenSpaceError. This allows control over the minimum quality of these would-be-culled tiles.

Definition at line 480 of file Cesium3DTileset.cs.

◆ forbidHoles

bool CesiumForUnity.Cesium3DTileset.forbidHoles
getset

Whether to prevent refinement of a parent tile when a child isn't done loading.

When this is set to true, the tileset will guarantee that the tileset will never be rendered with holes in place of tiles that are not yet loaded, even though the tile that is rendered instead may have low resolution. When false, overall loading will be faster, but newly-visible parts of the tileset may initially be blank.

Definition at line 314 of file Cesium3DTileset.cs.

◆ generateSmoothNormals

bool CesiumForUnity.Cesium3DTileset.generateSmoothNormals
getset

Whether to generate smooth normals when normals are missing in the glTF.

According to the glTF spec: "When normals are not specified, client implementations should calculate flat normals." However, calculating flat normals requires duplicating vertices. This option allows the glTFs to be rendered with smooth normals instead when the original glTF is missing normals.

Definition at line 582 of file Cesium3DTileset.cs.

◆ ionAccessToken

string CesiumForUnity.Cesium3DTileset.ionAccessToken
getset

The Cesium ion access token to use when loading the tileset from Cesium ion.

This property is used only if tilesetSource is set to "FromCesiumIon".

Definition at line 184 of file Cesium3DTileset.cs.

◆ ionAssetID

long CesiumForUnity.Cesium3DTileset.ionAssetID
getset

The Cesium ion asset ID from which to load the tileset.

This property is used only if tilesetSource is set to "FromCesiumIon".

Definition at line 167 of file Cesium3DTileset.cs.

◆ ionServer

CesiumIonServer CesiumForUnity.Cesium3DTileset.ionServer
getset

The Cesium ion server from which this tileset is loaded.

Definition at line 200 of file Cesium3DTileset.cs.

◆ loadingDescendantLimit

uint CesiumForUnity.Cesium3DTileset.loadingDescendantLimit
getset

The number of loading descendents a tile should allow before deciding to render itself instead of waiting.

Setting this to 0 will cause each level of detail to be loaded successively. This will increase the overall loading time, but cause additional detail to appear more gradually. Setting this to a high value like 1000 will decrease the overall time until the desired level of detail is achieved, but this high-detail representation will appear at once, as soon as it is loaded completely.

Definition at line 384 of file Cesium3DTileset.cs.

◆ logSelectionStats

bool CesiumForUnity.Cesium3DTileset.logSelectionStats
getset

Whether to log details about the tile selection process.

Definition at line 675 of file Cesium3DTileset.cs.

◆ maximumCachedBytes

long CesiumForUnity.Cesium3DTileset.maximumCachedBytes
getset

The maximum number of bytes that may be cached for this tileset.

Note that this value, even if 0, will never cause tiles that are needed for rendering to be unloaded. However, if the total number of loaded bytes is greater than this value, tiles will be unloaded until the total is under this number or until only required tiles remain, whichever comes first.

Definition at line 360 of file Cesium3DTileset.cs.

◆ maximumScreenSpaceError

float CesiumForUnity.Cesium3DTileset.maximumScreenSpaceError
getset

The maximum number of pixels of error when rendering this tileset.

This is used to select an appropriate level-of-detail: A low value will cause many tiles with a high level of detail to be loaded, causing a finer visual representation of the tiles, but with a higher performance cost for loading and rendering. A higher value will cause a coarser visual representation, with lower performance requirements.

When a tileset uses the older layer.json / quantized-mesh format rather than 3D Tiles, this value is effectively divided by 8.0. So the default value of 16.0 corresponds to the standard value for quantized-mesh terrain of 2.0.

Definition at line 249 of file Cesium3DTileset.cs.

◆ maximumSimultaneousTileLoads

uint CesiumForUnity.Cesium3DTileset.maximumSimultaneousTileLoads
getset

The maximum number of tiles that may be loaded simultaneously.

When new parts of the tileset become visible, the tasks to load the corresponding tiles are put into a queue. This value determines how many of these tasks are processed at the same time. A higher value may cause the tiles to be loaded and rendered more quickly, at the cost of a higher network and processing load.

Definition at line 337 of file Cesium3DTileset.cs.

◆ opaqueMaterial

Material CesiumForUnity.Cesium3DTileset.opaqueMaterial
getset

The Material to use to render opaque parts of tiles.

Definition at line 533 of file Cesium3DTileset.cs.

◆ pointCloudShading

CesiumPointCloudShading CesiumForUnity.Cesium3DTileset.pointCloudShading
get

The CesiumPointCloudShading attached to this tileset.

If the tileset contains points, their appearance can be configured with the point cloud shading parameters.

Definition at line 600 of file Cesium3DTileset.cs.

◆ preloadAncestors

bool CesiumForUnity.Cesium3DTileset.preloadAncestors
getset

Whether to preload ancestor tiles.

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.

Definition at line 270 of file Cesium3DTileset.cs.

◆ preloadSiblings

bool CesiumForUnity.Cesium3DTileset.preloadSiblings
getset

Whether to preload sibling tiles.

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.

Definition at line 291 of file Cesium3DTileset.cs.

◆ showCreditsOnScreen

bool CesiumForUnity.Cesium3DTileset.showCreditsOnScreen
getset

Whether or not to force this tileset's credits to be shown on the main screen.

If false, the credits are usually only shown on a "Data Attribution" popup.

Definition at line 112 of file Cesium3DTileset.cs.

◆ showTilesInHierarchy

bool CesiumForUnity.Cesium3DTileset.showTilesInHierarchy
getset

Whether to show tiles as individual game objects in the hierarchy window.

Definition at line 643 of file Cesium3DTileset.cs.

◆ suspendUpdate

bool CesiumForUnity.Cesium3DTileset.suspendUpdate
getset

Pauses level-of-detail and culling updates of this tileset.

Definition at line 611 of file Cesium3DTileset.cs.

◆ tilesetSource

CesiumDataSource CesiumForUnity.Cesium3DTileset.tilesetSource
getset

The source of the data for this tileset: Cesium ion or a regular URL.

Definition at line 133 of file Cesium3DTileset.cs.

◆ updateInEditor

bool CesiumForUnity.Cesium3DTileset.updateInEditor
getset

If true, this tileset is ticked/updated in the editor.

If false, it is only ticked while playing (including Play-in-Editor).

Definition at line 659 of file Cesium3DTileset.cs.

◆ url

string CesiumForUnity.Cesium3DTileset.url
getset

The URL from which to load the tileset.

This property is used only if tilesetSource is set to "FromUrl".

Definition at line 150 of file Cesium3DTileset.cs.

Event Documentation

◆ OnCesium3DTilesetLoadFailure

TilesetLoadFailureDelegate CesiumForUnity.Cesium3DTileset.OnCesium3DTilesetLoadFailure
static

An event that is raised when the tileset encounters an error that prevents it from loading.

Definition at line 73 of file Cesium3DTileset.cs.

◆ OnTileGameObjectCreated

Action<GameObject> CesiumForUnity.Cesium3DTileset.OnTileGameObjectCreated

Occurs when a new GameObject is instantiated for a Tile in the tileset.

This event can be used to customize the Tile GameObjects as they are loaded, such as adding components, changing materials, or applying transformations.

Definition at line 90 of file Cesium3DTileset.cs.


The documentation for this class was generated from the following file: