Cesium for Unity 1.15.2
Loading...
Searching...
No Matches
CesiumEllipsoid.cs
Go to the documentation of this file.
1using Reinterop;
2using Unity.Mathematics;
3using UnityEngine;
4
5
6namespace CesiumForUnity
7{
8 [ReinteropNativeImplementation("CesiumForUnityNative::CesiumEllipsoidImpl", "CesiumEllipsoidImpl.h")]
9 [IconAttribute("Packages/com.cesium.unity/Editor/Resources/Cesium-24x24.png")]
10 [CreateAssetMenu(menuName = "Cesium/Ellipsoid")]
11 public partial class CesiumEllipsoid : ScriptableObject
12 {
16 public static CesiumEllipsoid WGS84
17 {
18 get
19 {
20 if (_cachedWgs84 == null)
21 {
22 _cachedWgs84 = CreateInstance<CesiumEllipsoid>();
23 _cachedWgs84.name = "WGS84";
25 }
26
27 return _cachedWgs84;
28 }
29 }
30
31 private static CesiumEllipsoid _cachedWgs84;
32
33 [SerializeField]
34 private double3 _radii = new double3(1.0, 1.0, 1.0);
35
36 internal double3 radii
37 {
38 get => _radii;
39 set => _radii = value;
40 }
41
46 public double GetMaximumRadius()
47 {
48 return math.cmax(this.GetRadii());
49 }
50
55 public double GetMinimumRadius()
56 {
57 return math.cmin(this.GetRadii());
58 }
59
63 public partial double3 GetRadii();
64
69 public partial void SetRadii(double3 newRadii);
70
78 public partial double3? ScaleToGeodeticSurface(double3 ellipsoidCenteredEllipsoidFixed);
79
86 public partial double3 GeodeticSurfaceNormal(double3 ellipsoidCenteredEllipsoidFixed);
87
95 public partial double3 LongitudeLatitudeHeightToCenteredFixed(double3 longitudeLatitudeHeight);
96
105 public partial double3 CenteredFixedToLongitudeLatitudeHeight(double3 ellipsoidCenteredEllipsoidFixed);
106 }
107}
static CesiumEllipsoid WGS84
Obtain a WGS84 ellipsoid.
double GetMaximumRadius()
Gets the maximum radius of the ellipsoid in any dimension.
partial double3 LongitudeLatitudeHeightToCenteredFixed(double3 longitudeLatitudeHeight)
Convert longitude, latitude, and height to Ellipsoid-Centered, Ellipsoid-Fixed (ECEF) coordinates.
double GetMinimumRadius()
Gets the minimum radius of the ellipsoid in any dimension.
partial double3 GeodeticSurfaceNormal(double3 ellipsoidCenteredEllipsoidFixed)
Computes the normal of the plane tangent to the surface of the ellipsoid at the provided Ellipsoid-Ce...
partial double3 GetRadii()
Returns the radii of this ellipsoid.
partial? double3 ScaleToGeodeticSurface(double3 ellipsoidCenteredEllipsoidFixed)
Scale the given Ellipsoid-Centered, Ellipsoid-Fixed (ECEF) position along the geodetic surface normal...
partial void SetRadii(double3 newRadii)
Sets the radii of this ellipsoid to the given values.
partial double3 CenteredFixedToLongitudeLatitudeHeight(double3 ellipsoidCenteredEllipsoidFixed)
Convert Ellipsoid-Centered, Ellipsoid-Fixed (ECEF) coordinates to longitude, latitude,...
Holds static methods for ellipsoid math and transforming between geospatial coordinate systems using ...
static partial double3 GetRadii()
Gets the radii of the ellipsoid in its x-, y-, and z-directions.