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

Automatically shifts the origin of a CesiumGeoreference as the object to which it is attached moves. More...

Inheritance diagram for CesiumForUnity.CesiumOriginShift:

Properties

double distance [get, set]
 The maximum distance between the origin of the Unity coordinate system and the game object to which this component is attached.
 

Detailed Description

Automatically shifts the origin of a CesiumGeoreference as the object to which it is attached moves.

This improves rendering precision by keeping coordinate values small.

This component is typically attached to a camera, and it automatically updates the CesiumGeoreference to keep its origin near the location of the camera. This improves rendering precision by keeping the coordinate values of objects that are near the camera as small as possible. A game object with this component must be nested inside a CesiumGeoreference, and it must also have a CesiumGlobeAnchor. It is essential to add a CesiumGlobeAnchor to all other objects in the scene as well; otherwise, they will appear to move when the origin is shifted.

This component also switches between CesiumSubScene instances based on the distance to them. When inside a sub-scene, the origin shifting described above is not performed. This allows relatively normal Unity scenes to be defined at different locations on the globe.

Definition at line 30 of file CesiumOriginShift.cs.

Property Documentation

◆ distance

double CesiumForUnity.CesiumOriginShift.distance
getset

The maximum distance between the origin of the Unity coordinate system and the game object to which this component is attached.

When this distance is exceeded, the CesiumGeoreference origin is shifted to bring it close to the game object.

When the value of this property is 0.0, the origin is shifted continuously.

Definition at line 41 of file CesiumOriginShift.cs.


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