2026-07-10 02:27:47 +01:00
using System ;
using System.Collections.Generic ;
2026-07-13 21:35:11 +01:00
using System.Linq ;
2026-07-15 17:12:11 +01:00
using GameCult.Eve.PluginFields ;
2026-07-10 02:27:47 +01:00
using GameCult.Eve.Surface ;
using GameCult.Mesh ;
#nullable enable
namespace GameCult.Eve.UnityScene
{
public sealed class EveUnitySceneSurfaceLowerer
{
private static readonly SaiVisualNovelUnitySceneProjectionAdapter SaiVisualNovelAdapter = new SaiVisualNovelUnitySceneProjectionAdapter ( ) ;
private static readonly NornGraphUnitySceneProjectionAdapter NornGraphAdapter = new NornGraphUnitySceneProjectionAdapter ( ) ;
private static readonly TeXMathUnitySceneProjectionAdapter TeXMathAdapter = new TeXMathUnitySceneProjectionAdapter ( ) ;
public EveUnitySceneProjection Lower (
EveSurfaceDocument document ,
EveUnitySceneProviderSurfaceAdvertisement advertisedSurface )
{
if ( document = = null ) throw new ArgumentNullException ( nameof ( document ) ) ;
if ( advertisedSurface = = null ) throw new ArgumentNullException ( nameof ( advertisedSurface ) ) ;
if ( ! string . Equals ( document . Surface . Id , advertisedSurface . SurfaceId , StringComparison . Ordinal ) )
{
throw new InvalidOperationException (
$"Active surface '{document.Surface.Id}' does not match advertised Unity scene surface '{advertisedSurface.SurfaceId}'." ) ;
}
return new EveUnitySceneProjection (
document . ProviderId ,
document . Surface . Id ,
advertisedSurface . WorldInteraction . ProjectionKind ,
advertisedSurface . WorldInteraction . CommandBoundary ,
advertisedSurface . WorldInteraction . ReceiptSchema ,
advertisedSurface . WorldInteraction . Ownership ,
BuildPlayableWorld ( document . Surface . Root ) ,
BuildSceneGraph ( document . Surface . Root ) ) ;
}
public EveSurfaceCommandRequest CreateCommandIntent (
EveSurfaceDocument document ,
EveUnitySceneProviderSurfaceAdvertisement advertisedSurface ,
string command ,
IReadOnlyDictionary < string , string > ? payload = null ,
DateTimeOffset ? issuedAt = null )
{
if ( document = = null ) throw new ArgumentNullException ( nameof ( document ) ) ;
if ( advertisedSurface = = null ) throw new ArgumentNullException ( nameof ( advertisedSurface ) ) ;
if ( string . IsNullOrWhiteSpace ( command ) ) throw new ArgumentException ( "Command is required." , nameof ( command ) ) ;
var projection = Lower ( document , advertisedSurface ) ;
return new EveSurfaceCommandRequest (
projection . ProviderId ,
projection . SurfaceId ,
2026-07-10 05:05:27 +01:00
ResolveOperation ( document , command , $"unity-scene-{Guid.NewGuid():N}" ) ,
2026-07-10 02:27:47 +01:00
CultMesh . OperationPayload ( payload ? ? new Dictionary < string , string > ( StringComparer . Ordinal ) ) ,
issuedAt ? ? DateTimeOffset . UtcNow ,
"unity-scene" ,
projection . CommandBoundary ,
projection . ReceiptSchema ) ;
}
private static CultMeshOperationInvocationDescriptor ResolveOperation (
EveSurfaceDocument document ,
2026-07-10 05:05:27 +01:00
string command ,
string idempotencyKey )
2026-07-10 02:27:47 +01:00
{
foreach ( var template in document . Commands )
{
if ( string . Equals ( template . Command , command , StringComparison . Ordinal ) )
2026-07-10 05:05:27 +01:00
return CultMesh . OperationInvocation ( template . Operation , idempotencyKey ) ;
2026-07-10 02:27:47 +01:00
}
2026-07-10 05:05:27 +01:00
return CultMesh . OperationInvocation ( command , idempotencyKey : idempotencyKey ) ;
2026-07-10 02:27:47 +01:00
}
private static EveUnitySceneNode BuildSceneGraph ( EveSurfaceComponent component )
{
var children = new List < EveUnitySceneNode > ( component . Children . Count ) ;
foreach ( var child in component . Children )
{
children . Add ( BuildSceneGraph ( child ) ) ;
}
return new EveUnitySceneNode (
component . Id ,
component . Kind ,
SceneObjectKind ( component . Kind ) ,
component . Props ,
component . Layout ,
component . Style ,
component . StateBindings . Count ,
component . EmbeddedDocuments . Count ,
BuildEmbeddedDocumentSlots ( component . EmbeddedDocuments ) ,
BuildPluginProjection ( component ) ,
children ) ;
}
private static EveUnityPlayableWorldProjection ? BuildPlayableWorld ( EveSurfaceComponent root )
{
2026-07-11 00:51:31 +01:00
var worldRoot = FindFirst ( root , component = > IsWorldScene ( component . Kind ) ) ;
2026-07-10 02:27:47 +01:00
if ( worldRoot = = null )
return null ;
var entities = new List < EveUnityPlayableWorldEntity > ( ) ;
2026-07-15 17:12:11 +01:00
var fieldVolumes = new List < EveUnityFieldVolumeProjection > ( ) ;
2026-07-16 12:23:00 +01:00
var fieldParticles = new List < EveUnityFieldParticlesProjection > ( ) ;
2026-07-10 02:27:47 +01:00
foreach ( var component in Flatten ( worldRoot ) )
{
if ( string . Equals ( component . Kind , "world.entity3d" , StringComparison . Ordinal ) )
entities . Add ( BuildPlayableEntity ( component ) ) ;
2026-07-15 17:12:11 +01:00
else if ( string . Equals ( component . Kind , "field.volume3d" , StringComparison . Ordinal ) )
fieldVolumes . Add ( BuildFieldVolume ( component ) ) ;
2026-07-16 12:23:00 +01:00
else if ( string . Equals ( component . Kind , "field.particles3d" , StringComparison . Ordinal ) )
fieldParticles . Add ( BuildFieldParticles ( component ) ) ;
2026-07-10 02:27:47 +01:00
}
return new EveUnityPlayableWorldProjection (
worldRoot . Id ,
worldRoot . GetProp ( "statePointerId" , worldRoot . GetProp ( "worldStatePointerId" ) ) ,
worldRoot . GetProp ( "assetManifest" , worldRoot . GetProp ( "assetManifestUri" ) ) ,
worldRoot . GetProp ( "inputProfile" ) ,
worldRoot . GetProp ( "cameraRig" ) ,
2026-07-12 02:21:59 +01:00
worldRoot . GetProp ( "viewId" ) ,
2026-07-10 02:27:47 +01:00
worldRoot . GetProp ( "playerEntityId" ) ,
worldRoot . GetProp ( "movementCommand" ) ,
worldRoot . GetProp ( "focusCommand" ) ,
worldRoot . GetProp ( "targetCommand" ) ,
worldRoot . GetProp ( "actionCommand" ) ,
2026-07-12 11:58:08 +01:00
entities ,
worldRoot . GetProp ( "entityViewPointerId" ) ,
worldRoot . GetProp ( "entityViewSchema" ) ,
2026-07-19 03:18:35 +01:00
worldRoot . GetProp ( "entityBodyId" ) ,
2026-07-12 11:58:08 +01:00
worldRoot . GetProp ( "zoneRenderPointerId" ) ,
2026-07-13 21:35:11 +01:00
worldRoot . GetProp ( "zoneRenderSchema" ) ,
2026-07-15 05:06:29 +01:00
ParseStringList ( worldRoot . GetProp ( "excludedRenderChannels" ) ) ,
worldRoot . GetProp ( "cameraTargetEntityId" ) ,
ParseFloat ( worldRoot . GetProp ( "cameraDistance" ) , 0f ) ,
ParseFloat ( worldRoot . GetProp ( "cameraVerticalFieldOfViewDegrees" ) , 0f ) ,
ParseFloat ( worldRoot . GetProp ( "cameraTargetScreenX" ) , 0.5f ) ,
ParseFloat ( worldRoot . GetProp ( "cameraTargetScreenY" ) , 0.5f ) ,
ParseFloat ( worldRoot . GetProp ( "cameraPositionDamping" ) , 0f ) ,
ParseVector3 ( worldRoot . GetProp ( "ambientLightColor" ) ) ,
2026-07-15 05:15:50 +01:00
ParseFloat ( worldRoot . GetProp ( "ambientLightIntensity" ) , 1f ) ,
ParseFloat ( worldRoot . GetProp ( "cameraNearClipPlane" ) , 0f ) ,
2026-07-15 05:55:53 +01:00
ParseFloat ( worldRoot . GetProp ( "cameraFarClipPlane" ) , 0f ) ,
worldRoot . GetProp ( "lookCommand" ) ,
2026-07-15 06:08:45 +01:00
ParseFloat ( worldRoot . GetProp ( "lookSensitivityRadians" ) , 0f ) ,
2026-07-15 06:34:39 +01:00
worldRoot . GetProp ( "lookModel" ) ,
worldRoot . GetProp ( "skyboxAssetRef" ) ,
worldRoot . GetProp ( "reflectionAssetRef" ) ,
2026-07-15 08:36:03 +01:00
ParseFloat ( worldRoot . GetProp ( "reflectionIntensity" ) , 1f ) ,
2026-07-16 00:16:52 +01:00
worldRoot . GetProp ( "postProcessProfileAssetRef" ) ,
2026-07-15 08:36:03 +01:00
ParseVector3 ( worldRoot . GetProp ( "keyLightDirection" ) ) ,
ParseVector3 ( worldRoot . GetProp ( "keyLightColor" ) ) ,
2026-07-15 17:12:11 +01:00
ParseFloat ( worldRoot . GetProp ( "keyLightIntensity" ) , 0f ) ,
2026-07-15 22:05:25 +01:00
fieldVolumes ,
2026-07-16 12:23:00 +01:00
worldRoot . GetProp ( "cameraLookAt" ) ,
2026-07-16 17:44:29 +01:00
fieldParticles ,
worldRoot . GetProp ( "cameraReconstruction" ) ,
worldRoot . GetProp ( "temporalQuality" , "high" ) ,
ParseFloat ( worldRoot . GetProp ( "temporalHistoryBlend" ) , 0f ) ,
ParseFloat ( worldRoot . GetProp ( "temporalJitterScale" ) , 0f ) ,
2026-07-16 19:51:25 +01:00
ParseFloat ( worldRoot . GetProp ( "temporalSharpening" ) , 0f ) ,
worldRoot . GetProp ( "exposureMode" ) ,
ParseFloat ( worldRoot . GetProp ( "exposureLowPercent" ) , 50f ) ,
ParseFloat ( worldRoot . GetProp ( "exposureHighPercent" ) , 95f ) ,
ParseFloat ( worldRoot . GetProp ( "exposureMinimumEv" ) , 0f ) ,
ParseFloat ( worldRoot . GetProp ( "exposureMaximumEv" ) , 0f ) ,
ParseFloat ( worldRoot . GetProp ( "exposureKeyValue" ) , 1f ) ,
worldRoot . GetProp ( "exposureAdaptation" , "progressive" ) ,
ParseFloat ( worldRoot . GetProp ( "exposureSpeedUp" ) , 2f ) ,
2026-07-16 20:49:22 +01:00
ParseFloat ( worldRoot . GetProp ( "exposureSpeedDown" ) , 1f ) ,
2026-08-19 07:31:25 +02:00
worldRoot . GetProp ( "colorGradingSpace" ) ,
worldRoot . GetProp ( "assetProviderId" ) ,
worldRoot . GetProp ( "assetVerseId" ) ,
worldRoot . GetProp ( "assetAuthorityRuntimeId" ) ,
ParseStringList ( worldRoot . GetProp ( "assetRendezvousEndpoints" ) ) ) ;
2026-07-10 02:27:47 +01:00
}
2026-07-15 17:12:11 +01:00
private static EveUnityFieldVolumeProjection BuildFieldVolume ( EveSurfaceComponent component ) = >
new EveUnityFieldVolumeProjection (
component . Id ,
component . GetProp ( "documentRef" ) ,
component . GetProp ( "documentSchema" , EveFieldsSchemas . Splats ) ,
component . GetProp ( "materialAssetRef" ) ,
component . GetProp ( "renderChannel" , "world.transparent" ) ,
component . GetProp ( "compositeMode" , "premultiplied-alpha" ) ,
component . GetProp ( "quality" , "normal" ) ,
component . Props ) ;
2026-07-16 12:23:00 +01:00
private static EveUnityFieldParticlesProjection BuildFieldParticles ( EveSurfaceComponent component ) = >
new EveUnityFieldParticlesProjection (
component . Id ,
component . GetProp ( "documentRef" ) ,
component . GetProp ( "documentSchema" , EveFieldsSchemas . Splats ) ,
component . GetProp ( "computeProgramAssetRef" ) ,
component . GetProp ( "materialAssetRef" ) ,
component . GetProp ( "renderChannel" , "world.transparent" ) ,
component . Props ) ;
2026-07-10 02:27:47 +01:00
private static EveUnityPlayableWorldEntity BuildPlayableEntity ( EveSurfaceComponent component )
{
var position = ParseVector3 ( component . GetProp ( "position" ) ) ;
return new EveUnityPlayableWorldEntity (
component . Id ,
component . GetProp ( "entityId" , component . Id ) ,
component . GetProp ( "entityKind" , component . GetProp ( "kind" ) ) ,
component . GetProp ( "label" , component . GetProp ( "name" ) ) ,
component . GetProp ( "faction" ) ,
component . GetProp ( "assetRef" , component . GetProp ( "meshRef" , component . GetProp ( "prefabRef" ) ) ) ,
position . x ,
position . y ,
position . z ,
ParseFloat ( component . GetProp ( "rotationY" , component . GetProp ( "yaw" ) ) , 0f ) ,
ParseFloat ( component . GetProp ( "radius" ) , 0f ) ,
ParseBoolean ( component . GetProp ( "selectable" ) ) ,
ParseBoolean ( component . GetProp ( "controllable" ) ) ,
component . GetProp ( "focusCommand" ) ,
component . GetProp ( "moveCommand" ) ,
component . GetProp ( "targetCommand" ) ,
2026-07-12 02:21:59 +01:00
component . GetProp ( "actionCommand" ) ,
component . Props ) ;
2026-07-10 02:27:47 +01:00
}
private static EveSurfaceComponent ? FindFirst (
EveSurfaceComponent component ,
Predicate < EveSurfaceComponent > predicate )
{
if ( predicate ( component ) )
return component ;
foreach ( var child in component . Children )
{
var found = FindFirst ( child , predicate ) ;
if ( found ! = null )
return found ;
}
return null ;
}
private static IEnumerable < EveSurfaceComponent > Flatten ( EveSurfaceComponent component )
{
yield return component ;
foreach ( var child in component . Children )
{
foreach ( var nested in Flatten ( child ) )
yield return nested ;
}
}
private static ( float x , float y , float z ) ParseVector3 ( string value )
{
var parts = ( value ? ? "" ) . Split ( ',' ) ;
return (
parts . Length > 0 ? ParseFloat ( parts [ 0 ] , 0f ) : 0f ,
parts . Length > 1 ? ParseFloat ( parts [ 1 ] , 0f ) : 0f ,
parts . Length > 2 ? ParseFloat ( parts [ 2 ] , 0f ) : 0f ) ;
}
private static float ParseFloat ( string value , float fallback )
{
return float . TryParse ( value , System . Globalization . NumberStyles . Float , System . Globalization . CultureInfo . InvariantCulture , out var parsed )
? parsed
: fallback ;
}
private static bool ParseBoolean ( string value )
{
return string . Equals ( value , "true" , StringComparison . OrdinalIgnoreCase ) | |
string . Equals ( value , "1" , StringComparison . Ordinal ) ;
}
2026-07-13 21:35:11 +01:00
private static IReadOnlyList < string > ParseStringList ( string value )
{
return ( value ? ? "" )
2026-08-26 20:36:38 +02:00
. Split ( new [ ] { ',' , ';' } , StringSplitOptions . RemoveEmptyEntries )
2026-07-13 21:35:11 +01:00
. Select ( part = > part . Trim ( ) )
. Where ( part = > ! string . IsNullOrWhiteSpace ( part ) )
. Distinct ( StringComparer . Ordinal )
. ToArray ( ) ;
}
2026-07-10 02:27:47 +01:00
private static EveUnityScenePluginProjection ? BuildPluginProjection ( EveSurfaceComponent component )
{
if ( SaiVisualNovelAdapter . CanProject ( component ) )
return SaiVisualNovelAdapter . Project ( component ) ;
if ( NornGraphAdapter . CanProject ( component ) )
return NornGraphAdapter . Project ( component ) ;
if ( TeXMathAdapter . CanProject ( component ) )
return TeXMathAdapter . Project ( component ) ;
return null ;
}
private static IReadOnlyList < EveUnitySceneEmbeddedDocumentSlot > BuildEmbeddedDocumentSlots (
IReadOnlyList < EveEmbeddedDocumentSlot > embeddedDocuments )
{
var slots = new List < EveUnitySceneEmbeddedDocumentSlot > ( embeddedDocuments . Count ) ;
foreach ( var slot in embeddedDocuments )
{
slots . Add ( new EveUnitySceneEmbeddedDocumentSlot (
slot . SlotId ,
slot . DocumentId ,
slot . SchemaId ,
slot . PresentationKind ) ) ;
}
return slots ;
}
private static string SceneObjectKind ( string componentKind )
{
if ( string . IsNullOrWhiteSpace ( componentKind ) )
return "empty" ;
2026-07-11 00:51:31 +01:00
if ( IsWorldScene ( componentKind ) )
2026-07-10 02:27:47 +01:00
return "playable-world-root" ;
if ( string . Equals ( componentKind , "world.entity3d" , StringComparison . Ordinal ) )
return "playable-world-entity" ;
if ( string . Equals ( componentKind , "field.vector3d" , StringComparison . Ordinal ) | |
string . Equals ( componentKind , "field.scalar3d" , StringComparison . Ordinal ) )
return "world-field-3d" ;
if ( string . Equals ( componentKind , "vn.stage" , StringComparison . Ordinal ) )
return "sai-vn-scene-stage" ;
if ( string . Equals ( componentKind , "panel.dialogue" , StringComparison . Ordinal ) | |
string . Equals ( componentKind , "text.dialogue" , StringComparison . Ordinal ) )
return "sai-vn-scene-dialogue" ;
if ( string . Equals ( componentKind , "rail.actions" , StringComparison . Ordinal ) )
return "sai-vn-scene-action-rail" ;
if ( componentKind . StartsWith ( "control." , StringComparison . Ordinal ) )
return "command-control" ;
if ( string . Equals ( componentKind , "embed.norn" , StringComparison . Ordinal ) )
return "norn-graph-scene-projection" ;
if ( string . Equals ( componentKind , "embed.tex" , StringComparison . Ordinal ) )
return "tex-math-scene-projection" ;
if ( componentKind . StartsWith ( "embed." , StringComparison . Ordinal ) )
return "plugin-placeholder" ;
if ( string . Equals ( componentKind , "surface.slot" , StringComparison . Ordinal ) )
return "embedded-surface-slot" ;
if ( componentKind . StartsWith ( "world." , StringComparison . Ordinal ) | |
componentKind . StartsWith ( "field." , StringComparison . Ordinal ) )
return "world-projection-node" ;
if ( componentKind . StartsWith ( "text." , StringComparison . Ordinal ) | | string . Equals ( componentKind , "label" , StringComparison . Ordinal ) )
return "scene-label" ;
return "scene-node" ;
}
2026-07-11 00:51:31 +01:00
private static bool IsWorldScene ( string componentKind )
{
return string . Equals ( componentKind , "world.scene3d" , StringComparison . Ordinal ) | |
string . Equals ( componentKind , "world.scene2d" , StringComparison . Ordinal ) ;
}
2026-07-10 02:27:47 +01:00
}
public sealed class EveUnitySceneProjection
{
public EveUnitySceneProjection (
string providerId ,
string surfaceId ,
string projectionKind ,
string commandBoundary ,
string receiptSchema ,
string ownership ,
EveUnityPlayableWorldProjection ? playableWorld ,
EveUnitySceneNode root )
{
ProviderId = providerId ? ? "" ;
SurfaceId = surfaceId ? ? "" ;
ProjectionKind = projectionKind ? ? "" ;
CommandBoundary = commandBoundary ? ? "" ;
ReceiptSchema = receiptSchema ? ? "" ;
Ownership = ownership ? ? "" ;
PlayableWorld = playableWorld ;
Root = root ? ? throw new ArgumentNullException ( nameof ( root ) ) ;
}
public string ProviderId { get ; }
public string SurfaceId { get ; }
public string ProjectionKind { get ; }
public string CommandBoundary { get ; }
public string ReceiptSchema { get ; }
public string Ownership { get ; }
public EveUnityPlayableWorldProjection ? PlayableWorld { get ; }
public EveUnitySceneNode Root { get ; }
}
public sealed class EveUnityPlayableWorldProjection
{
public EveUnityPlayableWorldProjection (
string worldRootId ,
string statePointerId ,
string assetManifest ,
string inputProfile ,
string cameraRig ,
2026-07-12 02:21:59 +01:00
string viewId ,
2026-07-10 02:27:47 +01:00
string playerEntityId ,
string movementCommand ,
string focusCommand ,
string targetCommand ,
string actionCommand ,
2026-07-12 11:58:08 +01:00
IReadOnlyList < EveUnityPlayableWorldEntity > entities ,
string entityViewPointerId = "" ,
string entityViewSchema = "" ,
2026-07-19 03:18:35 +01:00
string entityBodyId = "" ,
2026-07-12 11:58:08 +01:00
string zoneRenderPointerId = "" ,
2026-07-13 21:35:11 +01:00
string zoneRenderSchema = "" ,
2026-07-15 05:06:29 +01:00
IReadOnlyList < string > ? excludedRenderChannels = null ,
string cameraTargetEntityId = "" ,
float cameraDistance = 0f ,
float cameraVerticalFieldOfViewDegrees = 0f ,
float cameraTargetScreenX = 0.5f ,
float cameraTargetScreenY = 0.5f ,
float cameraPositionDamping = 0f ,
( float r , float g , float b ) ambientLightColor = default ,
2026-07-15 05:15:50 +01:00
float ambientLightIntensity = 1f ,
float cameraNearClipPlane = 0f ,
2026-07-15 05:55:53 +01:00
float cameraFarClipPlane = 0f ,
string lookCommand = "" ,
2026-07-15 06:08:45 +01:00
float lookSensitivityRadians = 0f ,
2026-07-15 06:34:39 +01:00
string lookModel = "" ,
string skyboxAssetRef = "" ,
string reflectionAssetRef = "" ,
2026-07-15 08:36:03 +01:00
float reflectionIntensity = 1f ,
2026-07-16 00:16:52 +01:00
string postProcessProfileAssetRef = "" ,
2026-07-15 08:36:03 +01:00
( float x , float y , float z ) keyLightDirection = default ,
( float r , float g , float b ) keyLightColor = default ,
2026-07-15 17:12:11 +01:00
float keyLightIntensity = 0f ,
2026-07-15 22:05:25 +01:00
IReadOnlyList < EveUnityFieldVolumeProjection > ? fieldVolumes = null ,
2026-07-16 12:23:00 +01:00
string cameraLookAt = "" ,
2026-07-16 17:44:29 +01:00
IReadOnlyList < EveUnityFieldParticlesProjection > ? fieldParticles = null ,
string cameraReconstruction = "" ,
string temporalQuality = "high" ,
float temporalHistoryBlend = 0f ,
float temporalJitterScale = 0f ,
2026-07-16 19:51:25 +01:00
float temporalSharpening = 0f ,
string exposureMode = "" ,
float exposureLowPercent = 50f ,
float exposureHighPercent = 95f ,
float exposureMinimumEv = 0f ,
float exposureMaximumEv = 0f ,
float exposureKeyValue = 1f ,
string exposureAdaptation = "progressive" ,
float exposureSpeedUp = 2f ,
2026-07-16 20:49:22 +01:00
float exposureSpeedDown = 1f ,
2026-08-19 07:31:25 +02:00
string colorGradingSpace = "" ,
string assetProviderId = "" ,
string assetVerseId = "" ,
string assetAuthorityRuntimeId = "" ,
IReadOnlyList < string > ? assetRendezvousEndpoints = null )
2026-07-10 02:27:47 +01:00
{
WorldRootId = worldRootId ? ? "" ;
StatePointerId = statePointerId ? ? "" ;
AssetManifest = assetManifest ? ? "" ;
InputProfile = inputProfile ? ? "" ;
CameraRig = cameraRig ? ? "" ;
2026-07-12 02:21:59 +01:00
ViewId = viewId ? ? "" ;
2026-07-10 02:27:47 +01:00
PlayerEntityId = playerEntityId ? ? "" ;
MovementCommand = movementCommand ? ? "" ;
FocusCommand = focusCommand ? ? "" ;
TargetCommand = targetCommand ? ? "" ;
ActionCommand = actionCommand ? ? "" ;
Entities = entities ? ? Array . Empty < EveUnityPlayableWorldEntity > ( ) ;
2026-07-12 11:58:08 +01:00
EntityViewPointerId = entityViewPointerId ? ? "" ;
EntityViewSchema = entityViewSchema ? ? "" ;
2026-07-19 03:18:35 +01:00
EntityBodyId = entityBodyId ? ? "" ;
2026-07-12 11:58:08 +01:00
ZoneRenderPointerId = zoneRenderPointerId ? ? "" ;
ZoneRenderSchema = zoneRenderSchema ? ? "" ;
2026-07-13 21:35:11 +01:00
ExcludedRenderChannels = excludedRenderChannels ? ? Array . Empty < string > ( ) ;
2026-07-15 05:06:29 +01:00
CameraTargetEntityId = cameraTargetEntityId ? ? "" ;
CameraDistance = cameraDistance ;
CameraVerticalFieldOfViewDegrees = cameraVerticalFieldOfViewDegrees ;
CameraTargetScreenX = cameraTargetScreenX ;
CameraTargetScreenY = cameraTargetScreenY ;
CameraPositionDamping = cameraPositionDamping ;
AmbientLightR = ambientLightColor . r ;
AmbientLightG = ambientLightColor . g ;
AmbientLightB = ambientLightColor . b ;
AmbientLightIntensity = ambientLightIntensity ;
2026-07-15 05:15:50 +01:00
CameraNearClipPlane = cameraNearClipPlane ;
CameraFarClipPlane = cameraFarClipPlane ;
2026-07-15 05:55:53 +01:00
LookCommand = lookCommand ? ? "" ;
LookSensitivityRadians = lookSensitivityRadians ;
2026-07-15 06:08:45 +01:00
LookModel = lookModel ? ? "" ;
2026-07-15 06:34:39 +01:00
SkyboxAssetRef = skyboxAssetRef ? ? "" ;
ReflectionAssetRef = reflectionAssetRef ? ? "" ;
ReflectionIntensity = reflectionIntensity ;
2026-07-16 00:16:52 +01:00
PostProcessProfileAssetRef = postProcessProfileAssetRef ? ? "" ;
2026-07-15 08:36:03 +01:00
KeyLightDirectionX = keyLightDirection . x ;
KeyLightDirectionY = keyLightDirection . y ;
KeyLightDirectionZ = keyLightDirection . z ;
KeyLightColorR = keyLightColor . r ;
KeyLightColorG = keyLightColor . g ;
KeyLightColorB = keyLightColor . b ;
KeyLightIntensity = keyLightIntensity ;
2026-07-15 17:12:11 +01:00
FieldVolumes = fieldVolumes ? ? Array . Empty < EveUnityFieldVolumeProjection > ( ) ;
2026-07-16 12:23:00 +01:00
FieldParticles = fieldParticles ? ? Array . Empty < EveUnityFieldParticlesProjection > ( ) ;
2026-07-15 22:05:25 +01:00
CameraLookAt = cameraLookAt ? ? "" ;
2026-07-16 17:44:29 +01:00
CameraReconstruction = cameraReconstruction ? ? "" ;
TemporalQuality = temporalQuality ? ? "" ;
TemporalHistoryBlend = temporalHistoryBlend ;
TemporalJitterScale = temporalJitterScale ;
TemporalSharpening = temporalSharpening ;
2026-07-16 19:51:25 +01:00
ExposureMode = exposureMode ? ? "" ;
ExposureLowPercent = exposureLowPercent ;
ExposureHighPercent = exposureHighPercent ;
ExposureMinimumEv = exposureMinimumEv ;
ExposureMaximumEv = exposureMaximumEv ;
ExposureKeyValue = exposureKeyValue ;
ExposureAdaptation = exposureAdaptation ? ? "" ;
ExposureSpeedUp = exposureSpeedUp ;
ExposureSpeedDown = exposureSpeedDown ;
2026-07-16 20:49:22 +01:00
ColorGradingSpace = colorGradingSpace ? ? "" ;
2026-08-19 07:31:25 +02:00
AssetProviderId = assetProviderId ? ? "" ;
AssetVerseId = assetVerseId ? ? "" ;
AssetAuthorityRuntimeId = assetAuthorityRuntimeId ? ? "" ;
AssetRendezvousEndpoints = assetRendezvousEndpoints ? ? Array . Empty < string > ( ) ;
2026-07-10 02:27:47 +01:00
}
public string WorldRootId { get ; }
public string StatePointerId { get ; }
2026-07-12 11:58:08 +01:00
public string EntityViewPointerId { get ; }
public string EntityViewSchema { get ; }
2026-07-19 03:18:35 +01:00
public string EntityBodyId { get ; }
2026-07-12 11:58:08 +01:00
public string ZoneRenderPointerId { get ; }
public string ZoneRenderSchema { get ; }
2026-07-10 02:27:47 +01:00
public string AssetManifest { get ; }
2026-08-19 07:31:25 +02:00
public string AssetProviderId { get ; }
public string AssetVerseId { get ; }
public string AssetAuthorityRuntimeId { get ; }
public IReadOnlyList < string > AssetRendezvousEndpoints { get ; }
2026-07-10 02:27:47 +01:00
public string InputProfile { get ; }
public string CameraRig { get ; }
2026-07-15 05:06:29 +01:00
public string CameraTargetEntityId { get ; }
2026-07-15 22:05:25 +01:00
public string CameraLookAt { get ; }
2026-07-16 17:44:29 +01:00
public string CameraReconstruction { get ; }
public string TemporalQuality { get ; }
public float TemporalHistoryBlend { get ; }
public float TemporalJitterScale { get ; }
public float TemporalSharpening { get ; }
2026-07-16 19:51:25 +01:00
public string ExposureMode { get ; }
2026-07-16 20:49:22 +01:00
public string ColorGradingSpace { get ; }
2026-07-16 19:51:25 +01:00
public float ExposureLowPercent { get ; }
public float ExposureHighPercent { get ; }
public float ExposureMinimumEv { get ; }
public float ExposureMaximumEv { get ; }
public float ExposureKeyValue { get ; }
public string ExposureAdaptation { get ; }
public float ExposureSpeedUp { get ; }
public float ExposureSpeedDown { get ; }
2026-07-15 05:06:29 +01:00
public float CameraDistance { get ; }
public float CameraVerticalFieldOfViewDegrees { get ; }
public float CameraTargetScreenX { get ; }
public float CameraTargetScreenY { get ; }
public float CameraPositionDamping { get ; }
2026-07-15 05:15:50 +01:00
public float CameraNearClipPlane { get ; }
public float CameraFarClipPlane { get ; }
2026-07-15 05:06:29 +01:00
public float AmbientLightR { get ; }
public float AmbientLightG { get ; }
public float AmbientLightB { get ; }
public float AmbientLightIntensity { get ; }
2026-07-12 02:21:59 +01:00
public string ViewId { get ; }
2026-07-10 02:27:47 +01:00
public string PlayerEntityId { get ; }
public string MovementCommand { get ; }
2026-07-15 05:55:53 +01:00
public string LookCommand { get ; }
public float LookSensitivityRadians { get ; }
2026-07-15 06:08:45 +01:00
public string LookModel { get ; }
2026-07-15 06:34:39 +01:00
public string SkyboxAssetRef { get ; }
public string ReflectionAssetRef { get ; }
public float ReflectionIntensity { get ; }
2026-07-16 00:16:52 +01:00
public string PostProcessProfileAssetRef { get ; }
2026-07-15 08:36:03 +01:00
public float KeyLightDirectionX { get ; }
public float KeyLightDirectionY { get ; }
public float KeyLightDirectionZ { get ; }
public float KeyLightColorR { get ; }
public float KeyLightColorG { get ; }
public float KeyLightColorB { get ; }
public float KeyLightIntensity { get ; }
2026-07-10 02:27:47 +01:00
public string FocusCommand { get ; }
public string TargetCommand { get ; }
public string ActionCommand { get ; }
2026-07-13 21:35:11 +01:00
public IReadOnlyList < string > ExcludedRenderChannels { get ; }
2026-07-10 02:27:47 +01:00
public int EntityCount = > Entities . Count ;
public IReadOnlyList < EveUnityPlayableWorldEntity > Entities { get ; }
2026-07-15 17:12:11 +01:00
public IReadOnlyList < EveUnityFieldVolumeProjection > FieldVolumes { get ; }
2026-07-16 12:23:00 +01:00
public IReadOnlyList < EveUnityFieldParticlesProjection > FieldParticles { get ; }
2026-07-15 17:12:11 +01:00
}
public sealed class EveUnityFieldVolumeProjection
{
public EveUnityFieldVolumeProjection (
string nodeId ,
string documentRef ,
string documentSchema ,
string materialAssetRef ,
string renderChannel ,
string compositeMode ,
string quality ,
IReadOnlyDictionary < string , string > ? props = null )
{
NodeId = nodeId ? ? "" ;
DocumentRef = documentRef ? ? "" ;
DocumentSchema = documentSchema ? ? "" ;
MaterialAssetRef = materialAssetRef ? ? "" ;
RenderChannel = renderChannel ? ? "" ;
CompositeMode = compositeMode ? ? "" ;
Quality = quality ? ? "" ;
Props = props ? ? new Dictionary < string , string > ( StringComparer . Ordinal ) ;
}
public string NodeId { get ; }
public string DocumentRef { get ; }
public string DocumentSchema { get ; }
public string MaterialAssetRef { get ; }
public string RenderChannel { get ; }
public string CompositeMode { get ; }
public string Quality { get ; }
public IReadOnlyDictionary < string , string > Props { get ; }
2026-07-10 02:27:47 +01:00
}
2026-07-16 12:23:00 +01:00
public sealed class EveUnityFieldParticlesProjection
{
public EveUnityFieldParticlesProjection (
string nodeId ,
string documentRef ,
string documentSchema ,
string computeProgramAssetRef ,
string materialAssetRef ,
string renderChannel ,
IReadOnlyDictionary < string , string > ? props = null )
{
NodeId = nodeId ? ? "" ;
DocumentRef = documentRef ? ? "" ;
DocumentSchema = documentSchema ? ? "" ;
ComputeProgramAssetRef = computeProgramAssetRef ? ? "" ;
MaterialAssetRef = materialAssetRef ? ? "" ;
RenderChannel = renderChannel ? ? "" ;
Props = props ? ? new Dictionary < string , string > ( StringComparer . Ordinal ) ;
}
public string NodeId { get ; }
public string DocumentRef { get ; }
public string DocumentSchema { get ; }
public string ComputeProgramAssetRef { get ; }
public string MaterialAssetRef { get ; }
public string RenderChannel { get ; }
public IReadOnlyDictionary < string , string > Props { get ; }
2026-07-10 02:27:47 +01:00
}
public sealed class EveUnityPlayableWorldEntity
{
public EveUnityPlayableWorldEntity (
string nodeId ,
string entityId ,
string entityKind ,
string label ,
string faction ,
string assetRef ,
float positionX ,
float positionY ,
float positionZ ,
float rotationY ,
float radius ,
bool selectable ,
bool controllable ,
string focusCommand ,
string moveCommand ,
string targetCommand ,
2026-07-12 02:21:59 +01:00
string actionCommand ,
IReadOnlyDictionary < string , string > ? props = null )
2026-07-10 02:27:47 +01:00
{
NodeId = nodeId ? ? "" ;
EntityId = entityId ? ? "" ;
EntityKind = entityKind ? ? "" ;
Label = label ? ? "" ;
Faction = faction ? ? "" ;
AssetRef = assetRef ? ? "" ;
PositionX = positionX ;
PositionY = positionY ;
PositionZ = positionZ ;
RotationY = rotationY ;
Radius = radius ;
Selectable = selectable ;
Controllable = controllable ;
FocusCommand = focusCommand ? ? "" ;
MoveCommand = moveCommand ? ? "" ;
TargetCommand = targetCommand ? ? "" ;
ActionCommand = actionCommand ? ? "" ;
2026-07-12 02:21:59 +01:00
Props = props ? ? new Dictionary < string , string > ( StringComparer . Ordinal ) ;
2026-07-10 02:27:47 +01:00
}
public string NodeId { get ; }
public string EntityId { get ; }
public string EntityKind { get ; }
public string Label { get ; }
public string Faction { get ; }
public string AssetRef { get ; }
public float PositionX { get ; }
public float PositionY { get ; }
public float PositionZ { get ; }
public float RotationY { get ; }
public float Radius { get ; }
public bool Selectable { get ; }
public bool Controllable { get ; }
public string FocusCommand { get ; }
public string MoveCommand { get ; }
public string TargetCommand { get ; }
public string ActionCommand { get ; }
2026-07-12 02:21:59 +01:00
public IReadOnlyDictionary < string , string > Props { get ; }
2026-07-10 02:27:47 +01:00
}
public sealed class EveUnitySceneNode
{
public EveUnitySceneNode (
string id ,
string componentKind ,
string sceneObjectKind ,
IReadOnlyDictionary < string , string > props ,
IReadOnlyDictionary < string , string > layout ,
IReadOnlyDictionary < string , string > style ,
int stateBindingCount ,
int embeddedDocumentCount ,
IReadOnlyList < EveUnitySceneEmbeddedDocumentSlot > embeddedDocuments ,
EveUnityScenePluginProjection ? pluginProjection ,
IReadOnlyList < EveUnitySceneNode > children )
{
Id = id ? ? "" ;
ComponentKind = componentKind ? ? "" ;
SceneObjectKind = sceneObjectKind ? ? "" ;
Props = props ? ? new Dictionary < string , string > ( StringComparer . Ordinal ) ;
Layout = layout ? ? new Dictionary < string , string > ( StringComparer . Ordinal ) ;
Style = style ? ? new Dictionary < string , string > ( StringComparer . Ordinal ) ;
StateBindingCount = stateBindingCount ;
EmbeddedDocumentCount = embeddedDocumentCount ;
EmbeddedDocuments = embeddedDocuments ? ? Array . Empty < EveUnitySceneEmbeddedDocumentSlot > ( ) ;
PluginProjection = pluginProjection ;
Children = children ? ? Array . Empty < EveUnitySceneNode > ( ) ;
}
public string Id { get ; }
public string ComponentKind { get ; }
public string SceneObjectKind { get ; }
public IReadOnlyDictionary < string , string > Props { get ; }
public IReadOnlyDictionary < string , string > Layout { get ; }
public IReadOnlyDictionary < string , string > Style { get ; }
public int StateBindingCount { get ; }
public int EmbeddedDocumentCount { get ; }
public IReadOnlyList < EveUnitySceneEmbeddedDocumentSlot > EmbeddedDocuments { get ; }
public EveUnityScenePluginProjection ? PluginProjection { get ; }
public IReadOnlyList < EveUnitySceneNode > Children { get ; }
}
public sealed class EveUnityScenePluginProjection
{
public EveUnityScenePluginProjection (
string pluginId ,
string projectionKind ,
string abiSchema ,
string commandBoundary ,
IReadOnlyList < string > capabilities ,
string command ,
string documentId ,
string semanticOwner )
{
PluginId = pluginId ? ? "" ;
ProjectionKind = projectionKind ? ? "" ;
AbiSchema = abiSchema ? ? "" ;
CommandBoundary = commandBoundary ? ? "" ;
Capabilities = capabilities ? ? Array . Empty < string > ( ) ;
Command = command ? ? "" ;
DocumentId = documentId ? ? "" ;
SemanticOwner = semanticOwner ? ? "" ;
}
public string PluginId { get ; }
public string ProjectionKind { get ; }
public string AbiSchema { get ; }
public string CommandBoundary { get ; }
public IReadOnlyList < string > Capabilities { get ; }
public string Command { get ; }
public string DocumentId { get ; }
public string SemanticOwner { get ; }
}
public sealed class EveUnitySceneEmbeddedDocumentSlot
{
public EveUnitySceneEmbeddedDocumentSlot (
string slotId ,
string documentId ,
string schemaId ,
string presentationKind )
{
SlotId = slotId ? ? "" ;
DocumentId = documentId ? ? "" ;
SchemaId = schemaId ? ? "" ;
PresentationKind = presentationKind ? ? "" ;
}
public string SlotId { get ; }
public string DocumentId { get ; }
public string SchemaId { get ; }
public string PresentationKind { get ; }
}
public sealed class EveUnitySceneProviderSurfaceAdvertisement
{
public EveUnitySceneProviderSurfaceAdvertisement (
string surfaceId ,
string surfaceKind ,
EveUnitySceneWorldInteraction worldInteraction )
{
SurfaceId = surfaceId ? ? "" ;
SurfaceKind = surfaceKind ? ? "" ;
WorldInteraction = worldInteraction ? ? throw new ArgumentNullException ( nameof ( worldInteraction ) ) ;
}
public string SurfaceId { get ; }
public string SurfaceKind { get ; }
public EveUnitySceneWorldInteraction WorldInteraction { get ; }
}
public sealed class EveUnitySceneWorldInteraction
{
public EveUnitySceneWorldInteraction (
string projectionKind ,
string commandBoundary ,
string receiptSchema ,
string ownership )
{
ProjectionKind = projectionKind ? ? "" ;
CommandBoundary = commandBoundary ? ? "" ;
ReceiptSchema = receiptSchema ? ? "" ;
Ownership = ownership ? ? "" ;
}
public string ProjectionKind { get ; }
public string CommandBoundary { get ; }
public string ReceiptSchema { get ; }
public string Ownership { get ; }
}
}