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,203 @@
|
|
|
1
|
+
using UnityEngine;
|
|
2
|
+
using Unity.Mathematics;
|
|
3
|
+
using System;
|
|
4
|
+
|
|
5
|
+
namespace CesiumForUnity
|
|
6
|
+
{
|
|
7
|
+
/// <summary>
|
|
8
|
+
/// Identifies the type of a property in EXT_structural_metadata.
|
|
9
|
+
/// </summary>
|
|
10
|
+
public enum CesiumMetadataType
|
|
11
|
+
{
|
|
12
|
+
Invalid = 0,
|
|
13
|
+
Scalar,
|
|
14
|
+
Vec2,
|
|
15
|
+
Vec3,
|
|
16
|
+
Vec4,
|
|
17
|
+
Mat2,
|
|
18
|
+
Mat3,
|
|
19
|
+
Mat4,
|
|
20
|
+
String,
|
|
21
|
+
Boolean,
|
|
22
|
+
Enum
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/// <summary>
|
|
26
|
+
/// Identifies the component type of a property in EXT_structural_metadata.
|
|
27
|
+
/// Only applicable if the property has a Scalar, VecN, or MatN type.
|
|
28
|
+
/// </summary>
|
|
29
|
+
public enum CesiumMetadataComponentType
|
|
30
|
+
{
|
|
31
|
+
None = 0,
|
|
32
|
+
Int8,
|
|
33
|
+
Uint8,
|
|
34
|
+
Int16,
|
|
35
|
+
Uint16,
|
|
36
|
+
Int32,
|
|
37
|
+
Uint32,
|
|
38
|
+
Int64,
|
|
39
|
+
Uint64,
|
|
40
|
+
Float32,
|
|
41
|
+
Float64
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/// <summary>
|
|
45
|
+
/// Represents the value type of a metadata value or property, akin to the
|
|
46
|
+
/// property types in EXT_structural_metadata.
|
|
47
|
+
/// </summary>
|
|
48
|
+
public struct CesiumMetadataValueType
|
|
49
|
+
{
|
|
50
|
+
#region Fields
|
|
51
|
+
/// <summary>
|
|
52
|
+
/// The type of the metadata property or value.
|
|
53
|
+
/// </summary>
|
|
54
|
+
public CesiumMetadataType type;
|
|
55
|
+
|
|
56
|
+
/// <summary>
|
|
57
|
+
/// The component of the metadata property or value. Only applies when
|
|
58
|
+
/// the type is a Scalar, VecN, or MatN type.
|
|
59
|
+
/// </summary>
|
|
60
|
+
public CesiumMetadataComponentType componentType;
|
|
61
|
+
|
|
62
|
+
/// <summary>
|
|
63
|
+
/// Whether or not this represents an array containing elements of the
|
|
64
|
+
/// specified types.
|
|
65
|
+
/// </summary>
|
|
66
|
+
public bool isArray;
|
|
67
|
+
#endregion
|
|
68
|
+
|
|
69
|
+
#region Constructor
|
|
70
|
+
/// <summary>
|
|
71
|
+
/// Constructs a metadata value type from the given parameters.
|
|
72
|
+
/// </summary>
|
|
73
|
+
/// <param name="type">The type of the metadata property or value.</param>
|
|
74
|
+
/// <param name="componentType"> The component type of the metadata property or value.</param>
|
|
75
|
+
/// <param name="isArray">Whether or not the property or value is an array.</param>
|
|
76
|
+
public CesiumMetadataValueType(
|
|
77
|
+
CesiumMetadataType type, CesiumMetadataComponentType componentType, bool isArray)
|
|
78
|
+
{
|
|
79
|
+
this.type = type;
|
|
80
|
+
this.componentType = componentType;
|
|
81
|
+
this.isArray = isArray;
|
|
82
|
+
}
|
|
83
|
+
#endregion
|
|
84
|
+
|
|
85
|
+
#region Static methods
|
|
86
|
+
public static CesiumMetadataValueType GetValueType(System.Object inObject)
|
|
87
|
+
{
|
|
88
|
+
if (inObject == null)
|
|
89
|
+
{
|
|
90
|
+
return new CesiumMetadataValueType();
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (inObject.GetType() == typeof(CesiumPropertyArray))
|
|
94
|
+
{
|
|
95
|
+
CesiumPropertyArray array = inObject as CesiumPropertyArray;
|
|
96
|
+
return new CesiumMetadataValueType(array.elementValueType.type, array.elementValueType.componentType, true);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
switch (inObject)
|
|
100
|
+
{
|
|
101
|
+
case System.Boolean:
|
|
102
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Boolean, CesiumMetadataComponentType.None, false);
|
|
103
|
+
case System.SByte:
|
|
104
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Scalar, CesiumMetadataComponentType.Int8, false);
|
|
105
|
+
case Byte:
|
|
106
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Scalar, CesiumMetadataComponentType.Uint8, false);
|
|
107
|
+
case Int16:
|
|
108
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Scalar, CesiumMetadataComponentType.Int16, false);
|
|
109
|
+
case UInt16:
|
|
110
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Scalar, CesiumMetadataComponentType.Uint16, false);
|
|
111
|
+
case Int32:
|
|
112
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Scalar, CesiumMetadataComponentType.Int32, false);
|
|
113
|
+
case UInt32:
|
|
114
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Scalar, CesiumMetadataComponentType.Uint32, false);
|
|
115
|
+
case Int64:
|
|
116
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Scalar, CesiumMetadataComponentType.Int64, false);
|
|
117
|
+
case UInt64:
|
|
118
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Scalar, CesiumMetadataComponentType.Uint64, false);
|
|
119
|
+
case float:
|
|
120
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Scalar, CesiumMetadataComponentType.Float32, false);
|
|
121
|
+
case double:
|
|
122
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Scalar, CesiumMetadataComponentType.Float64, false);
|
|
123
|
+
case int2:
|
|
124
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Vec2, CesiumMetadataComponentType.Int32, false);
|
|
125
|
+
case int3:
|
|
126
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Vec3, CesiumMetadataComponentType.Int32, false);
|
|
127
|
+
case int4:
|
|
128
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Vec4, CesiumMetadataComponentType.Int32, false);
|
|
129
|
+
case uint2:
|
|
130
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Vec2, CesiumMetadataComponentType.Uint32, false);
|
|
131
|
+
case uint3:
|
|
132
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Vec3, CesiumMetadataComponentType.Uint32, false);
|
|
133
|
+
case uint4:
|
|
134
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Vec4, CesiumMetadataComponentType.Uint32, false);
|
|
135
|
+
case float2:
|
|
136
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Vec2, CesiumMetadataComponentType.Float32, false);
|
|
137
|
+
case float3:
|
|
138
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Vec3, CesiumMetadataComponentType.Float32, false);
|
|
139
|
+
case float4:
|
|
140
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Vec4, CesiumMetadataComponentType.Float32, false);
|
|
141
|
+
case double2:
|
|
142
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Vec2, CesiumMetadataComponentType.Float64, false);
|
|
143
|
+
case double3:
|
|
144
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Vec3, CesiumMetadataComponentType.Float64, false);
|
|
145
|
+
case double4:
|
|
146
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Vec4, CesiumMetadataComponentType.Float64, false);
|
|
147
|
+
case int2x2:
|
|
148
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Mat2, CesiumMetadataComponentType.Int32, false);
|
|
149
|
+
case int3x3:
|
|
150
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Mat3, CesiumMetadataComponentType.Int32, false);
|
|
151
|
+
case int4x4:
|
|
152
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Mat4, CesiumMetadataComponentType.Int32, false);
|
|
153
|
+
case CesiumIntVec2:
|
|
154
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Vec2, (inObject as CesiumIntVec2?).Value.componentType, false);
|
|
155
|
+
case CesiumIntVec3:
|
|
156
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Vec3, (inObject as CesiumIntVec3?).Value.componentType, false);
|
|
157
|
+
case CesiumIntVec4:
|
|
158
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Vec4, (inObject as CesiumIntVec4?).Value.componentType, false);
|
|
159
|
+
case CesiumUintVec2:
|
|
160
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Vec2, (inObject as CesiumUintVec2?).Value.componentType, false);
|
|
161
|
+
case CesiumUintVec3:
|
|
162
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Vec3, (inObject as CesiumUintVec3?).Value.componentType, false);
|
|
163
|
+
case CesiumUintVec4:
|
|
164
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Vec4, (inObject as CesiumUintVec4?).Value.componentType, false);
|
|
165
|
+
case uint2x2:
|
|
166
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Mat2, CesiumMetadataComponentType.Uint32, false);
|
|
167
|
+
case uint3x3:
|
|
168
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Mat3, CesiumMetadataComponentType.Uint32, false);
|
|
169
|
+
case uint4x4:
|
|
170
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Mat4, CesiumMetadataComponentType.Uint32, false);
|
|
171
|
+
case float2x2:
|
|
172
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Mat2, CesiumMetadataComponentType.Float32, false);
|
|
173
|
+
case float3x3:
|
|
174
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Mat3, CesiumMetadataComponentType.Float32, false);
|
|
175
|
+
case float4x4:
|
|
176
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Mat4, CesiumMetadataComponentType.Float32, false);
|
|
177
|
+
case double2x2:
|
|
178
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Mat2, CesiumMetadataComponentType.Float64, false);
|
|
179
|
+
case double3x3:
|
|
180
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Mat3, CesiumMetadataComponentType.Float64, false);
|
|
181
|
+
case double4x4:
|
|
182
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Mat4, CesiumMetadataComponentType.Float64, false);
|
|
183
|
+
case CesiumIntMat2x2:
|
|
184
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Mat2, (inObject as CesiumIntMat2x2?).Value.componentType, false);
|
|
185
|
+
case CesiumIntMat3x3:
|
|
186
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Mat3, (inObject as CesiumIntMat3x3?).Value.componentType, false);
|
|
187
|
+
case CesiumIntMat4x4:
|
|
188
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Mat4, (inObject as CesiumIntMat4x4?).Value.componentType, false);
|
|
189
|
+
case CesiumUintMat2x2:
|
|
190
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Mat2, (inObject as CesiumUintMat2x2?).Value.componentType, false);
|
|
191
|
+
case CesiumUintMat3x3:
|
|
192
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Mat3, (inObject as CesiumUintMat3x3?).Value.componentType, false);
|
|
193
|
+
case CesiumUintMat4x4:
|
|
194
|
+
return new CesiumMetadataValueType(CesiumMetadataType.Mat4, (inObject as CesiumUintMat4x4?).Value.componentType, false);
|
|
195
|
+
case System.String:
|
|
196
|
+
return new CesiumMetadataValueType(CesiumMetadataType.String, CesiumMetadataComponentType.None, false);
|
|
197
|
+
default:
|
|
198
|
+
return new CesiumMetadataValueType();
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
#endregion
|
|
202
|
+
}
|
|
203
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
using UnityEngine;
|
|
2
|
+
|
|
3
|
+
namespace CesiumForUnity
|
|
4
|
+
{
|
|
5
|
+
/// <summary>
|
|
6
|
+
/// Represents the root `EXT_structural_metadata` extension of a glTF model in a
|
|
7
|
+
/// <see cref="Cesium3DTileset"/>. It holds views of property tables
|
|
8
|
+
/// available on the glTF.
|
|
9
|
+
/// </summary>
|
|
10
|
+
/// <remarks>
|
|
11
|
+
/// This component is automatically added
|
|
12
|
+
/// to tile game objects if their models contain the root extension.
|
|
13
|
+
/// </remarks>
|
|
14
|
+
[IconAttribute("Packages/com.cesium.unity/Editor/Resources/Cesium-24x24.png")]
|
|
15
|
+
[AddComponentMenu("")]
|
|
16
|
+
public class CesiumModelMetadata : MonoBehaviour
|
|
17
|
+
{
|
|
18
|
+
/// <summary>
|
|
19
|
+
/// The <see cref="CesiumPropertyTable"/>s available on this model metadata.
|
|
20
|
+
/// </summary>
|
|
21
|
+
public CesiumPropertyTable[] propertyTables
|
|
22
|
+
{
|
|
23
|
+
get; internal set;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
using System;
|
|
2
|
+
using System.Collections.Generic;
|
|
3
|
+
|
|
4
|
+
namespace CesiumForUnity
|
|
5
|
+
{
|
|
6
|
+
internal class CesiumObjectPool<T> : IDisposable where T : class
|
|
7
|
+
{
|
|
8
|
+
private List<T> _pool;
|
|
9
|
+
private int _maximumSize;
|
|
10
|
+
private Func<T> _createCallback;
|
|
11
|
+
private Action<T> _releaseCallback;
|
|
12
|
+
private Action<T> _destroyCallback;
|
|
13
|
+
|
|
14
|
+
public CesiumObjectPool(Func<T> createCallback, Action<T> releaseCallback, Action<T> destroyCallback, int maximumSize = 1000)
|
|
15
|
+
{
|
|
16
|
+
this._pool = new List<T>(maximumSize);
|
|
17
|
+
this._maximumSize = maximumSize;
|
|
18
|
+
this._createCallback = createCallback;
|
|
19
|
+
this._releaseCallback = releaseCallback;
|
|
20
|
+
this._destroyCallback = destroyCallback;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public void Dispose()
|
|
24
|
+
{
|
|
25
|
+
this.Clear();
|
|
26
|
+
|
|
27
|
+
// A null pool indicates released objects should be freed,
|
|
28
|
+
// rather than added back into the pool.
|
|
29
|
+
this._pool = null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
public int CountInactive => this._pool.Count;
|
|
33
|
+
|
|
34
|
+
public void Clear()
|
|
35
|
+
{
|
|
36
|
+
if (this._pool == null)
|
|
37
|
+
return;
|
|
38
|
+
|
|
39
|
+
foreach (T o in this._pool)
|
|
40
|
+
{
|
|
41
|
+
this._destroyCallback(o);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
public T Get()
|
|
46
|
+
{
|
|
47
|
+
if (this._pool != null && this._pool.Count > 0)
|
|
48
|
+
{
|
|
49
|
+
int pos = this._pool.Count - 1;
|
|
50
|
+
T result = this._pool[pos];
|
|
51
|
+
this._pool.RemoveAt(pos);
|
|
52
|
+
return result;
|
|
53
|
+
}
|
|
54
|
+
else
|
|
55
|
+
{
|
|
56
|
+
return this._createCallback();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
public void Release(T element)
|
|
61
|
+
{
|
|
62
|
+
this._releaseCallback(element);
|
|
63
|
+
|
|
64
|
+
if (this._pool != null && this._pool.Count < this._maximumSize)
|
|
65
|
+
{
|
|
66
|
+
this._pool.Add(element);
|
|
67
|
+
}
|
|
68
|
+
else
|
|
69
|
+
{
|
|
70
|
+
this._destroyCallback(element);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
using UnityEngine;
|
|
2
|
+
|
|
3
|
+
#if UNITY_EDITOR
|
|
4
|
+
using UnityEditor;
|
|
5
|
+
#endif
|
|
6
|
+
|
|
7
|
+
namespace CesiumForUnity
|
|
8
|
+
{
|
|
9
|
+
internal class CesiumObjectPools
|
|
10
|
+
{
|
|
11
|
+
public static CesiumObjectPool<Mesh> MeshPool => _meshPool;
|
|
12
|
+
|
|
13
|
+
private static CesiumObjectPool<Mesh> _meshPool;
|
|
14
|
+
|
|
15
|
+
public static void Dispose()
|
|
16
|
+
{
|
|
17
|
+
_meshPool.Dispose();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
static CesiumObjectPools()
|
|
21
|
+
{
|
|
22
|
+
_meshPool = new CesiumObjectPool<Mesh>(
|
|
23
|
+
() => new Mesh(),
|
|
24
|
+
(mesh) => mesh.Clear(),
|
|
25
|
+
(mesh) => UnityLifetime.Destroy(mesh));
|
|
26
|
+
|
|
27
|
+
#if UNITY_EDITOR
|
|
28
|
+
EditorApplication.playModeStateChanged += OnPlayModeStateChanged;
|
|
29
|
+
#endif
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
#if UNITY_EDITOR
|
|
33
|
+
private static void OnPlayModeStateChanged(PlayModeStateChange obj)
|
|
34
|
+
{
|
|
35
|
+
Dispose();
|
|
36
|
+
}
|
|
37
|
+
#endif
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
using System.Collections.Generic;
|
|
2
|
+
using Unity.Mathematics;
|
|
3
|
+
using UnityEngine;
|
|
4
|
+
|
|
5
|
+
namespace CesiumForUnity
|
|
6
|
+
{
|
|
7
|
+
/// <summary>
|
|
8
|
+
/// Automatically shifts the origin of a <see cref="CesiumGeoreference"/> as the object to which
|
|
9
|
+
/// it is attached moves. This improves rendering precision by keeping coordinate values small.
|
|
10
|
+
/// </summary>
|
|
11
|
+
/// <remarks>
|
|
12
|
+
/// <para>
|
|
13
|
+
/// This component is typically attached to a camera, and it automatically updates the <see cref="CesiumGeoreference"/>
|
|
14
|
+
/// to keep its origin near the location of the camera. This improves rendering precision by keeping the
|
|
15
|
+
/// coordinate values of objects that are near the camera as small as possible. A game object with this
|
|
16
|
+
/// component must be nested inside a <see cref="CesiumGeoreference"/>, and it must also have a
|
|
17
|
+
/// <see cref="CesiumGlobeAnchor"/>. It is essential to add a <see cref="CesiumGlobeAnchor"/> to all
|
|
18
|
+
/// other objects in the scene as well; otherwise, they will appear to move when the origin is shifted.
|
|
19
|
+
/// </para>
|
|
20
|
+
/// <para>
|
|
21
|
+
/// This component also switches between <see cref="CesiumSubScene"/> instances based on the distance
|
|
22
|
+
/// to them. When inside a sub-scene, the origin shifting described above is not performed. This allows
|
|
23
|
+
/// relatively normal Unity scenes to be defined at different locations on the globe.
|
|
24
|
+
/// </para>
|
|
25
|
+
/// </remarks>
|
|
26
|
+
[RequireComponent(typeof(CesiumGlobeAnchor))]
|
|
27
|
+
[DisallowMultipleComponent]
|
|
28
|
+
[AddComponentMenu("Cesium/Cesium Origin Shift")]
|
|
29
|
+
[IconAttribute("Packages/com.cesium.unity/Editor/Resources/Cesium-24x24.png")]
|
|
30
|
+
public class CesiumOriginShift : MonoBehaviour
|
|
31
|
+
{
|
|
32
|
+
/// <summary>
|
|
33
|
+
/// The maximum distance between the origin of the Unity coordinate system and
|
|
34
|
+
/// the game object to which this component is attached. When this distance is
|
|
35
|
+
/// exceeded, the <see cref="CesiumGeoreference"/> origin is shifted to bring it
|
|
36
|
+
/// close to the game object.
|
|
37
|
+
/// </summary>
|
|
38
|
+
/// <remarks>
|
|
39
|
+
/// When the value of this property is 0.0, the origin is shifted continuously.
|
|
40
|
+
/// </remarks>
|
|
41
|
+
public double distance
|
|
42
|
+
{
|
|
43
|
+
get => _distance;
|
|
44
|
+
set => _distance = value;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
[SerializeField]
|
|
48
|
+
[Min(0)]
|
|
49
|
+
[Tooltip("The maximum distance between the origin of the Unity coordinate system and " +
|
|
50
|
+
"the game object to which this component is attached. When this distance is" +
|
|
51
|
+
"exceeded, the CesiumGeoreference origin is shifted to bring it close to the " +
|
|
52
|
+
"game object.\n\n" +
|
|
53
|
+
"When the value of this property is 0.0, the origin is shifted continuously.")]
|
|
54
|
+
private double _distance = 0.0;
|
|
55
|
+
|
|
56
|
+
void LateUpdate()
|
|
57
|
+
{
|
|
58
|
+
CesiumGeoreference georeference = this.GetComponentInParent<CesiumGeoreference>();
|
|
59
|
+
|
|
60
|
+
if (georeference == null)
|
|
61
|
+
{
|
|
62
|
+
Debug.LogWarning("CesiumOriginShift is doing nothing because it is not nested inside a game object with a CesiumGeoreference component.");
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
CesiumGlobeAnchor anchor = this.GetComponent<CesiumGlobeAnchor>();
|
|
67
|
+
|
|
68
|
+
// The RequireComponent attribute should ensure the globe anchor exists, but it may not be active.
|
|
69
|
+
if (anchor == null || !anchor.isActiveAndEnabled)
|
|
70
|
+
{
|
|
71
|
+
Debug.LogWarning("CesiumOriginShift is doing nothing because its CesiumGlobeAnchor component is missing or disabled.");
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
this.UpdateFromEcef(georeference, anchor.positionGlobeFixed);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
private List<CesiumSubScene> _sublevelsScratch = new List<CesiumSubScene>();
|
|
79
|
+
|
|
80
|
+
private void UpdateFromEcef(CesiumGeoreference georeference, double3 ecef)
|
|
81
|
+
{
|
|
82
|
+
CesiumSubScene closestLevel = null;
|
|
83
|
+
double distanceSquaredToClosest = double.MaxValue;
|
|
84
|
+
|
|
85
|
+
// Are we inside a sub-level?
|
|
86
|
+
georeference.GetComponentsInChildren<CesiumSubScene>(true, this._sublevelsScratch);
|
|
87
|
+
foreach (CesiumSubScene level in this._sublevelsScratch)
|
|
88
|
+
{
|
|
89
|
+
// TODO: Make sure ECEF position is actually up-to-date
|
|
90
|
+
double x = level.ecefX - ecef.x;
|
|
91
|
+
double y = level.ecefY - ecef.y;
|
|
92
|
+
double z = level.ecefZ - ecef.z;
|
|
93
|
+
double distanceSquared = x * x + y * y + z * z;
|
|
94
|
+
if (distanceSquared > level.activationRadius * level.activationRadius)
|
|
95
|
+
// We're outside this level's activation radius
|
|
96
|
+
continue;
|
|
97
|
+
|
|
98
|
+
if (closestLevel == null || distanceSquared < distanceSquaredToClosest)
|
|
99
|
+
{
|
|
100
|
+
closestLevel = level;
|
|
101
|
+
distanceSquaredToClosest = distanceSquared;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (closestLevel != null)
|
|
106
|
+
{
|
|
107
|
+
if (!closestLevel.isActiveAndEnabled)
|
|
108
|
+
{
|
|
109
|
+
// Setting a level active will automatically disable all other levels.
|
|
110
|
+
closestLevel.gameObject.SetActive(true);
|
|
111
|
+
closestLevel.enabled = true;
|
|
112
|
+
|
|
113
|
+
Physics.SyncTransforms();
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
else
|
|
117
|
+
{
|
|
118
|
+
bool deactivatedAnySublevel = false;
|
|
119
|
+
|
|
120
|
+
// Deactivate all active sub-levels
|
|
121
|
+
foreach (CesiumSubScene level in this._sublevelsScratch)
|
|
122
|
+
{
|
|
123
|
+
if (level.isActiveAndEnabled)
|
|
124
|
+
{
|
|
125
|
+
level.gameObject.SetActive(false);
|
|
126
|
+
deactivatedAnySublevel = true;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
double distance = math.length(new double3(georeference.ecefX, georeference.ecefY, georeference.ecefZ) - ecef);
|
|
131
|
+
|
|
132
|
+
if (distance >= this._distance)
|
|
133
|
+
{
|
|
134
|
+
// Update the origin if we've surpassed the distance threshold.
|
|
135
|
+
georeference.SetOriginEarthCenteredEarthFixed(ecef.x, ecef.y, ecef.z);
|
|
136
|
+
// Make sure the physics system is informed that things have moved
|
|
137
|
+
Physics.SyncTransforms();
|
|
138
|
+
}
|
|
139
|
+
else if (deactivatedAnySublevel)
|
|
140
|
+
{
|
|
141
|
+
Physics.SyncTransforms();
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|