Skip to content

Commit 5cc5725

Browse files
authored
Merge branch 'main' into abseil-configure-order
2 parents a4c7ece + 0c2625f commit 5cc5725

16 files changed

+89
-36
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,19 @@ jobs:
1515
steps:
1616
- name: Install Doxygen
1717
run: |
18-
sudo apt install -y doxygen
18+
cd ~
19+
wget https://github.com/doxygen/doxygen/releases/download/Release_1_12_0/doxygen-1.12.0.linux.bin.tar.gz
20+
tar xzf doxygen-1.12.0.linux.bin.tar.gz
21+
export PATH=$PWD/doxygen-1.12.0/bin:$PATH
22+
echo "PATH=$PATH" >> "$GITHUB_ENV"
23+
doxygen --version
1924
- name: Check out repository code
2025
uses: actions/checkout@v4
2126
with:
2227
submodules: recursive
2328
- name: Generate Documentation
2429
run: |
25-
doxygen ./Documentation~/Doxyfile
30+
npm run doxygen
2631
- name: Publish Documentation Artifact
2732
if: ${{ success() }}
2833
uses: actions/upload-artifact@v4

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@
1111
path = native~/extern/swl-variant
1212
url = https://github.com/kring/swl-variant.git
1313
branch = exception-public-inheritance
14+
[submodule "Documentation~/doxygen-awesome-css"]
15+
path = Documentation~/doxygen-awesome-css
16+
url = https://github.com/jothepro/doxygen-awesome-css.git

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
##### Fixes :wrench:
66

7+
- Fixed a bug that could cause a crash or incorrect textures when multiple `Cesium3DTileset` tiles referenced the same image by URL.
78
- Fixed a bug in the Abseil vcpkg overlay port that could cause linker errors on some systems.
89

910
## v1.14.0 - 2024-12-02

Documentation~/Doxyfile

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ PROJECT_NAME = "Cesium for Unity"
4848
# could be handy for archiving the generated documentation or if some version
4949
# control system is used.
5050

51-
PROJECT_NUMBER =
51+
PROJECT_NUMBER = $(npm_package_version)
5252

5353
# Using the PROJECT_BRIEF tag one can provide an optional one line description
5454
# for a project that appears at the top of each page and should give viewer a
5555
# quick idea about the purpose of the project. Keep the description short.
5656

57-
PROJECT_BRIEF = "Unlock the 3D geospatial ecosystem in Unity with real-world 3D content and a high accuracy full-scale WGS84 globe."
57+
PROJECT_BRIEF =
5858

5959
# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
6060
# in the documentation. The maximum height of the logo should not exceed 55
@@ -372,7 +372,7 @@ TOC_INCLUDE_HEADINGS = 5
372372
# The default value is: DOXYGEN.
373373
# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
374374

375-
MARKDOWN_ID_STYLE = DOXYGEN
375+
MARKDOWN_ID_STYLE = GITHUB
376376

377377
# When enabled doxygen tries to link words that correspond to documented
378378
# classes, or namespaces to their corresponding documentation. Such a link can
@@ -390,7 +390,7 @@ AUTOLINK_SUPPORT = YES
390390
# diagrams that involve STL classes more complete and accurate.
391391
# The default value is: NO.
392392

393-
BUILTIN_STL_SUPPORT = NO
393+
BUILTIN_STL_SUPPORT = YES
394394

395395
# If you use Microsoft's C++/CLI language, you should set this option to YES to
396396
# enable parsing support.
@@ -943,7 +943,10 @@ WARN_LOGFILE =
943943
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
944944
# Note: If this tag is empty the current directory is searched.
945945

946-
INPUT = ./Runtime
946+
INPUT = ./Runtime \
947+
./Documentation~/ \
948+
./README.md \
949+
./Reinterop~/README.md
947950

948951
# This tag can be used to specify the character encoding of the source files
949952
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
@@ -1093,7 +1096,7 @@ EXAMPLE_RECURSIVE = NO
10931096
# that contain images that are to be included in the documentation (see the
10941097
# \image command).
10951098

1096-
IMAGE_PATH =
1099+
IMAGE_PATH =
10971100

10981101
# The INPUT_FILTER tag can be used to specify a program that doxygen should
10991102
# invoke to filter for each input file. Doxygen will invoke the filter program
@@ -1154,7 +1157,7 @@ FILTER_SOURCE_PATTERNS =
11541157
# (index.html). This can be useful if you have a project on for instance GitHub
11551158
# and want to reuse the introduction page also for the doxygen output.
11561159

1157-
USE_MDFILE_AS_MAINPAGE =
1160+
USE_MDFILE_AS_MAINPAGE = ./README.md
11581161

11591162
# The Fortran standard specifies that for fixed formatted Fortran code all
11601163
# characters from position 72 are to be considered as comment. A common
@@ -1176,7 +1179,7 @@ FORTRAN_COMMENT_AFTER = 72
11761179
# also VERBATIM_HEADERS is set to NO.
11771180
# The default value is: NO.
11781181

1179-
SOURCE_BROWSER = NO
1182+
SOURCE_BROWSER = YES
11801183

11811184
# Setting the INLINE_SOURCES tag to YES will include the body of functions,
11821185
# classes and enums directly into the documentation.
@@ -1393,7 +1396,7 @@ HTML_STYLESHEET =
13931396
# documentation.
13941397
# This tag requires that the tag GENERATE_HTML is set to YES.
13951398

1396-
HTML_EXTRA_STYLESHEET =
1399+
HTML_EXTRA_STYLESHEET = ./Documentation~/doxygen-awesome-css/doxygen-awesome.css
13971400

13981401
# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
13991402
# other source files which should be copied to the HTML output directory. Note
@@ -1416,7 +1419,7 @@ HTML_EXTRA_FILES =
14161419
# The default value is: AUTO_LIGHT.
14171420
# This tag requires that the tag GENERATE_HTML is set to YES.
14181421

1419-
HTML_COLORSTYLE = AUTO_LIGHT
1422+
HTML_COLORSTYLE = LIGHT
14201423

14211424
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
14221425
# will adjust the colors in the style sheet and background images according to
@@ -1717,7 +1720,7 @@ DISABLE_INDEX = NO
17171720
# The default value is: NO.
17181721
# This tag requires that the tag GENERATE_HTML is set to YES.
17191722

1720-
GENERATE_TREEVIEW = NO
1723+
GENERATE_TREEVIEW = YES
17211724

17221725
# When both GENERATE_TREEVIEW and DISABLE_INDEX are set to YES, then the
17231726
# FULL_SIDEBAR option determines if the side bar is limited to only the treeview
@@ -2455,14 +2458,14 @@ ALLEXTERNALS = NO
24552458
# listed.
24562459
# The default value is: YES.
24572460

2458-
EXTERNAL_GROUPS = YES
2461+
EXTERNAL_GROUPS = NO
24592462

24602463
# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in
24612464
# the related pages index. If set to NO, only the current project's pages will
24622465
# be listed.
24632466
# The default value is: YES.
24642467

2465-
EXTERNAL_PAGES = YES
2468+
EXTERNAL_PAGES = NO
24662469

24672470
#---------------------------------------------------------------------------
24682471
# Configuration options related to diagram generator tools

Documentation~/copy-images.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* Documentation for Cesium for Unity needs to exist under the Documentation~ folder,
3+
* as folders ending in ~ are ignored by Unity. However, this causes an issue with
4+
* Doxygen, as described here: https://github.com/doxygen/doxygen/issues/11273
5+
*
6+
* The solution to this is to avoid putting the images in Doxygen's `IMAGE_PATH`,
7+
* which triggers the issue, instead copying them to the same relative directory as
8+
* the original image path in the Markdown files. The problem is that doing this from
9+
* the package.json script will cause issues with the difference between `cp` on Linux
10+
* and `copy` on Windows. Instead, we use this script to perform the copy operation
11+
* in a cross-platform way.
12+
*/
13+
const fs = require("fs");
14+
15+
fs.mkdirSync("./Reference/html/Documentation~/images", { recursive: true });
16+
const images = fs.readdirSync("./images");
17+
images.forEach(img => fs.copyFileSync("./images/" + img, "./Reference/html/Documentation~/images/" + img));
18+
console.log(`copied ${images.length} images to Documentation~/Reference/html`);

Documentation~/creating-monobehaviours.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Creating MonoBehaviours {#creating-monobehaviours}
2+
13
Guidelines and tips for creating MonoBehaviours in Cesium for Unity.
24

35
## Avoid implementing non-static methods in C++
@@ -25,11 +27,11 @@ If you don't need C++-specific state, static methods are _much_ more efficient.
2527

2628
Carefully consider every field that you add to the class. In general, only the essential fields necessary to reconstruct the state of the object should by marked `[SerializeField]`. Cached and derived fields should instead be marked `[NonSerialized]`. Fields without any attribute should be extremely rare.
2729

28-
| *Characteristic* | *`[SerializeField]`* | *No attribute* | *`[NonSerialized]`* |
29-
|-------------------------------|----------------------|--------------|-------------------|
30-
| Saved / Loaded with the Scene ||||
31-
| Preserved on script change / AppDomain reload ||||
32-
| Transfers from Edit mode to Play mode ||||
30+
| *Characteristic* | *`[SerializeField]`* | *No attribute* | *`[NonSerialized]`* |
31+
| --------------------------------------------- | -------------------- | -------------- | ------------------- |
32+
| Saved / Loaded with the Scene | | | |
33+
| Preserved on script change / AppDomain reload | | | |
34+
| Transfers from Edit mode to Play mode | | | |
3335

3436
## Backward compatibility
3537

Documentation~/developer-resources.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Developer Resources {#developer-resources}
2+
3+
- \subpage developer-setup
4+
- \subpage reinterop
5+
- \subpage creating-monobehaviours
6+
- \subpage release-guide

Documentation~/developer-setup.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
# Overview
1+
# Developer Setup {#developer-setup}
22

33
This is a summary of the setup and workflows for developers who want to modify the Cesium for Unity plugin. If you just want to use Cesium for Unity in your own applications, see the main [README](../README.md).
4+
<!--! [TOC] -->
45

5-
## :computer: Building Cesium for Unity
6+
## 🖥️ Building Cesium for Unity
67

78
### Prerequisites
89

@@ -38,7 +39,7 @@ git clone --recurse-submodules git@github.com:CesiumGS/cesium-unity.git com.cesi
3839

3940
Be sure to also clone the submodules. If you forgot the `--recurse-submodules` option when you cloned, run `git submodule update --init --recursive` inside the `com.cesium.unity` folder.
4041

41-
## Reinterop
42+
## Reinterop {#reinterop-guide}
4243

4344
Reinterop is a Roslyn (C# compiler) source generator that is automatically invoked by Unity while compiling the Cesium for Unity C# code, and generates C# <-> C++ interop layer.
4445

Documentation~/doxygen-awesome-css

Submodule doxygen-awesome-css added at af1d903

Documentation~/release-guide.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
# Releasing a new version of Cesium for Unity
1+
# Releasing a new version of Cesium for Unity {#release-guide}
22

33
This is the process we follow when releasing a new version of Cesium for Unity on GitHub.
4+
<!--! [TOC] -->
45

56
## Test the release candidate
67

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,36 @@ Cesium for Unity enables building 3D geospatial applications and experiences wit
44

55
[Cesium for Unity Homepage](https://cesium.com/platform/cesium-for-unity?utm_source=github&utm_medium=github&utm_campaign=unity)
66

7-
### :rocket: Get Started
7+
### 🚀 Get Started
88

99
**[Download Cesium for Unity Samples](https://github.com/CesiumGS/cesium-unity-samples/releases/latest)**
1010

1111
**[Follow the Quickstart](https://cesium.com/learn/unity/unity-quickstart/)**
1212

1313
Have questions? Ask them on the [community forum](https://community.cesium.com/c/cesium-for-unity).
1414

15-
### :clap: Featured Demos
15+
### 👏 Featured Demos
1616

17-
<a href="https://github.com/CesiumGS/cesium-unity-samples"><img src="Documentation~/images/cesium-for-unity-screenshot.jpg" width="48%" title="Cesium for Unity Samples" /></a>
17+
[![](Documentation~/images/cesium-for-unity-screenshot.jpg)](https://github.com/CesiumGS/cesium-unity-samples)
1818

19-
### :house_with_garden: Cesium for Unity and the 3D Geospatial Ecosystem
19+
### 🏡 Cesium for Unity and the 3D Geospatial Ecosystem
2020

2121
Cesium for Unity streams real-world 3D content such as high-resolution photogrammetry, terrain, imagery, and 3D buildings from [Cesium ion](https://cesium.com/cesium-ion) and other sources, available as optional commercial subscriptions. The plugin includes Cesium ion integration for instant access to global high-resolution 3D content ready for runtime streaming. Cesium ion users can also leverage cloud-based 3D tiling pipelines to create end-to-end workflows to transform massive heterogenous content into semantically-rich 3D Tiles, ready for streaming to Unity.
2222

2323
Cesium for Unity supports cloud and private network content and services based on open standards and APIs. You are free to use any combination of supported content sources, standards, APIs with Cesium for Unity.
2424

25-
![Cesium for Unity Architecture](./Documentation~/images/integration-workflow_Unity.png)
25+
![Cesium for Unity Architecture](Documentation~/images/integration-workflow_Unity.png)
2626

27-
Using Cesium ion helps support Cesium for Unity development. :heart:
27+
Using Cesium ion helps support Cesium for Unity development. ❤️
2828

29-
### :chains: Unity Integration
29+
### ⛓️ Unity Integration
3030

3131
Cesium for Unity is tightly integrated with Unity making it possible to visualize and interact with real-world content in editor and at runtime. The plugin also has support for Unity game objects, physics, collisions, and character interaction. Leverage decades worth of cutting-edge advancements in Unity and geospatial to create cohesive, interactive, and realistic simulations and applications with Cesium for Unity.
3232

33-
### :green_book: License
33+
### 📗 License
3434

3535
[Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.html). Cesium for Unity is free for both commercial and non-commercial use.
3636

37-
### :computer: Developing Cesium for Unity
37+
### 🖥️ Developing Cesium for Unity
3838

3939
See the [Developer Setup Guide](Documentation~/developer-setup.md) to learn how to set up a development environment for Cesium for Unity, allowing you to compile it, customize it, and contribute to its development.

Reinterop~/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
# Reinterop
1+
# Reinterop {#reinterop}
22

33
Reinterop generates C# and C++ code to allow a .NET library to be seamlessly used from C++ code.
4+
<!--! [TOC] -->
45

56
**Note: Reinterop currently requires the latest preview version of Visual Studio 2022, because it uses C# 11 / .NET 7. However, the generated code can be used almost anywhere, including in Unity's version of Mono.**
67

Runtime/CesiumPropertyTable.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ public Dictionary<String, CesiumMetadataValue> GetMetadataValuesForFeature(Int64
103103
/// If the feature ID is out-of-bounds, the returned dictionary will be empty.
104104
/// </para>
105105
/// </remarks>
106+
/// <param name="values">The dictionary of values that will be cleared and filled by this method.</param>
106107
/// <param name="featureId">The ID of the feature.</param>
107-
/// <returns>A dictionary of the property values mapped by property name.</returns>
108108
public void GetMetadataValuesForFeature(Dictionary<String, CesiumMetadataValue> values, Int64 featureId)
109109
{
110110
values.Clear();

Runtime/CesiumSimplePlanarEllipsoidCurve.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public static CesiumSimplePlanarEllipsoidCurve FromEarthCenteredEarthFixedCoordi
2525
/// Creates a new <see cref="CesiumSimplePlanarEllipsoidCurve"/> object from a pair of
2626
/// Ellipsoid-Centered, Ellipsoid-Fixed coordinates describing the beginning and end points of the curve.
2727
/// </summary>
28+
/// <param name="ellipsoid">The ellipsoid to use for this curve.</param>
2829
/// <param name="sourceEcef">The start point of the curve.</param>
2930
/// <param name="destinationEcef">The end point of the curve.</param>
3031
/// <returns>
@@ -46,6 +47,7 @@ public static CesiumSimplePlanarEllipsoidCurve FromCenteredFixedCoordinates(Cesi
4647
/// Creates a new <see cref="CesiumSimplePlanarEllipsoidCurve"/> object from a pair of cartographic
4748
/// coordinates (Longitude, Latitude, and Height) describing the beginning and end points of the curve.
4849
/// </summary>
50+
/// <param name="ellipsoid">The ellipsoid to use for this curve.</param>
4951
/// <param name="sourceLlh">The start point of the curve.</param>
5052
/// <param name="destinationLlh">The end point of the curve.</param>
5153
/// <returns>

native~/Runtime/src/UnityPrepareRendererResources.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,15 @@ void generateMipMaps(
268268
const Sampler* pSampler =
269269
Model::getSafe(&pModel->samplers, pTexture->sampler);
270270
if (pImage && pSampler) {
271+
// We currently do not support shared resources, so if this image is
272+
// associated with a depot, unshare it. This is necessary to avoid a
273+
// race condition where multiple threads attempt to generate mipmaps for
274+
// the same shared image simultaneously.
275+
if (pImage->pAsset && pImage->pAsset->getDepot()) {
276+
// Copy the asset.
277+
pImage->pAsset.emplace(*pImage->pAsset);
278+
}
279+
271280
switch (pSampler->minFilter.value_or(
272281
CesiumGltf::Sampler::MinFilter::LINEAR_MIPMAP_LINEAR)) {
273282
case CesiumGltf::Sampler::MinFilter::LINEAR_MIPMAP_LINEAR:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"url": "https://cesium.com"
1212
},
1313
"scripts": {
14-
"doxygen": "doxygen ./Documentation~/Doxyfile"
14+
"doxygen": "doxygen ./Documentation~/Doxyfile && cd Documentation~ && node copy-images.js && cd .."
1515
},
1616
"changelogUrl": "https://github.com/CesiumGS/cesium-unity/blob/main/CHANGES.md",
1717
"documentationUrl": "https://cesium.com/learn/unity/",

0 commit comments

Comments
 (0)