org.outernet.cesium-unity 1.15.3-linux.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGES.md +420 -0
- package/CHANGES.md.meta +7 -0
- package/Editor/BuildCesiumForUnity.cs +186 -0
- package/Editor/BuildCesiumForUnity.cs.meta +11 -0
- package/Editor/Cesium3DTilesetEditor.cs +542 -0
- package/Editor/Cesium3DTilesetEditor.cs.meta +11 -0
- package/Editor/CesiumBingMapsRasterOverlayEditor.cs +66 -0
- package/Editor/CesiumBingMapsRasterOverlayEditor.cs.meta +11 -0
- package/Editor/CesiumCameraControllerEditor.cs +174 -0
- package/Editor/CesiumCameraControllerEditor.cs.meta +11 -0
- package/Editor/CesiumCameraManagerEditor.cs +65 -0
- package/Editor/CesiumCameraManagerEditor.cs.meta +11 -0
- package/Editor/CesiumCartographicPolygonEditor.cs +23 -0
- package/Editor/CesiumCartographicPolygonEditor.cs.meta +11 -0
- package/Editor/CesiumDebugColorizeTilesRasterOverlayEditor.cs +41 -0
- package/Editor/CesiumDebugColorizeTilesRasterOverlayEditor.cs.meta +11 -0
- package/Editor/CesiumEditor.asmdef +26 -0
- package/Editor/CesiumEditor.asmdef.meta +7 -0
- package/Editor/CesiumEditorStyle.cs +188 -0
- package/Editor/CesiumEditorStyle.cs.meta +11 -0
- package/Editor/CesiumEditorUtility.cs +394 -0
- package/Editor/CesiumEditorUtility.cs.meta +11 -0
- package/Editor/CesiumEditorWindow.cs +447 -0
- package/Editor/CesiumEditorWindow.cs.meta +11 -0
- package/Editor/CesiumFlyToControllerEditor.cs +76 -0
- package/Editor/CesiumFlyToControllerEditor.cs.meta +11 -0
- package/Editor/CesiumGeoreferenceEditor.cs +277 -0
- package/Editor/CesiumGeoreferenceEditor.cs.meta +11 -0
- package/Editor/CesiumGlobeAnchorEditor.cs +202 -0
- package/Editor/CesiumGlobeAnchorEditor.cs.meta +11 -0
- package/Editor/CesiumInspectorGUI.cs +187 -0
- package/Editor/CesiumInspectorGUI.cs.meta +11 -0
- package/Editor/CesiumIonAsset.cs +192 -0
- package/Editor/CesiumIonAsset.cs.meta +11 -0
- package/Editor/CesiumIonAssetsWindow.cs +257 -0
- package/Editor/CesiumIonAssetsWindow.cs.meta +11 -0
- package/Editor/CesiumIonRasterOverlayEditor.cs +87 -0
- package/Editor/CesiumIonRasterOverlayEditor.cs.meta +11 -0
- package/Editor/CesiumIonServerManager.cs +153 -0
- package/Editor/CesiumIonServerManager.cs.meta +11 -0
- package/Editor/CesiumIonServerSelector.cs +127 -0
- package/Editor/CesiumIonServerSelector.cs.meta +11 -0
- package/Editor/CesiumIonSession.cs +102 -0
- package/Editor/CesiumIonSession.cs.meta +11 -0
- package/Editor/CesiumPolygonRasterOverlayEditor.cs +102 -0
- package/Editor/CesiumPolygonRasterOverlayEditor.cs.meta +11 -0
- package/Editor/CesiumRasterOverlayEditor.cs +230 -0
- package/Editor/CesiumRasterOverlayEditor.cs.meta +11 -0
- package/Editor/CesiumSubSceneEditor.cs +201 -0
- package/Editor/CesiumSubSceneEditor.cs.meta +11 -0
- package/Editor/CesiumTileMapServiceRasterOverlayEditor.cs +88 -0
- package/Editor/CesiumTileMapServiceRasterOverlayEditor.cs.meta +11 -0
- package/Editor/CesiumWebMapServiceRasterOverlayEditor.cs +111 -0
- package/Editor/CesiumWebMapServiceRasterOverlayEditor.cs.meta +11 -0
- package/Editor/CesiumWebMapTileServiceRasterOverlayEditor.cs +277 -0
- package/Editor/CesiumWebMapTileServiceRasterOverlayEditor.cs.meta +3 -0
- package/Editor/CompileCesiumForUnityNative.cs +581 -0
- package/Editor/CompileCesiumForUnityNative.cs.meta +11 -0
- package/Editor/ConfigureReinterop.cs +255 -0
- package/Editor/ConfigureReinterop.cs.meta +11 -0
- package/Editor/Helpers.cs +102 -0
- package/Editor/Helpers.cs.meta +11 -0
- package/Editor/IonAssetsMultiColumnHeader.cs +45 -0
- package/Editor/IonAssetsMultiColumnHeader.cs.meta +11 -0
- package/Editor/IonAssetsTreeView.cs +214 -0
- package/Editor/IonAssetsTreeView.cs.meta +11 -0
- package/Editor/IonMissingAssetWindow.cs +65 -0
- package/Editor/IonMissingAssetWindow.cs.meta +11 -0
- package/Editor/IonTokenTroubleshootingWindow.cs +615 -0
- package/Editor/IonTokenTroubleshootingWindow.cs.meta +11 -0
- package/Editor/NativeDownloadHandler.cs +35 -0
- package/Editor/NativeDownloadHandler.cs.meta +11 -0
- package/Editor/QuickAddItem.cs +43 -0
- package/Editor/QuickAddItem.cs.meta +11 -0
- package/Editor/Resources/Cesium-128x128.png +0 -0
- package/Editor/Resources/Cesium-128x128.png.meta +98 -0
- package/Editor/Resources/Cesium-24x24.png +0 -0
- package/Editor/Resources/Cesium-24x24.png.meta +123 -0
- package/Editor/Resources/Cesium-64x64.png +0 -0
- package/Editor/Resources/Cesium-64x64.png.meta +98 -0
- package/Editor/Resources/Cesium-for-Unity-dark.png +0 -0
- package/Editor/Resources/Cesium-for-Unity-dark.png.meta +123 -0
- package/Editor/Resources/Cesium-for-Unity-light.png +0 -0
- package/Editor/Resources/Cesium-for-Unity-light.png.meta +123 -0
- package/Editor/Resources/Cesium-icon-16x16.png +0 -0
- package/Editor/Resources/Cesium-icon-16x16.png.meta +98 -0
- package/Editor/Resources/FontAwesome/attribution.txt +9 -0
- package/Editor/Resources/FontAwesome/attribution.txt.meta +7 -0
- package/Editor/Resources/FontAwesome/book-reader-solid.png +0 -0
- package/Editor/Resources/FontAwesome/book-reader-solid.png.meta +98 -0
- package/Editor/Resources/FontAwesome/book-reader-solid.svg +1 -0
- package/Editor/Resources/FontAwesome/book-reader-solid.svg.meta +7 -0
- package/Editor/Resources/FontAwesome/check-solid.png +0 -0
- package/Editor/Resources/FontAwesome/check-solid.png.meta +98 -0
- package/Editor/Resources/FontAwesome/check-solid.svg +1 -0
- package/Editor/Resources/FontAwesome/check-solid.svg.meta +7 -0
- package/Editor/Resources/FontAwesome/cloud-upload-alt-solid.png +0 -0
- package/Editor/Resources/FontAwesome/cloud-upload-alt-solid.png.meta +98 -0
- package/Editor/Resources/FontAwesome/cloud-upload-alt-solid.svg +1 -0
- package/Editor/Resources/FontAwesome/cloud-upload-alt-solid.svg.meta +7 -0
- package/Editor/Resources/FontAwesome/folder.png +0 -0
- package/Editor/Resources/FontAwesome/folder.png.meta +147 -0
- package/Editor/Resources/FontAwesome/folder.svg +5 -0
- package/Editor/Resources/FontAwesome/folder.svg.meta +7 -0
- package/Editor/Resources/FontAwesome/hands-helping-solid.png +0 -0
- package/Editor/Resources/FontAwesome/hands-helping-solid.png.meta +98 -0
- package/Editor/Resources/FontAwesome/hands-helping-solid.svg +1 -0
- package/Editor/Resources/FontAwesome/hands-helping-solid.svg.meta +7 -0
- package/Editor/Resources/FontAwesome/key-solid.png +0 -0
- package/Editor/Resources/FontAwesome/key-solid.png.meta +98 -0
- package/Editor/Resources/FontAwesome/key-solid.svg +1 -0
- package/Editor/Resources/FontAwesome/key-solid.svg.meta +7 -0
- package/Editor/Resources/FontAwesome/plus-solid.png +0 -0
- package/Editor/Resources/FontAwesome/plus-solid.png.meta +98 -0
- package/Editor/Resources/FontAwesome/plus-solid.svg +1 -0
- package/Editor/Resources/FontAwesome/plus-solid.svg.meta +7 -0
- package/Editor/Resources/FontAwesome/sign-out-alt-solid.png +0 -0
- package/Editor/Resources/FontAwesome/sign-out-alt-solid.png.meta +98 -0
- package/Editor/Resources/FontAwesome/sign-out-alt-solid.svg +1 -0
- package/Editor/Resources/FontAwesome/sign-out-alt-solid.svg.meta +7 -0
- package/Editor/Resources/FontAwesome/sync-alt-solid.png +0 -0
- package/Editor/Resources/FontAwesome/sync-alt-solid.png.meta +98 -0
- package/Editor/Resources/FontAwesome/sync-alt-solid.svg +1 -0
- package/Editor/Resources/FontAwesome/sync-alt-solid.svg.meta +7 -0
- package/Editor/Resources/FontAwesome/times-solid.png +0 -0
- package/Editor/Resources/FontAwesome/times-solid.png.meta +98 -0
- package/Editor/Resources/FontAwesome/times-solid.svg +1 -0
- package/Editor/Resources/FontAwesome/times-solid.svg.meta +7 -0
- package/Editor/Resources/FontAwesome.meta +8 -0
- package/Editor/Resources.meta +8 -0
- package/Editor/SelectIonTokenWindow.cs +249 -0
- package/Editor/SelectIonTokenWindow.cs.meta +11 -0
- package/Editor/arm64.meta +8 -0
- package/Editor/csc.rsp +1 -0
- package/Editor/csc.rsp.meta +7 -0
- package/Editor/libCesiumForUnityNative-Editor.so +0 -0
- package/Editor/libCesiumForUnityNative-Editor.so.meta +2 -0
- package/Editor/libCesiumForUnityNative-Runtime.so +0 -0
- package/Editor/libCesiumForUnityNative-Runtime.so.meta +2 -0
- package/Editor/x86_64.meta +8 -0
- package/Editor.meta +8 -0
- package/LICENSE +201 -0
- package/LICENSE.meta +7 -0
- package/Plugins/Standalone/libCesiumForUnityNative-Runtime.so +0 -0
- package/Plugins/Standalone/libCesiumForUnityNative-Runtime.so.meta +2 -0
- package/Plugins/Standalone.meta +8 -0
- package/Plugins.meta +8 -0
- package/README.md +39 -0
- package/README.md.meta +7 -0
- package/Reinterop.deps.json +172 -0
- package/Reinterop.deps.json.meta +7 -0
- package/Reinterop.dll +0 -0
- package/Reinterop.dll.meta +79 -0
- package/Runtime/Cesium3DTile.cs +37 -0
- package/Runtime/Cesium3DTile.cs.meta +11 -0
- package/Runtime/Cesium3DTileset.cs +788 -0
- package/Runtime/Cesium3DTileset.cs.meta +11 -0
- package/Runtime/Cesium3DTilesetLoadFailureDetails.cs +65 -0
- package/Runtime/Cesium3DTilesetLoadFailureDetails.cs.meta +11 -0
- package/Runtime/CesiumBackwardCompatibility.cs +163 -0
- package/Runtime/CesiumBackwardCompatibility.cs.meta +11 -0
- package/Runtime/CesiumBingMapsRasterOverlay.cs +72 -0
- package/Runtime/CesiumBingMapsRasterOverlay.cs.meta +11 -0
- package/Runtime/CesiumCameraController.cs +827 -0
- package/Runtime/CesiumCameraController.cs.meta +11 -0
- package/Runtime/CesiumCameraManager.cs +105 -0
- package/Runtime/CesiumCameraManager.cs.meta +11 -0
- package/Runtime/CesiumCartographicPolygon.cs +152 -0
- package/Runtime/CesiumCartographicPolygon.cs.meta +11 -0
- package/Runtime/CesiumCreditSystem.cs +343 -0
- package/Runtime/CesiumCreditSystem.cs.meta +11 -0
- package/Runtime/CesiumCreditSystemUI.cs +402 -0
- package/Runtime/CesiumCreditSystemUI.cs.meta +11 -0
- package/Runtime/CesiumDebugColorizeTilesRasterOverlay.cs +21 -0
- package/Runtime/CesiumDebugColorizeTilesRasterOverlay.cs.meta +11 -0
- package/Runtime/CesiumEllipsoid.cs +107 -0
- package/Runtime/CesiumEllipsoid.cs.meta +11 -0
- package/Runtime/CesiumFeature.cs +279 -0
- package/Runtime/CesiumFeature.cs.meta +11 -0
- package/Runtime/CesiumFeatureIdAttribute.cs +61 -0
- package/Runtime/CesiumFeatureIdAttribute.cs.meta +11 -0
- package/Runtime/CesiumFeatureIdSet.cs +165 -0
- package/Runtime/CesiumFeatureIdSet.cs.meta +11 -0
- package/Runtime/CesiumFeatureIdTexture.cs +68 -0
- package/Runtime/CesiumFeatureIdTexture.cs.meta +11 -0
- package/Runtime/CesiumFlyToController.cs +539 -0
- package/Runtime/CesiumFlyToController.cs.meta +11 -0
- package/Runtime/CesiumGeoreference.cs +628 -0
- package/Runtime/CesiumGeoreference.cs.meta +11 -0
- package/Runtime/CesiumGlobeAnchor.cs +664 -0
- package/Runtime/CesiumGlobeAnchor.cs.meta +11 -0
- package/Runtime/CesiumGlobeAnchorBackwardCompatibility0dot2dot0.cs +105 -0
- package/Runtime/CesiumGlobeAnchorBackwardCompatibility0dot2dot0.cs.meta +11 -0
- package/Runtime/CesiumIntMatN.cs +398 -0
- package/Runtime/CesiumIntMatN.cs.meta +11 -0
- package/Runtime/CesiumIntVecN.cs +525 -0
- package/Runtime/CesiumIntVecN.cs.meta +11 -0
- package/Runtime/CesiumIonRasterOverlay.cs +110 -0
- package/Runtime/CesiumIonRasterOverlay.cs.meta +11 -0
- package/Runtime/CesiumIonServer.cs +137 -0
- package/Runtime/CesiumIonServer.cs.meta +11 -0
- package/Runtime/CesiumMetadata.cs +33 -0
- package/Runtime/CesiumMetadata.cs.meta +11 -0
- package/Runtime/CesiumMetadataValue.cs +1764 -0
- package/Runtime/CesiumMetadataValue.cs.meta +11 -0
- package/Runtime/CesiumMetadataValueType.cs +203 -0
- package/Runtime/CesiumMetadataValueType.cs.meta +11 -0
- package/Runtime/CesiumModelMetadata.cs +26 -0
- package/Runtime/CesiumModelMetadata.cs.meta +11 -0
- package/Runtime/CesiumObjectPool.cs +74 -0
- package/Runtime/CesiumObjectPool.cs.meta +11 -0
- package/Runtime/CesiumObjectPools.cs +39 -0
- package/Runtime/CesiumObjectPools.cs.meta +11 -0
- package/Runtime/CesiumOriginShift.cs +146 -0
- package/Runtime/CesiumOriginShift.cs.meta +11 -0
- package/Runtime/CesiumPointCloudRenderer.cs +246 -0
- package/Runtime/CesiumPointCloudRenderer.cs.meta +11 -0
- package/Runtime/CesiumPointCloudShading.cs +76 -0
- package/Runtime/CesiumPointCloudShading.cs.meta +11 -0
- package/Runtime/CesiumPolygonRasterOverlay.cs +109 -0
- package/Runtime/CesiumPolygonRasterOverlay.cs.meta +11 -0
- package/Runtime/CesiumPrimitiveFeatures.cs +130 -0
- package/Runtime/CesiumPrimitiveFeatures.cs.meta +11 -0
- package/Runtime/CesiumPropertyArray.cs +64 -0
- package/Runtime/CesiumPropertyArray.cs.meta +11 -0
- package/Runtime/CesiumPropertyTable.cs +126 -0
- package/Runtime/CesiumPropertyTable.cs.meta +11 -0
- package/Runtime/CesiumPropertyTableProperty.cs +1734 -0
- package/Runtime/CesiumPropertyTableProperty.cs.meta +11 -0
- package/Runtime/CesiumRasterOverlay.cs +239 -0
- package/Runtime/CesiumRasterOverlay.cs.meta +11 -0
- package/Runtime/CesiumRasterOverlayLoadFailureDetails.cs +65 -0
- package/Runtime/CesiumRasterOverlayLoadFailureDetails.cs.meta +11 -0
- package/Runtime/CesiumRuntime.asmdef +32 -0
- package/Runtime/CesiumRuntime.asmdef.meta +7 -0
- package/Runtime/CesiumRuntime.cs +3 -0
- package/Runtime/CesiumRuntime.cs.meta +11 -0
- package/Runtime/CesiumRuntimeSettings.cs +188 -0
- package/Runtime/CesiumRuntimeSettings.cs.meta +11 -0
- package/Runtime/CesiumSampleHeightResult.cs +47 -0
- package/Runtime/CesiumSampleHeightResult.cs.meta +11 -0
- package/Runtime/CesiumSimplePlanarEllipsoidCurve.cs +93 -0
- package/Runtime/CesiumSimplePlanarEllipsoidCurve.cs.meta +11 -0
- package/Runtime/CesiumSubScene.cs +473 -0
- package/Runtime/CesiumSubScene.cs.meta +11 -0
- package/Runtime/CesiumTileExcluder.cs +47 -0
- package/Runtime/CesiumTileExcluder.cs.meta +11 -0
- package/Runtime/CesiumTileMapServiceRasterOverlay.cs +93 -0
- package/Runtime/CesiumTileMapServiceRasterOverlay.cs.meta +11 -0
- package/Runtime/CesiumWebMapServiceRasterOverlay.cs +129 -0
- package/Runtime/CesiumWebMapServiceRasterOverlay.cs.meta +11 -0
- package/Runtime/CesiumWebMapTileServiceRasterOverlay.cs +414 -0
- package/Runtime/CesiumWebMapTileServiceRasterOverlay.cs.meta +3 -0
- package/Runtime/CesiumWgs84Ellipsoid.cs +75 -0
- package/Runtime/CesiumWgs84Ellipsoid.cs.meta +11 -0
- package/Runtime/ConfigureReinterop.cs +926 -0
- package/Runtime/ConfigureReinterop.cs.meta +11 -0
- package/Runtime/Helpers.cs +122 -0
- package/Runtime/Helpers.cs.meta +11 -0
- package/Runtime/ICesiumRestartable.cs +17 -0
- package/Runtime/ICesiumRestartable.cs.meta +11 -0
- package/Runtime/NativeCoroutine.cs +28 -0
- package/Runtime/NativeCoroutine.cs.meta +11 -0
- package/Runtime/NativeDownloadHandler.cs +29 -0
- package/Runtime/NativeDownloadHandler.cs.meta +11 -0
- package/Runtime/Resources/CesiumCreditSystem.prefab +78 -0
- package/Runtime/Resources/CesiumCreditSystem.prefab.meta +7 -0
- package/Runtime/Resources/CesiumCreditSystemRuntimeTheme.tss +2 -0
- package/Runtime/Resources/CesiumCreditSystemRuntimeTheme.tss.meta +11 -0
- package/Runtime/Resources/CesiumCreditSystemUI.uxml +4 -0
- package/Runtime/Resources/CesiumCreditSystemUI.uxml.meta +10 -0
- package/Runtime/Resources/CesiumCreditSystemUIPanelSettings.asset +38 -0
- package/Runtime/Resources/CesiumCreditSystemUIPanelSettings.asset.meta +8 -0
- package/Runtime/Resources/CesiumDefaultTilesetMaterial.mat +232 -0
- package/Runtime/Resources/CesiumDefaultTilesetMaterial.mat.meta +8 -0
- package/Runtime/Resources/CesiumDefaultTilesetShader.shadergraph +14271 -0
- package/Runtime/Resources/CesiumDefaultTilesetShader.shadergraph.meta +10 -0
- package/Runtime/Resources/CesiumPointCloudShading.hlsl +156 -0
- package/Runtime/Resources/CesiumPointCloudShading.hlsl.meta +7 -0
- package/Runtime/Resources/CesiumPointCloudShadingMaterial.mat +125 -0
- package/Runtime/Resources/CesiumPointCloudShadingMaterial.mat.meta +8 -0
- package/Runtime/Resources/CesiumPointCloudShadingShader.shader +73 -0
- package/Runtime/Resources/CesiumPointCloudShadingShader.shader.meta +10 -0
- package/Runtime/Resources/CesiumRasterOverlay.shadersubgraph +2207 -0
- package/Runtime/Resources/CesiumRasterOverlay.shadersubgraph.meta +10 -0
- package/Runtime/Resources/CesiumSelectTexCoords.shadersubgraph +722 -0
- package/Runtime/Resources/CesiumSelectTexCoords.shadersubgraph.meta +10 -0
- package/Runtime/Resources/CesiumUnlitTilesetMaterial.mat +261 -0
- package/Runtime/Resources/CesiumUnlitTilesetMaterial.mat.meta +8 -0
- package/Runtime/Resources/CesiumUnlitTilesetShader.shadergraph +5873 -0
- package/Runtime/Resources/CesiumUnlitTilesetShader.shadergraph.meta +10 -0
- package/Runtime/Resources/DynamicCamera.prefab +253 -0
- package/Runtime/Resources/DynamicCamera.prefab.meta +7 -0
- package/Runtime/Resources/TransformTextureCoordinates.shadersubgraph +2171 -0
- package/Runtime/Resources/TransformTextureCoordinates.shadersubgraph.meta +10 -0
- package/Runtime/Resources/green1x1.png +0 -0
- package/Runtime/Resources/green1x1.png.meta +123 -0
- package/Runtime/Resources.meta +8 -0
- package/Runtime/TestGltfModel.cs +56 -0
- package/Runtime/TestGltfModel.cs.meta +11 -0
- package/Runtime/TestReinterop.cs +21 -0
- package/Runtime/TestReinterop.cs.meta +11 -0
- package/Runtime/UnityLifetime.cs +27 -0
- package/Runtime/UnityLifetime.cs.meta +11 -0
- package/Runtime/WaitForTask.cs +25 -0
- package/Runtime/WaitForTask.cs.meta +11 -0
- package/Runtime/csc.rsp +1 -0
- package/Runtime/csc.rsp.meta +7 -0
- package/Runtime.meta +8 -0
- package/ThirdParty.json +27 -0
- package/ThirdParty.json.meta +7 -0
- package/WGS84.asset +18 -0
- package/WGS84.asset.meta +8 -0
- package/package.json +29 -0
- package/package.json.meta +7 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
using Reinterop;
|
|
2
|
+
using System;
|
|
3
|
+
using Unity.Mathematics;
|
|
4
|
+
using UnityEngine;
|
|
5
|
+
|
|
6
|
+
namespace CesiumForUnity
|
|
7
|
+
{
|
|
8
|
+
/// <summary>
|
|
9
|
+
/// Describes a curve that's a section of an ellipse that lies on a plane intersecting the center of the earth and
|
|
10
|
+
/// both the source and destination points on an ellipsoid. This curve can be sampled at any point along its length.
|
|
11
|
+
/// </summary>
|
|
12
|
+
[ReinteropNativeImplementation("CesiumForUnityNative::CesiumSimplePlanarEllipsoidCurveImpl", "CesiumSimplePlanarEllipsoidCurveImpl.h")]
|
|
13
|
+
[IconAttribute("Packages/com.cesium.unity/Editor/Resources/Cesium-24x24.png")]
|
|
14
|
+
public partial class CesiumSimplePlanarEllipsoidCurve
|
|
15
|
+
{
|
|
16
|
+
[Obsolete("Use CesiumSimplePlanarCurve.FromCenteredFixedCoordinates instead.")]
|
|
17
|
+
public static CesiumSimplePlanarEllipsoidCurve FromEarthCenteredEarthFixedCoordinates(
|
|
18
|
+
CesiumEllipsoid ellipsoid, double3 sourceEcef, double3 destinationEcef)
|
|
19
|
+
{
|
|
20
|
+
return FromCenteredFixedCoordinates(ellipsoid, sourceEcef, destinationEcef);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
/// <summary>
|
|
25
|
+
/// Creates a new <see cref="CesiumSimplePlanarEllipsoidCurve"/> object from a pair of
|
|
26
|
+
/// Ellipsoid-Centered, Ellipsoid-Fixed coordinates describing the beginning and end points of the curve.
|
|
27
|
+
/// </summary>
|
|
28
|
+
/// <param name="ellipsoid">The ellipsoid to use for this curve.</param>
|
|
29
|
+
/// <param name="sourceEcef">The start point of the curve.</param>
|
|
30
|
+
/// <param name="destinationEcef">The end point of the curve.</param>
|
|
31
|
+
/// <returns>
|
|
32
|
+
/// A <see cref="CesiumSimplePlanarEllipsoidCurve"/> if a curve can successfully be
|
|
33
|
+
/// created between the two points, or null otherwise.
|
|
34
|
+
/// </returns>
|
|
35
|
+
public static CesiumSimplePlanarEllipsoidCurve FromCenteredFixedCoordinates(CesiumEllipsoid ellipsoid, double3 sourceEcef, double3 destinationEcef)
|
|
36
|
+
{
|
|
37
|
+
CesiumSimplePlanarEllipsoidCurve curve = new CesiumSimplePlanarEllipsoidCurve();
|
|
38
|
+
if (!curve.CreateFromCenteredFixed(ellipsoid, sourceEcef, destinationEcef))
|
|
39
|
+
{
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return curve;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/// <summary>
|
|
47
|
+
/// Creates a new <see cref="CesiumSimplePlanarEllipsoidCurve"/> object from a pair of cartographic
|
|
48
|
+
/// coordinates (Longitude, Latitude, and Height) describing the beginning and end points of the curve.
|
|
49
|
+
/// </summary>
|
|
50
|
+
/// <param name="ellipsoid">The ellipsoid to use for this curve.</param>
|
|
51
|
+
/// <param name="sourceLlh">The start point of the curve.</param>
|
|
52
|
+
/// <param name="destinationLlh">The end point of the curve.</param>
|
|
53
|
+
/// <returns>
|
|
54
|
+
/// A <see cref="CesiumSimplePlanarEllipsoidCurve"/> if a curve can successfully be
|
|
55
|
+
/// created between the two points, or null otherwise.
|
|
56
|
+
/// </returns>
|
|
57
|
+
public static CesiumSimplePlanarEllipsoidCurve FromLongituteLatitudeHeight(CesiumEllipsoid ellipsoid, double3 sourceLlh, double3 destinationLlh)
|
|
58
|
+
{
|
|
59
|
+
CesiumSimplePlanarEllipsoidCurve curve = new CesiumSimplePlanarEllipsoidCurve();
|
|
60
|
+
if (!curve.CreateFromLongitudeLatitudeHeight(ellipsoid, sourceLlh, destinationLlh))
|
|
61
|
+
{
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return curve;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
#region Implementation
|
|
69
|
+
/// <summary>
|
|
70
|
+
/// Samples the curve at the given percentage of its length.
|
|
71
|
+
/// </summary>
|
|
72
|
+
/// <param name="percentage">
|
|
73
|
+
/// The percentage of the curve's length to sample at, where 0 is the beginning and 1 is the end.
|
|
74
|
+
/// This value will be clamped to the range [0..1].
|
|
75
|
+
/// </param>
|
|
76
|
+
/// <param name="additionalHeight">
|
|
77
|
+
/// The height above the earth at this position will be calculated by interpolating between the height
|
|
78
|
+
/// at the beginning and end points of the curve, based on the value of <paramref name="percentage"/>.
|
|
79
|
+
/// This parameter specifies an additional offset to add to the height at this position.
|
|
80
|
+
/// </param>
|
|
81
|
+
/// <returns>The position of the given point on this curve in Earth-Centered, Earth-Fixed coordinates.</returns>
|
|
82
|
+
public partial double3 GetPosition(double percentage, double additionalHeight = 0.0);
|
|
83
|
+
|
|
84
|
+
private partial bool CreateFromCenteredFixed(CesiumEllipsoid ellipsoid, double3 sourceEcef, double3 destinationEcef);
|
|
85
|
+
private partial bool CreateFromLongitudeLatitudeHeight(CesiumEllipsoid ellipsoid, double3 sourceLlh, double3 destinationLlh);
|
|
86
|
+
|
|
87
|
+
private CesiumSimplePlanarEllipsoidCurve()
|
|
88
|
+
{
|
|
89
|
+
CreateImplementation();
|
|
90
|
+
}
|
|
91
|
+
#endregion
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1,473 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using Unity.Mathematics;
|
|
3
|
+
using UnityEngine;
|
|
4
|
+
|
|
5
|
+
namespace CesiumForUnity
|
|
6
|
+
{
|
|
7
|
+
/// <summary>
|
|
8
|
+
/// A sub-scene with its own georeference origin. When a game object with a <see cref="CesiumOriginShift"/>
|
|
9
|
+
/// comes close to a sub-scene, that sub-scene is activated and all other sub-scenes are deactivated.
|
|
10
|
+
/// This allows relatively normal Unity scenes to be designed at multiple locations on the globe.
|
|
11
|
+
/// </summary>
|
|
12
|
+
/// <remarks>
|
|
13
|
+
/// <para>
|
|
14
|
+
/// When determining the distance to a sub-scene, only the <see cref="CesiumGeoreference"/>'s Transform
|
|
15
|
+
/// is considered. The Transform associated with the sub-scene is ignored. The sub-scene transform _will_
|
|
16
|
+
/// affect the transformation of the objects inside it once activated, however.
|
|
17
|
+
/// </para>
|
|
18
|
+
/// </remarks>
|
|
19
|
+
[ExecuteInEditMode]
|
|
20
|
+
[AddComponentMenu("Cesium/Cesium Sub Scene")]
|
|
21
|
+
[IconAttribute("Packages/com.cesium.unity/Editor/Resources/Cesium-24x24.png")]
|
|
22
|
+
public class CesiumSubScene : MonoBehaviour
|
|
23
|
+
{
|
|
24
|
+
#if UNITY_EDITOR
|
|
25
|
+
// Caches the built-in sphere mesh across all CesiumSubScenes for use in OnDrawGizmos
|
|
26
|
+
private static Mesh _previewSphereMesh;
|
|
27
|
+
#endif
|
|
28
|
+
|
|
29
|
+
[SerializeField]
|
|
30
|
+
private double _activationRadius = 1000;
|
|
31
|
+
|
|
32
|
+
/// <summary>
|
|
33
|
+
/// The maximum distance at which to activate this sub-scene, in meters.
|
|
34
|
+
/// </summary>
|
|
35
|
+
/// <remarks>
|
|
36
|
+
/// Even if the <see cref="CesiumOriginShift"/> game object is inside this activation radius, this
|
|
37
|
+
/// sub-scene may still not be activated if another sub-scene is closer.
|
|
38
|
+
/// </remarks>
|
|
39
|
+
public double activationRadius
|
|
40
|
+
{
|
|
41
|
+
get => this._activationRadius;
|
|
42
|
+
set
|
|
43
|
+
{
|
|
44
|
+
this._activationRadius = value;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
[SerializeField]
|
|
49
|
+
private bool _showActivationRadius = true;
|
|
50
|
+
|
|
51
|
+
/// <summary>
|
|
52
|
+
/// Whether to show the activation radius as a wireframe sphere in the Editor.
|
|
53
|
+
/// </summary>
|
|
54
|
+
public bool showActivationRadius
|
|
55
|
+
{
|
|
56
|
+
get => this._showActivationRadius;
|
|
57
|
+
set => this._showActivationRadius = value;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
[SerializeField]
|
|
61
|
+
private CesiumGeoreferenceOriginAuthority _originAuthority =
|
|
62
|
+
CesiumGeoreferenceOriginAuthority.LongitudeLatitudeHeight;
|
|
63
|
+
|
|
64
|
+
/// <summary>
|
|
65
|
+
/// Identifies which set of coordinates authoritatively defines the origin
|
|
66
|
+
/// of this sub-scene.
|
|
67
|
+
/// </summary>
|
|
68
|
+
public CesiumGeoreferenceOriginAuthority originAuthority
|
|
69
|
+
{
|
|
70
|
+
get => this._originAuthority;
|
|
71
|
+
set
|
|
72
|
+
{
|
|
73
|
+
this._originAuthority = value;
|
|
74
|
+
this.UpdateOrigin();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
[SerializeField]
|
|
79
|
+
private double _latitude = 39.736401;
|
|
80
|
+
|
|
81
|
+
/// <summary>
|
|
82
|
+
/// The latitude of the origin of the coordinate system, in degrees, in the range -90 to 90.
|
|
83
|
+
/// This property is ignored unless <see cref="originAuthority"/> is
|
|
84
|
+
/// <see cref="CesiumGeoreferenceOriginAuthority.LongitudeLatitudeHeight"/>.
|
|
85
|
+
/// Setting this property changes the <see cref="originAuthority"/> accordingly.
|
|
86
|
+
/// </summary>
|
|
87
|
+
public double latitude
|
|
88
|
+
{
|
|
89
|
+
get => this._latitude;
|
|
90
|
+
set
|
|
91
|
+
{
|
|
92
|
+
this._latitude = value;
|
|
93
|
+
this.originAuthority = CesiumGeoreferenceOriginAuthority.LongitudeLatitudeHeight;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
[SerializeField]
|
|
98
|
+
private double _longitude = -105.25737;
|
|
99
|
+
|
|
100
|
+
/// <summary>
|
|
101
|
+
/// The longitude of the origin of the coordinate system, in degrees, in the range -180 to 180.
|
|
102
|
+
/// This property is ignored unless <see cref="originAuthority"/> is
|
|
103
|
+
/// <see cref="CesiumGeoreferenceOriginAuthority.LongitudeLatitudeHeight"/>.
|
|
104
|
+
/// Setting this property changes the <see cref="originAuthority"/> accordingly.
|
|
105
|
+
/// </summary>
|
|
106
|
+
public double longitude
|
|
107
|
+
{
|
|
108
|
+
get => this._longitude;
|
|
109
|
+
set
|
|
110
|
+
{
|
|
111
|
+
this._longitude = value;
|
|
112
|
+
this.originAuthority = CesiumGeoreferenceOriginAuthority.LongitudeLatitudeHeight;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
[SerializeField]
|
|
117
|
+
private double _height = 2250.0;
|
|
118
|
+
|
|
119
|
+
/// <summary>
|
|
120
|
+
/// The height in the origin of the coordinate system, in meters above the ellipsoid. Do not
|
|
121
|
+
/// confuse this with a geoid height or height above mean sea level, which can be tens of
|
|
122
|
+
/// meters higher or lower depending on where in the world the object is located. This
|
|
123
|
+
/// property is ignored unless <see cref="originAuthority"/> is
|
|
124
|
+
/// <see cref="CesiumGeoreferenceOriginAuthority.LongitudeLatitudeHeight"/>.
|
|
125
|
+
/// Setting this property changes the <see cref="originAuthority"/> accordingly.
|
|
126
|
+
/// </summary>
|
|
127
|
+
public double height
|
|
128
|
+
{
|
|
129
|
+
get => this._height;
|
|
130
|
+
set
|
|
131
|
+
{
|
|
132
|
+
this._height = value;
|
|
133
|
+
this.originAuthority = CesiumGeoreferenceOriginAuthority.LongitudeLatitudeHeight;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
[SerializeField]
|
|
138
|
+
private double _ecefX = 6378137.0;
|
|
139
|
+
|
|
140
|
+
/// <summary>
|
|
141
|
+
/// The Earth-Centered, Earth-Fixed X coordinate of the origin of the coordinate system, in meters.
|
|
142
|
+
/// This property is ignored unless <see cref="originAuthority"/> is
|
|
143
|
+
/// <see cref="CesiumGeoreferenceOriginAuthority.EarthCenteredEarthFixed"/>.
|
|
144
|
+
/// Setting this property changes the <see cref="originAuthority"/> accordingly.
|
|
145
|
+
/// </summary>
|
|
146
|
+
public double ecefX
|
|
147
|
+
{
|
|
148
|
+
get => this._ecefX;
|
|
149
|
+
set
|
|
150
|
+
{
|
|
151
|
+
this._ecefX = value;
|
|
152
|
+
this.originAuthority = CesiumGeoreferenceOriginAuthority.EarthCenteredEarthFixed;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
[SerializeField]
|
|
157
|
+
private double _ecefY = 0.0;
|
|
158
|
+
|
|
159
|
+
/// <summary>
|
|
160
|
+
/// The Earth-Centered, Earth-Fixed Y coordinate of the origin of the coordinate system, in meters.
|
|
161
|
+
/// This property is ignored unless <see cref="originAuthority"/> is
|
|
162
|
+
/// <see cref="CesiumGeoreferenceOriginAuthority.EarthCenteredEarthFixed"/>.
|
|
163
|
+
/// Setting this property changes the <see cref="originAuthority"/> accordingly.
|
|
164
|
+
/// </summary>
|
|
165
|
+
public double ecefY
|
|
166
|
+
{
|
|
167
|
+
get => this._ecefY;
|
|
168
|
+
set
|
|
169
|
+
{
|
|
170
|
+
this._ecefY = value;
|
|
171
|
+
this.originAuthority = CesiumGeoreferenceOriginAuthority.EarthCenteredEarthFixed;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
[SerializeField]
|
|
176
|
+
private double _ecefZ = 0.0;
|
|
177
|
+
|
|
178
|
+
/// <summary>
|
|
179
|
+
/// The Earth-Centered, Earth-Fixed Z coordinate of the origin of the coordinate system, in meters.
|
|
180
|
+
/// This property is ignored unless <see cref="originAuthority"/> is
|
|
181
|
+
/// <see cref="CesiumGeoreferenceOriginAuthority.EarthCenteredEarthFixed"/>.
|
|
182
|
+
/// Setting this property changes the <see cref="originAuthority"/> accordingly.
|
|
183
|
+
/// </summary>
|
|
184
|
+
public double ecefZ
|
|
185
|
+
{
|
|
186
|
+
get => this._ecefZ;
|
|
187
|
+
set
|
|
188
|
+
{
|
|
189
|
+
this._ecefZ = value;
|
|
190
|
+
this.originAuthority = CesiumGeoreferenceOriginAuthority.EarthCenteredEarthFixed;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// The resolved georeference containing this globe anchor. This is just a cache
|
|
195
|
+
// of `GetComponentInParent<CesiumGeoreference>()`.
|
|
196
|
+
[NonSerialized]
|
|
197
|
+
internal CesiumGeoreference _parentGeoreference;
|
|
198
|
+
|
|
199
|
+
#if UNITY_EDITOR
|
|
200
|
+
// The coordinates of the parent CesiumGeoreference before being changed by `UpdateOrigin`.
|
|
201
|
+
// This is used when adding a CesiumSubScene component to a GameObject. Since `OnEnable`
|
|
202
|
+
// runs before `Reset`, it will force the georeference to move to the default coordinates
|
|
203
|
+
// of CesiumSubScene, which is undesired. But there's no way to modify `OnEnable` to
|
|
204
|
+
// distinguish whether the subscene was just added or already existed in the scene.
|
|
205
|
+
// Instead, we need to store the georeference's previous values during `OnEnable`,
|
|
206
|
+
// so that we can move it back during `Reset`.
|
|
207
|
+
[NonSerialized]
|
|
208
|
+
private double3 _oldParentCoordinates = double3.zero;
|
|
209
|
+
|
|
210
|
+
[NonSerialized]
|
|
211
|
+
private CesiumGeoreferenceOriginAuthority _oldParentOriginAuthority;
|
|
212
|
+
#endif
|
|
213
|
+
|
|
214
|
+
/// <summary>
|
|
215
|
+
/// Sets the origin of the coordinate system to particular <see cref="ecefX"/>, <see cref="ecefY"/>,
|
|
216
|
+
/// <see cref="ecefZ"/> coordinates in the Earth-Centered, Earth-Fixed (ECEF) frame.
|
|
217
|
+
/// </summary>
|
|
218
|
+
/// <remarks>
|
|
219
|
+
/// Calling this method is more efficient than setting the properties individually.
|
|
220
|
+
/// </remarks>
|
|
221
|
+
/// <param name="x">The X coordinate in meters.</param>
|
|
222
|
+
/// <param name="y">The Y coordinate in meters.</param>
|
|
223
|
+
/// <param name="z">The Z coordinate in meters.</param>
|
|
224
|
+
public void SetOriginEarthCenteredEarthFixed(double x, double y, double z)
|
|
225
|
+
{
|
|
226
|
+
this._ecefX = x;
|
|
227
|
+
this._ecefY = y;
|
|
228
|
+
this._ecefZ = z;
|
|
229
|
+
this.originAuthority = CesiumGeoreferenceOriginAuthority.EarthCenteredEarthFixed;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/// <summary>
|
|
233
|
+
/// Sets the origin of the coordinate system to a particular <see cref="longitude"/>,
|
|
234
|
+
/// <see cref="latitude"/>, and <see cref="height"/>.
|
|
235
|
+
/// </summary>
|
|
236
|
+
/// <remarks>
|
|
237
|
+
/// Calling this method is more efficient than setting the properties individually.
|
|
238
|
+
/// </remarks>
|
|
239
|
+
/// <param name="longitude">The longitude in degrees, in the range -180 to 180.</param>
|
|
240
|
+
/// <param name="latitude">The latitude in degrees, in the range -90 to 90.</param>
|
|
241
|
+
/// <param name="height">
|
|
242
|
+
/// The height in meters above the ellipsoid. Do not confuse this with a geoid height
|
|
243
|
+
/// or height above mean sea level, which can be tens of meters higher or lower
|
|
244
|
+
/// depending on where in the world the object is located.
|
|
245
|
+
/// </param>
|
|
246
|
+
public void SetOriginLongitudeLatitudeHeight(double longitude, double latitude, double height)
|
|
247
|
+
{
|
|
248
|
+
this._longitude = longitude;
|
|
249
|
+
this._latitude = latitude;
|
|
250
|
+
this._height = height;
|
|
251
|
+
this.originAuthority = CesiumGeoreferenceOriginAuthority.LongitudeLatitudeHeight;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
private void CopyParentCoordinates()
|
|
255
|
+
{
|
|
256
|
+
this._longitude = this._parentGeoreference.longitude;
|
|
257
|
+
this._latitude = this._parentGeoreference.latitude;
|
|
258
|
+
this._height = this._parentGeoreference.height;
|
|
259
|
+
|
|
260
|
+
this._ecefX = this._parentGeoreference.ecefX;
|
|
261
|
+
this._ecefY = this._parentGeoreference.ecefY;
|
|
262
|
+
this._ecefZ = this._parentGeoreference.ecefZ;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
private void DetachFromParentIfNeeded()
|
|
266
|
+
{
|
|
267
|
+
if (this._parentGeoreference != null)
|
|
268
|
+
{
|
|
269
|
+
this._parentGeoreference.changed -= this.OnParentChanged;
|
|
270
|
+
this._parentGeoreference = null;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
private void UpdateParentReference()
|
|
275
|
+
{
|
|
276
|
+
DetachFromParentIfNeeded();
|
|
277
|
+
|
|
278
|
+
this._parentGeoreference = this.GetComponentInParent<CesiumGeoreference>();
|
|
279
|
+
|
|
280
|
+
if (this._parentGeoreference != null)
|
|
281
|
+
{
|
|
282
|
+
this._parentGeoreference.Initialize();
|
|
283
|
+
this._parentGeoreference.changed += this.OnParentChanged;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/// <summary>
|
|
288
|
+
/// Called by the Editor when the script is loaded or a value changes in the Inspector.
|
|
289
|
+
/// Use this to perform an action after a value changes in the Inspector; for example,
|
|
290
|
+
/// making sure that data stays within a certain range.
|
|
291
|
+
/// </summary>
|
|
292
|
+
private void OnValidate()
|
|
293
|
+
{
|
|
294
|
+
this.UpdateOrigin();
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
#if UNITY_EDITOR
|
|
298
|
+
/// <summary>
|
|
299
|
+
/// Called by the Editor when the user chooses to "reset" the component.
|
|
300
|
+
/// The implementation here makes sure the newly-reset values for the serialized
|
|
301
|
+
/// properties are applied.
|
|
302
|
+
/// </summary>
|
|
303
|
+
private void Reset()
|
|
304
|
+
{
|
|
305
|
+
this.UpdateParentReference();
|
|
306
|
+
|
|
307
|
+
// The default coordinates for the CesiumSubScene component should be the coordinates of its parent, if possible.
|
|
308
|
+
// This means adding the component as the child of an existing CesiumGeoreference won't reset the parent's coordinates.
|
|
309
|
+
if (this._parentGeoreference != null)
|
|
310
|
+
{
|
|
311
|
+
if (this._oldParentOriginAuthority == CesiumGeoreferenceOriginAuthority.EarthCenteredEarthFixed)
|
|
312
|
+
{
|
|
313
|
+
this._parentGeoreference.SetOriginEarthCenteredEarthFixed(this._oldParentCoordinates.x, this._oldParentCoordinates.y, this._oldParentCoordinates.z);
|
|
314
|
+
}
|
|
315
|
+
else
|
|
316
|
+
{
|
|
317
|
+
this._parentGeoreference.SetOriginLongitudeLatitudeHeight(this._oldParentCoordinates.x, this._oldParentCoordinates.y, this._oldParentCoordinates.z);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
this.CopyParentCoordinates();
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
#endif
|
|
324
|
+
|
|
325
|
+
private void OnEnable()
|
|
326
|
+
{
|
|
327
|
+
this.UpdateParentReference();
|
|
328
|
+
|
|
329
|
+
// If not under a georef, nothing to do
|
|
330
|
+
if (this._parentGeoreference == null)
|
|
331
|
+
throw new InvalidOperationException(
|
|
332
|
+
"CesiumSubScene is not nested inside a game object with a CesiumGeoreference.");
|
|
333
|
+
|
|
334
|
+
// When this sub-scene is enabled, all others are disabled.
|
|
335
|
+
CesiumSubScene[] subscenes = this._parentGeoreference.GetComponentsInChildren<CesiumSubScene>();
|
|
336
|
+
foreach (CesiumSubScene scene in subscenes)
|
|
337
|
+
{
|
|
338
|
+
if (scene == this)
|
|
339
|
+
continue;
|
|
340
|
+
scene.gameObject.SetActive(false);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
#if UNITY_EDITOR
|
|
344
|
+
// The parent's previous coordinates are saved here in case they have to be reverted in the editor during `Reset`
|
|
345
|
+
this._oldParentOriginAuthority = this._parentGeoreference.originAuthority;
|
|
346
|
+
if (this._oldParentOriginAuthority == CesiumGeoreferenceOriginAuthority.EarthCenteredEarthFixed)
|
|
347
|
+
{
|
|
348
|
+
this._oldParentCoordinates = new double3(this._parentGeoreference.ecefX, this._parentGeoreference.ecefY, this._parentGeoreference.ecefZ);
|
|
349
|
+
}
|
|
350
|
+
else
|
|
351
|
+
{
|
|
352
|
+
this._oldParentCoordinates = new double3(this._parentGeoreference.longitude, this._parentGeoreference.latitude, this._parentGeoreference.height);
|
|
353
|
+
}
|
|
354
|
+
#endif
|
|
355
|
+
|
|
356
|
+
this.UpdateOrigin();
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
private void OnParentChanged()
|
|
360
|
+
{
|
|
361
|
+
if (!this.isActiveAndEnabled)
|
|
362
|
+
return;
|
|
363
|
+
|
|
364
|
+
this.UpdateParentReference();
|
|
365
|
+
|
|
366
|
+
// If not under a georef, nothing to do
|
|
367
|
+
if (this._parentGeoreference == null)
|
|
368
|
+
{
|
|
369
|
+
throw new InvalidOperationException(
|
|
370
|
+
"CesiumSubScene should have been nested inside a game object with a CesiumGeoreference.");
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
// Update our origin to our parent georef, maintain our origin authority,
|
|
374
|
+
// and copy both sets of reference coordinates. No need to calculate any of this again
|
|
375
|
+
this.CopyParentCoordinates();
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
private void OnDisable()
|
|
379
|
+
{
|
|
380
|
+
DetachFromParentIfNeeded();
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
private void OnDestroy()
|
|
384
|
+
{
|
|
385
|
+
DetachFromParentIfNeeded();
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
private void UpdateOtherCoordinates()
|
|
389
|
+
{
|
|
390
|
+
if(this._parentGeoreference == null)
|
|
391
|
+
{
|
|
392
|
+
this.UpdateParentReference();
|
|
393
|
+
|
|
394
|
+
if(this._parentGeoreference == null)
|
|
395
|
+
{
|
|
396
|
+
throw new InvalidOperationException("CesiumSubScene should have been nested inside a game object with a CesiumGeoreference.");
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
if (this._originAuthority == CesiumGeoreferenceOriginAuthority.LongitudeLatitudeHeight)
|
|
401
|
+
{
|
|
402
|
+
double3 ecef = this._parentGeoreference.ellipsoid.LongitudeLatitudeHeightToCenteredFixed(new double3(
|
|
403
|
+
this._longitude,
|
|
404
|
+
this._latitude,
|
|
405
|
+
this._height
|
|
406
|
+
));
|
|
407
|
+
|
|
408
|
+
this._ecefX = ecef.x;
|
|
409
|
+
this._ecefY = ecef.y;
|
|
410
|
+
this._ecefZ = ecef.z;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
if (this._originAuthority == CesiumGeoreferenceOriginAuthority.EarthCenteredEarthFixed)
|
|
414
|
+
{
|
|
415
|
+
double3 llh = this._parentGeoreference.ellipsoid.CenteredFixedToLongitudeLatitudeHeight(new double3(
|
|
416
|
+
this._ecefX,
|
|
417
|
+
this._ecefY,
|
|
418
|
+
this._ecefZ
|
|
419
|
+
));
|
|
420
|
+
|
|
421
|
+
this._longitude = llh.x;
|
|
422
|
+
this._latitude = llh.y;
|
|
423
|
+
this._height = llh.z;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
/// <summary>
|
|
428
|
+
/// Recomputes the coordinate system based on an updated origin. It is usually not
|
|
429
|
+
/// necessary to call this directly as it is called automatically when needed.
|
|
430
|
+
/// </summary>
|
|
431
|
+
public void UpdateOrigin()
|
|
432
|
+
{
|
|
433
|
+
UpdateOtherCoordinates();
|
|
434
|
+
|
|
435
|
+
if (this.isActiveAndEnabled)
|
|
436
|
+
{
|
|
437
|
+
this.UpdateParentReference();
|
|
438
|
+
|
|
439
|
+
if (this._parentGeoreference == null)
|
|
440
|
+
throw new InvalidOperationException("CesiumSubScene is not nested inside a game object with a CesiumGeoreference.");
|
|
441
|
+
|
|
442
|
+
if (this.originAuthority == CesiumGeoreferenceOriginAuthority.EarthCenteredEarthFixed)
|
|
443
|
+
this._parentGeoreference.SetOriginEarthCenteredEarthFixed(
|
|
444
|
+
this._ecefX,
|
|
445
|
+
this._ecefY,
|
|
446
|
+
this._ecefZ);
|
|
447
|
+
else
|
|
448
|
+
this._parentGeoreference.SetOriginLongitudeLatitudeHeight(
|
|
449
|
+
this._longitude,
|
|
450
|
+
this._latitude,
|
|
451
|
+
this._height);
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
#if UNITY_EDITOR
|
|
456
|
+
private void OnDrawGizmos()
|
|
457
|
+
{
|
|
458
|
+
if (this._showActivationRadius)
|
|
459
|
+
{
|
|
460
|
+
// Gizmos.DrawWireSphere only draws three wire circles representing the sphere's radii
|
|
461
|
+
// To do better, we need to fetch the built-in sphere mesh and use that
|
|
462
|
+
if (_previewSphereMesh == null)
|
|
463
|
+
{
|
|
464
|
+
_previewSphereMesh = Resources.GetBuiltinResource<Mesh>("Sphere.fbx");
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
Gizmos.color = Color.blue;
|
|
468
|
+
Gizmos.DrawWireMesh(_previewSphereMesh, this.transform.position, Quaternion.identity, (float3)new double3(this._activationRadius, this._activationRadius, this._activationRadius));
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
#endif
|
|
472
|
+
}
|
|
473
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
using Reinterop;
|
|
2
|
+
using UnityEngine;
|
|
3
|
+
|
|
4
|
+
namespace CesiumForUnity
|
|
5
|
+
{
|
|
6
|
+
/// <summary>
|
|
7
|
+
/// The abstract base class for <see cref="Cesium3DTileset"/> tile excluders. By creating a class derived
|
|
8
|
+
/// from `CesiumTileExcluder`, then adding it to a game object containing a `Cesium3DTileset` (or one of
|
|
9
|
+
/// its parents), you can implement custom rules for excluding tiles in the `Cesium3DTileset` from loading
|
|
10
|
+
/// and rendering.
|
|
11
|
+
/// </summary>
|
|
12
|
+
[ExecuteInEditMode]
|
|
13
|
+
[ReinteropNativeImplementation("CesiumForUnityNative::CesiumTileExcluderImpl", "CesiumTileExcluderImpl.h", staticOnly: true)]
|
|
14
|
+
public abstract partial class CesiumTileExcluder : MonoBehaviour
|
|
15
|
+
{
|
|
16
|
+
/// <summary>
|
|
17
|
+
/// Determines whether the given tile should be excluded from loading and rendering. If a tile is
|
|
18
|
+
/// excluded, all of its children and other descendants in the bounding volume hierarchy will be
|
|
19
|
+
/// excluded as well.
|
|
20
|
+
/// </summary>
|
|
21
|
+
/// <param name="tile">The tile to check. This instance is only valid for the duration of this call. Saving
|
|
22
|
+
/// it and using it later will result in undefined behavior, including crashes.</param>
|
|
23
|
+
/// <returns>True if the tile should be excluded, false if the tile should be loaded and rendered.</returns>
|
|
24
|
+
public abstract bool ShouldExclude(Cesium3DTile tile);
|
|
25
|
+
|
|
26
|
+
protected virtual void OnEnable()
|
|
27
|
+
{
|
|
28
|
+
Cesium3DTileset[] tilesets = this.GetComponentsInChildren<Cesium3DTileset>();
|
|
29
|
+
foreach (Cesium3DTileset tileset in tilesets)
|
|
30
|
+
{
|
|
31
|
+
this.AddToTileset(tileset);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
protected virtual void OnDisable()
|
|
36
|
+
{
|
|
37
|
+
Cesium3DTileset[] tilesets = this.GetComponentsInChildren<Cesium3DTileset>();
|
|
38
|
+
foreach (Cesium3DTileset tileset in tilesets)
|
|
39
|
+
{
|
|
40
|
+
this.RemoveFromTileset(tileset);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
internal partial void AddToTileset(Cesium3DTileset tileset);
|
|
45
|
+
internal partial void RemoveFromTileset(Cesium3DTileset tileset);
|
|
46
|
+
}
|
|
47
|
+
}
|