LOD.h
Source/MassBattle/Public/Fragments/LOD.h
概述 Overview
LOD 配置体系:单级配置 FLODData、固定 5 级容器 FLODsData(按屏幕尺寸降序,Data0 = 最近/最高细节)、逻辑 LOD 占位 FLogicLODData、以及共享片段 FLODShared(同一原型的 Agent 共享同一份实例,按值去重)。渲染(视觉)LOD 与未来的逻辑/TickRate LOD 分离。
LOD configuration system: single-level FLODData, fixed 5-level container FLODsData (ordered by decreasing screen size, Data0 = nearest/highest detail), logic-LOD placeholder FLogicLODData, and the shared fragment FLODShared (agents of the same archetype share one instance, deduplicated by value). Render (visual) LOD is separated from the future logic/tickrate LOD.
FLODData USTRUCT
单级 LOD 配置(普通 USTRUCT,非 fragment)。定义一级 LOD 的屏幕尺寸阈值、表现模式、Mesh LOD 层级与动画融合层级。
Single LOD level configuration (plain USTRUCT, not a fragment). Defines the screen-size threshold, representation mode, mesh LOD index and animation blend level for one LOD band.
成员变量 Members
| 名称 Name | 类型 Type | 默认值 | 说明 Description |
|---|---|---|---|
ScreenSize | float | -1 | 屏幕尺寸阈值(0–1)。Screen size threshold (0–1). |
Representation | ERepresentationMode | Particle | 表现模式:粒子+VAT 或 Actor,枚举定义于 MassBattleEnums.h。Representation mode: Particle+VAT or Actor; enum defined in MassBattleEnums.h. |
LODIndex | int32 | -1 | VAT Mesh LOD 层级(0–4)。仅 Representation == Particle 时可编辑。VAT Mesh LOD index (0–4). Editable only when Representation == Particle. |
AnimBlendLevel | int32 | 2 | 该 VAT 使用的动画融合层级(1–3)。仅粒子模式时可编辑。Animation blend level this VAT uses (1–3). Editable only in Particle mode. |
方法 Methods
四个字段全部相等时视为相同——供容器去重与共享片段值比较。
Equal only when all four fields match — used for container dedup and shared-fragment value comparison.
Input
无参数(成员方法,隐式 this)。
No parameters (member method, implicit this).
Output
返回四字段全等结果。
Returns the four-field equality result.
FLODsData USTRUCT
固定 5 级 LOD 数据容器(普通 USTRUCT)。每个 Data 槽代表一级 LOD,按屏幕尺寸降序排列(Data0 = 最近/最高细节)。
Fixed 5-level LOD data container (plain USTRUCT). Each Data slot represents one LOD band, ordered by decreasing screen size (Data0 = nearest/highest detail).
成员变量 Members
| 名称 Name | 类型 Type | 默认值 | 说明 Description |
|---|---|---|---|
Data0 | FLODData | — | LOD 0 配置(最近/最高细节)。LOD 0 configuration (nearest/highest detail). |
Data1 | FLODData | — | LOD 1 配置。LOD 1 configuration. |
Data2 | FLODData | — | LOD 2 配置。LOD 2 configuration. |
Data3 | FLODData | — | LOD 3 配置。LOD 3 configuration. |
Data4 | FLODData | — | LOD 4 配置(最远/最低细节)。LOD 4 configuration (farthest/lowest detail). |
方法 Methods
五个槽位逐一相等时视为相同。
Equal only when all five slots match.
Input
无参数(成员方法)。
No parameters (member method).
Output
返回五槽全等结果。
Returns the five-slot equality result.
FLogicLODData USTRUCT
逻辑/TickRate LOD 占位结构体(普通 USTRUCT)。当前为空——开发中;未来将保存每级 LOD 的 Tick 频率、感知更新速率与行为节流配置。operator== 恒返回 true(空结构)。
Logic/TickRate LOD placeholder struct (plain USTRUCT). Currently empty — under development; it will hold per-LOD tick frequency, sensor update rate and behavior throttling config. operator== always returns true (empty struct).
管线角色 Pipeline Role
grep 验证:FLODShared / FLODsData 被 MassBattleAgentRenderProcessor(按屏幕尺寸选择 LOD 级并切换表现)与 MassBattleAgentSubsystem(模板构建时创建共享实例)引用。
Verified by grep: FLODShared / FLODsData are referenced by MassBattleAgentRenderProcessor (picks the LOD level by screen size and switches representation) and MassBattleAgentSubsystem (creates the shared instance at template build).