Make game viewport authority runtime-neutral

This commit is contained in:
Meta Vens 2026-07-05 19:56:18 +01:00
commit 911bb72f69
45 changed files with 424 additions and 369 deletions

View file

@ -1,4 +1,4 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
@ -250,10 +250,10 @@ public class VolumeSampling : MonoBehaviour
: Vector2.zero;
}
private static AetheriaRuntimeRtsViewportBounds BuildViewportBounds(Vector2 center, Vector2 size)
private static AetheriaRuntimeViewportBounds BuildViewportBounds(Vector2 center, Vector2 size)
{
var halfSize = size * 0.5f;
return new AetheriaRuntimeRtsViewportBounds
return new AetheriaRuntimeViewportBounds
{
MinX = center.x - halfSize.x,
MinY = center.y - halfSize.y,

View file

@ -120,7 +120,7 @@ public class ZoneRenderer : MonoBehaviour
Array.Empty<AetheriaRuntimeZoneRenderAsteroidBeltPose>();
private IReadOnlyList<AetheriaRuntimeBodySnapshotCommit> _zoneRenderBodies =
Array.Empty<AetheriaRuntimeBodySnapshotCommit>();
private AetheriaUnityRtsViewportDocuments _zonePresentationDocuments;
private AetheriaUnityGameViewportDocuments _zonePresentationDocuments;
public Dictionary<int, (GameObject gravity, CompassIcon icon)> WormholeInstances = new Dictionary<int, (GameObject, CompassIcon)>();
private List<ItemPickup> _loot = new List<ItemPickup>();
@ -768,9 +768,9 @@ public class ZoneRenderer : MonoBehaviour
center.y + range);
}
private static AetheriaRuntimeRtsViewportBounds ToViewportBounds(AetheriaRuntimeXzRect viewport)
private static AetheriaRuntimeViewportBounds ToViewportBounds(AetheriaRuntimeXzRect viewport)
{
return new AetheriaRuntimeRtsViewportBounds
return new AetheriaRuntimeViewportBounds
{
MinX = viewport.MinX,
MinY = viewport.MinZ,
@ -892,7 +892,7 @@ public class ZoneRenderer : MonoBehaviour
if (!TryCollectDaemonPresentationEntityIndicesFromSoa(viewport))
{
var objects = ResolveObjectsViewport(viewport);
foreach (var entity in objects?.Objects ?? Array.Empty<AetheriaRuntimeRtsViewportObject>())
foreach (var entity in objects?.Objects ?? Array.Empty<AetheriaRuntimeViewportObject>())
{
if (entity != null && entity.EntityIndex >= 0)
_daemonPresentationEntityIndices.Add(entity.EntityIndex);