UMassBattleAgentMoveProcessor
Source/MassBattle/Public/Processors/MassBattleAgentMoveProcessor.h
概述Overview
单位移动处理器(浮点精度):逐帧推进期望速度、交通规则、避障解算与位置积分。由插件自动调度,无需配置;移动的全部可调参数都在兵种 DataAsset 的移动/避障/交通面板上。
The unit-movement processor (float precision): advances desired velocity, traffic rules, avoidance and position integration every frame. Auto-scheduled by the plugin; every tunable movement knob lives on the unit DataAsset's move / avoidance / traffic panels.
FEllipseParams — 椭圆避让参数FEllipseParams — Ellipse Avoidance Parameters
按方向伸缩的避让半径:避让范围不是圆,而是沿 MajorDir 拉长的椭圆,让单位在行进方向上留出更多间距。三个字段全部由处理器在解算时构造,属于运行时数据,没有需要作者调整的配置项。
A direction-dependent avoidance radius: the avoidance footprint is an ellipse stretched along MajorDir instead of a circle, so a unit keeps more clearance along its travel direction. All three fields are built by the processor at solve time; runtime data only, with nothing for an author to configure.
成员变量Members
| 名称Name | 类型Type | 默认值Default | 说明Description |
|---|---|---|---|
SemiMajor | float | 0.f | 椭圆半长轴,沿 MajorDir 量取。Semi-major axis, measured along MajorDir. |
SemiMinor | float | 0.f | 椭圆半短轴,垂直于 MajorDir。Semi-minor axis, perpendicular to MajorDir. |
MajorDir | FVector2f | FVector2f::ZeroVector | 2D 移动平面上的长轴方向。Major-axis direction in the 2D movement plane. |
FForecastDriveSpeeds — 预判驱动速度FForecastDriveSpeeds — Forecast Drive Speeds
一对预判的驱动速度,供「对齐到路径 / 对齐到移动方向」在必须倒车时比较正反两个方向,决定本帧按前进还是倒车驱动。
A pair of forecast drive speeds used by the align-to-path / align-to-movement behaviours to compare the forward and reverse options when the agent has to back up, deciding which one drives the frame.
成员变量Members
| 名称Name | 类型Type | 默认值Default | 说明Description |
|---|---|---|---|
Forward | float | 0.f | 预判的前进驱动速度。Forecast forward drive speed. |
Reverse | float | 0.f | 预判的倒车驱动速度。Forecast reverse drive speed. |
FSceneObstRVOData — 场景障碍的避让数据FSceneObstRVOData — Scene Obstacle Avoidance Data
场景障碍在避让求解中的表示,由一次场景射线命中构造:构造函数 FSceneObstRVOData(const FHitResult&, const FVector&) 从命中结果与单位位置一次填满四个字段。场上的静态几何最终都以这种形式进入求解。
The avoidance solver's view of a scene obstacle, built from a scene trace hit: the constructor FSceneObstRVOData(const FHitResult&, const FVector&) fills all four fields at once from the hit result and the agent location. Static geometry enters the solver in this form.
成员变量Members
| 名称Name | 类型Type | 默认值Default | 说明Description |
|---|---|---|---|
ClosestPoint | FVector | FVector::ZeroVector | 命中点,即障碍物表面上离单位最近的位置。Impact point — the closest position on the obstacle surface. |
Normal | FVector | FVector::ForwardVector | 命中面的法线。Surface normal at the impact. |
DistSqr | float | 0.0f | 单位位置到命中点的平方距离。Squared distance from the agent location to the impact point. |
Distance | float | 0.0f | 射线报告出的命中距离。Hit distance reported by the trace. |
FOrcaLine — ORCA 约束线FOrcaLine — ORCA Constraint Line
ORCA 线性规划输入的一条有向 2D 线:point 是线上一点,direction 是线方向。求解器把这些线当作约束,在它们围出的可行域里找速度解。
One directed 2D line fed to the ORCA linear program: point is a point on the line and direction is the line direction. The solver treats these lines as constraints and looks for a velocity inside the region they enclose.
成员变量Members
| 名称Name | 类型Type | 默认值Default | 说明Description |
|---|---|---|---|
point | FVector2f | FVector2f::ZeroVector | 线上的一点。A point on the line. |
direction | FVector2f | FVector2f::ZeroVector | 线的方向。Direction of the line. |
FWallConstraint — 统一墙约束FWallConstraint — Unified Wall Constraint
PBD 与 ORCA 两条求解路径共用的墙约束。它只表达平面约束:线段、盒体、场景几何等每一种障碍都先归约成「最近点 + 相对单位的法线」,于是两个求解器不必按障碍种类分别处理。
The wall constraint shared by the PBD and ORCA solver paths. It expresses a plane constraint only: every obstacle kind — segments, boxes, scene geometry — is reduced to a closest point plus an agent-relative normal, so both solvers handle them uniformly instead of branching on obstacle type.
成员变量Members
| 名称Name | 类型Type | 默认值Default | 说明Description |
|---|---|---|---|
ClosestPoint | FVector2f | FVector2f::ZeroVector | 障碍物上离单位最近的 2D 点。Closest 2D point on the obstacle. |
Normal | FVector2f | FVector2f::ZeroVector | 相对单位的 2D 法线。Agent-relative 2D normal. |
DistanceSq | float | 0.f | 单位到最近点的平方距离。Squared distance from the agent to the closest point. |
bIsTouching | bool | false | 本帧该约束是否处于接触状态。Whether this constraint is in contact this frame. |
FTrafficEncounter — 交通遭遇分类缓存FTrafficEncounter — Traffic Encounter Classification Cache
对每个已收集的邻居保留一份交通规则共用的几何量:分类时算一次,各条规则按同一邻居下标读取,不再各自重算同一批点积。字段用的正是规则原本内联计算的表达式,所以读缓存与直接计算逐值一致。数组按邻居下标平行索引,只有在分类步骤跑过之后才有效。
Holds the geometry shared by the traffic rules for each gathered neighbour: computed once during classification and then read by every rule through the same neighbour index, instead of having each rule recompute the same dots. The fields use the exact expressions the rules used to compute inline, so the cached path is value-identical. The array is indexed parallel to the neighbour array and is valid only after the classification step has run.
成员变量Members
| 名称Name | 类型Type | 默认值Default | 说明Description |
|---|---|---|---|
RelPosLenSq | float | 0.f | 两单位中心之间的平方距离。Squared distance between the two centres. |
HeadingDot | float | 2.f | 归一化后的自身期望速度与邻居期望速度的点积。哨兵值 2.0 表示无效(任一方期望速度约等于零),读取前必须跳过这类邻居。Normalized dot of self desired velocity with the neighbour's. The sentinel 2.0 means invalid (either desired velocity is near zero); such neighbours must be skipped before reading. |
ApproachDot | float | 2.f | 归一化后的邻居期望速度与相对位置的点积。哨兵值 2.0 表示无效。Normalized dot of the neighbour's desired velocity with the relative position. The sentinel 2.0 means invalid. |
ForwardDot | float | 0.f | 自身期望速度与相对位置的点积(未归一化);大于零表示邻居在自身前方。Self desired velocity dotted with the relative position (unnormalized); greater than zero means the neighbour is ahead of self. |
CrossHeadOn | float | 0.f | cross(自身期望速度, 相对位置):大于零表示邻居在自身左侧,应向右(顺时针)避让。cross(self desired velocity, relative position): greater than zero means the neighbour is on self's left, so steer right (clockwise). |
CrossSide | float | 0.f | 侧移判定用:cross(-邻居期望速度, 相对位置),大于零表示自身位于邻居的左侧。Sidestep test: cross(-neighbour desired velocity, relative position); greater than zero means self is on the neighbour's left. |
bWillReachSelf | bool | false | 邻居剩余路径能否触及自身的避让椭圆;否则邻居会先停下。Whether the neighbour's remaining path reaches self's avoidance ellipse; otherwise it stops first. |
bAttackerFiltered | bool | false | 该邻居对是否被攻击者豁免过滤跳掉;所有规则必须跳得一致。Whether the pair was skipped by the attacker bypass filter; every rule must skip it identically. |
Yield | float | 0.5f | 自身在这一对里承担的避让责任份额,取值 [0,1]。分类时算一次,机动幅度加权与 ORCA 求解的责任比例读同一个数。Self's avoidance-responsibility share for the pair, in [0,1]. Computed once during classification; the maneuver-magnitude weighting and the ORCA solver's responsibility ratio both read this single number. |
EffRank | int32 | 0 | 这一对里邻居的有效交通优先级(已发布优先级的镜像,缓存下来统一读取);变道、侧移与其它速度规则读它。只在分类跑过之后有效。The neighbour's effective traffic rank for this pair (a mirror of the published rank, cached for uniform consumption); lane-shift, sidestep and other-velocity rules read it. Valid only after classification has run. |
FAgentMoveScratchContext — 逐单位暂存上下文FAgentMoveScratchContext — Per-Agent Scratch Context
移动处理器的工作暂存区。这些缓冲太大,不适合放进 fragment,因此按工作线程各持一份、跨单位复用容量,用 Reset() 清空内容并保留容量。它只在本次执行内存在,绝不序列化、绝不进快照。
The move processor's working scratch. These buffers are too large to live in a fragment, so each worker thread keeps its own copy and reuses capacity across agents, clearing contents with Reset() while keeping capacity. It exists only within the current execution and is never serialized or captured in a snapshot.
成员变量Members
| 名称Name | 类型Type | 默认值Default | 说明Description |
|---|---|---|---|
OrcaLines | TArray<FOrcaLine, TInlineAllocator<32>> | — | 本帧该单位的 ORCA 速度约束线集合。ORCA velocity constraint lines for this agent this frame. |
SeenAgents | TSet<int32> | — | 按 UniqueID 去重,避免同一邻居被重复计入。Deduplicates by UniqueID so the same neighbour is not counted twice. |
SeenObstacles | TSet<FMassEntityHandle> | — | 障碍物实体去重集合。Deduplication set for obstacle entities. |
AgentRVONeighbors | TArray<FCapsuleRVOData, TInlineAllocator<32>> | — | ORCA 的单位邻居列表(胶囊形状);内联容量 32,超出后回落到堆。ORCA agent neighbour list (capsule shape); inline capacity 32, falling back to the heap beyond that. |
CapsuleObstRVONeighbors | TArray<FCapsuleRVOData, TInlineAllocator<8>> | — | 胶囊形障碍的 ORCA 邻居。ORCA neighbours for capsule-shaped obstacles. |
SegmentObstRVONeighbors | TArray<FSegmentObstRVOData, TInlineAllocator<8>> | — | 线段形障碍的 ORCA 邻居。ORCA neighbours for segment-shaped obstacles. |
BoxObstRVONeighbors | TArray<FBoxObstRVOData, TInlineAllocator<8>> | — | 盒形障碍的 ORCA 邻居。ORCA neighbours for box-shaped obstacles. |
SceneObstRVONeighbors | TArray<FSceneObstRVOData, TInlineAllocator<8>> | — | 场景命中障碍的 ORCA 邻居。ORCA neighbours for scene-hit obstacles. |
bAnyForceHybridFFObst | bool | false | 任一收集到的障碍邻居带 bForceHybridFF 时为真。混合求解器据此本帧保持在力场模式,而不是在障碍接触时切到 ORCA。每帧重新判定,没有一帧滞后;仅存在于暂存区,绝不序列化。True when any gathered obstacle neighbour carries bForceHybridFF. The hybrid solver then keeps the frame in force-field mode instead of switching to ORCA on obstacle contact. Re-evaluated every frame with no one-frame lag; scratch-only and never serialized. |
WallConstraints | TArray<FWallConstraint, TInlineAllocator<32>> | — | 本帧墙约束列表,供 PBD 与 ORCA 共用。Wall constraints for this frame, shared by the PBD and ORCA paths. |
AgentPBDNeighbors | TArray<FAgentPBDData, TInlineAllocator<32>> | — | PBD 的单位邻居列表;预测的 XY 位置就存在 FAgentPBDData 里,没有单独的预测数组。PBD agent neighbour list; the predicted XY lives on FAgentPBDData, so there is no separate prediction array. |
CapsuleObstPBDNeighbors | TArray<FCapsulePBDData, TInlineAllocator<8>> | — | 胶囊形障碍的 PBD 邻居。PBD neighbours for capsule-shaped obstacles. |
SegmentObstPBDNeighbors | TArray<FSegmentPBDData, TInlineAllocator<8>> | — | 线段形障碍的 PBD 邻居。PBD neighbours for segment-shaped obstacles. |
BoxObstPBDNeighbors | TArray<FBoxObstPBDData, TInlineAllocator<8>> | — | 盒形障碍的 PBD 邻居。PBD neighbours for box-shaped obstacles. |
PBD_CA1 | TArray<FVector, TInlineAllocator<32>> | — | 单位邻居的 PBD 预计算最近点(第一组),迭代前填一次、每轮按自身位移修正。Pre-computed PBD closest points for agent neighbours (first set); filled once before the iteration loop, then adjusted per iteration by self displacement. |
PBD_CA2 | TArray<FVector, TInlineAllocator<32>> | — | 单位邻居的 PBD 预计算最近点(第二组),迭代中原样复用。Pre-computed PBD closest points for agent neighbours (second set), reused unchanged across iterations. |
PBD_CC1 | TArray<FVector, TInlineAllocator<8>> | — | 胶囊障碍的 PBD 预计算最近点(第一组)。Pre-computed PBD closest points for capsule obstacles (first set). |
PBD_CC2 | TArray<FVector, TInlineAllocator<8>> | — | 胶囊障碍的 PBD 预计算最近点(第二组)。Pre-computed PBD closest points for capsule obstacles (second set). |
PBD_CS1 | TArray<FVector, TInlineAllocator<8>> | — | 线段障碍的 PBD 预计算最近点(第一组)。Pre-computed PBD closest points for segment obstacles (first set). |
PBD_CS2 | TArray<FVector, TInlineAllocator<8>> | — | 线段障碍的 PBD 预计算最近点(第二组)。Pre-computed PBD closest points for segment obstacles (second set). |
ObstaclePlanes | TArray<FPlane, TInlineAllocator<8>> | — | 墙体与水平障碍平面——唯一实际被填充的平面列表,每个近距离阻挡场景命中都归约成这里的一个平面。Wall and horizontal obstacle planes — the only plane list that is actually filled; every close blocking scene hit becomes one plane here. |
GroundPlanes | TArray<FPlane, TInlineAllocator<8>> | — | 地面平面(朝上法线)。这一列表从不被填充,遍历它的求解阶段总是空转。Ground planes (upward normals). This list is never filled, so the solver stage that iterates it always runs empty. |
CeilingPlanes | TArray<FPlane, TInlineAllocator<8>> | — | 天花板平面(朝下法线)。同样从不被填充。Ceiling planes (downward normals). Also never filled. |
SceneHits | TArray<FHitResult> | — | 本帧场景检测结果。Scene trace results for this frame. |
LocalPatrolEvents | TArray<FPatrolData> | — | 巡逻子状态事件(由接受半径计算得出)。按块手动清空,Reset() 不碰它。Patrol substate events computed from the acceptance radius. Cleared manually per chunk; Reset() leaves it alone. |
LocalChaseEvents | TArray<FChaseData> | — | 追击子状态事件,同样按块手动清空。Chase substate events; also cleared manually per chunk. |
PatchPath | TArray<FVector> | — | 补丁路径暂存,跨单位复用。Patch-path scratch, reused across agents. |
bAgentNeighborsSorted | bool | false | 邻居列表本帧是否已排序。Whether the neighbour list has been sorted this frame. |
bSolverRangeCapped | bool | false | 求解器的探测距离是否已被制动距离上限截断;为假表示不跳过任何邻居,与不设上限时一致。Whether the solver's reach was capped by the braking-distance limit; false means no neighbour is skipped, matching an uncapped reach. |
SolverAgentDetectDist | float | 0.f | 截断后的求解器中心距上限;ORCA 循环跳过超出该距离的邻居,而远距离交通规则仍保留完整的邻居视野。The capped centre-distance limit for the solver; the ORCA loop skips neighbours beyond it while long-range traffic rules keep their full neighbour view. |
bSideStepObligationThisFrame | bool | false | 本帧的侧移义务:一个真正空闲的单位欠至少一名通过者一次清空步(缺口大于零)。解算后导出到 Moving.bCachedSideStepObligation,下一帧的返回准入读取它——侧移优先于返回。This frame's sidestep obligation: a genuinely idle agent owes at least one passer a clearance step (deficit greater than zero). Exported to Moving.bCachedSideStepObligation after the solve; the next frame's return admission reads it — sidestep outranks return. |
bFlankActiveThisFrame | bool | false | 本帧是否真的把侧翼旋转施加到了期望速度上(存在阻挡且旋转非零)。由侧翼偏置步骤写入,紧随解算前偏置之后的侧翼加速与场景接触收尾读取它。Whether a flank rotation was actually applied to the desired velocity this frame (blockers present and rotation non-zero). Written by the flank-bias step and read by the flank speed boost right after the pre-solve biases, and by the scene-contact clamp. |
bSelfFarReturning | bool | false | 自身正在返回且已越过远距离返回阈值(与网格发布同一套 2D 目标距离度量)。分类据此把自身排在战斗之下、移动之上。Self is returning and beyond the far-return threshold (the same 2D distance-to-goal measure used by the grid publication). Classification then ranks self below combat and above plain movement. |
TrafficEncounters | TArray<FTrafficEncounter, TInlineAllocator<32>> | — | 逐邻居的交通分类缓存,在解算前偏置之前由分类步骤填写;只有分类跑过时有效(门控:任一基于邻居的偏置规则开启)。Per-neighbour traffic classification cache, filled by the classification step just before the pre-solve biases; valid only when that ran (gate: any neighbour-based bias rule enabled). |
TrafficPathDir | FVector2f | FVector2f::ZeroVector | 归一化的路径切线。Normalized path tangent. |
TrafficPathRight | FVector2f | FVector2f::ZeroVector | 路径右向,由切线求得:(dir.Y, -dir.X)。Path right vector derived from the tangent: (dir.Y, -dir.X). |
TrafficSelfLateralFromPath | float | 0.f | 自身相对路径的横向偏移:-(PathRight · SelfToPathVec)。Self's lateral offset from the path: -(PathRight · SelfToPathVec). |
TrafficGoalForwardAlongPath | float | 0.f | PathDir · (Goal - Self);侧翼阻挡过滤用——只有目标落在阻挡者远边缘之外时,该阻挡者才计数。PathDir · (Goal - Self); used by the flank blocker filter — a blocker counts only when the goal lies beyond its far edge. |
TrafficSelfEffRank | int32 | 0 | 自身的交通优先级(分类输出),供侧移门控读取。Self's traffic rank (classification output), read by the sidestep gate. |
bTrafficPathValid | bool | false | 自身路径方向的长度平方大于一个极小值时,路径坐标系才被视为有效。The path frame counts as valid only when self's path direction has a length squared above a tiny threshold. |
bSceneTracePerformed | bool | false | 本帧是否已做过场景检测,避免 RVO 与 PBD 两条路径重复检测。Whether the scene trace already ran this frame, preventing the RVO and PBD paths from tracing twice. |
SupportZ | float | -FLT_MAX | 本帧找到的最高可行走支撑面的世界 Z。World Z of the highest walkable support surface found this frame. |
SupportNormal | FVector3f | FVector3f::UpVector | 该支撑面的法线。Normal of that support surface. |
SupportEntity | FEntityHandle | — | 支撑面来源实体,仅用于调试与归因。Entity the support surface came from; debug and attribution only. |
CeilingZ | float | FLT_MAX | 本帧最低天花板面的世界 Z。World Z of the lowest ceiling surface this frame. |
CeilingEntity | FEntityHandle | — | 天花板来源实体,仅用于调试与归因。Entity the ceiling came from; debug and attribution only. |
FPendingFlowFieldLoad — 待加载流场请求FPendingFlowFieldLoad — Pending Flow Field Load
排队等待解析的同步流场加载请求:记录哪一个单位要换用哪个流场。Execute 在自己的开头把队列排空,把软指针解析成实际对象再写回该单位的导航状态。
A queued synchronous flow-field load request: which agent wants which field. Execute drains the queue at its start, resolving the soft pointer to a live object before writing it back into that agent's navigation state.
成员变量Members
| 名称Name | 类型Type | 默认值Default | 说明Description |
|---|---|---|---|
Entity | FMassEntityHandle | — | 请求换用该流场的单位,解析结果只写给仍在活跃状态的单位。The agent requesting the field; the resolved result is written only while it is still active. |
SoftField | TSoftObjectPtr<AFlowField> | — | 要加载的流场的软引用,解析后写入单位的流场指针。Soft reference to the field to load; after resolution it becomes the agent's flow-field pointer. |
自由函数Free Functions
头文件在类之外还声明了一组自由函数,供移动解算的数学部分使用:一个 2D 叉积与 ORCA 线性规划的三个阶段。它们没有隐藏状态,输入就是全部依赖。
Beyond the class, the header declares a small set of free functions used by the movement math: one 2D cross product and the three stages of the ORCA linear program. They hold no hidden state; their inputs are their entire dependency set.
2D 叉积(行列式),返回 A.X * B.Y - A.Y * B.X。交通规则与侧移判定用它区分左右侧与朝向关系;按约定,结果大于零表示 B 位于 A 的左侧,FTrafficEncounter 里的几个叉积分量正是按这个约定解读的。
The 2D cross product (determinant), returning A.X * B.Y - A.Y * B.X. The traffic rules and sidestep tests use it to tell left from right and to relate headings; by convention a positive result means B lies to the left of A, which is how the cross terms in FTrafficEncounter are read.
Input
| 参数Param | 类型Type | 说明Description |
|---|---|---|
A | const FVector2f& | 第一个 2D 向量,作为叉积的左操作数。First 2D vector, the left operand of the cross product. |
B | const FVector2f& | 第二个 2D 向量,作为右操作数。Second 2D vector, the right operand. |
Output
返回标量叉积;符号表示相对左右关系,绝对值与两向量的长度乘积成正比。
Returns the scalar cross product; its sign encodes the left/right relation and its magnitude scales with the product of both vector lengths.
ORCA 线性规划第一阶段:在编号 LineNo 的单条约束线上求解一维线性规划,给定圆约束半径、最优速度与「只优化方向」开关,把解写入 Result。声明在头文件、实现在同名 .cpp 中,刻意不做内联。
First stage of the ORCA linear program: solves a one-dimensional program on the single constraint line numbered LineNo, given the circular constraint radius, the optimal velocity and a direction-only switch, writing the solution into Result. Declared in the header and defined in the matching .cpp, deliberately not inlined.
Input
| 参数Param | 类型Type | 说明Description |
|---|---|---|
Lines | const TArray<FOrcaLine, TInlineAllocator<32>>& | 全部约束线;本阶段只使用其中的第 LineNo 条。All constraint lines; this stage uses only line LineNo. |
LineNo | int32 | 要解的约束线下标。Index of the constraint line to solve on. |
Radius | float | 线性规划使用的求解半径。Solver radius used by the linear program. |
OptVelocity | const FVector2f& | 期望(最优)速度,求解沿着它靠近。The preferred (optimal) velocity the solution steers toward. |
bDirectionOpt | bool | 只优化方向、不优化长度时为真。True when only the direction is optimized, not the magnitude. |
Result | FVector2f& | 输出参数,接收本阶段求出的速度。Output parameter receiving the velocity solved by this stage. |
Output
返回该一维求解的布尔结果;解通过 Result 带出。无其它副作用。
Returns the boolean result of the 1D solve; the solution leaves through Result. No other side effects.
ORCA 线性规划第二阶段:在全部约束线与圆约束下求二维解。成功时返回约束线数量;失败时返回第一条失败线的下标——这个下标正是第三阶段 BeginLine 的输入,两个阶段靠它衔接。
Second stage of the ORCA linear program: solves the two-dimensional problem under all constraint lines plus the circular constraint. On success it returns the number of lines; on failure it returns the index of the first failing line, which is exactly the BeginLine input of the third stage.
Input
| 参数Param | 类型Type | 说明Description |
|---|---|---|
Lines | const TArray<FOrcaLine, TInlineAllocator<32>>& | 全部约束线,按求解顺序排列。All constraint lines, in solve order. |
Radius | float | 圆约束半径。Radius of the circular constraint. |
OptVelocity | const FVector2f& | 期望速度;可行时解尽量接近它。Preferred velocity; the solution stays as close to it as feasible. |
bDirectionOpt | bool | 只优化方向时为真。True when only the direction is optimized. |
Result | FVector2f& | 输出参数,接收二维解。Output parameter receiving the 2D solution. |
Output
成功返回约束线数量,失败返回失败线下标;解写入 Result。
Returns the line count on success or the failing line index on failure; the solution is written to Result.
ORCA 线性规划第三阶段:当第二阶段因某条约束不可行时,从 BeginLine 指定的线开始继续求解,把最终结果写回 Result。数组头部属于障碍物的线数由 NumObstLines 标出,求解时与单位之间的约束区分对待。
Third stage of the ORCA linear program: when the second stage fails on a particular constraint, solving continues from the line named by BeginLine and the final answer is written back to Result. NumObstLines marks how many lines at the head of the array come from obstacles, so they are handled apart from agent-to-agent constraints.
Input
| 参数Param | 类型Type | 说明Description |
|---|---|---|
Lines | const TArray<FOrcaLine, TInlineAllocator<32>>& | 全部约束线。All constraint lines. |
NumObstLines | int32 | 数组头部属于障碍物的约束线数量。Number of obstacle-derived lines at the head of the array. |
BeginLine | int32 | 重试的起始线下标,通常取第二阶段的失败下标。Index of the line where the retry starts, normally the failing index returned by the second stage. |
Radius | float | 圆约束半径。Radius of the circular constraint. |
Result | FVector2f& | 输入输出参数,最终解写入其中。In-out parameter that receives the final solution. |
Output
无返回值;最终速度写入 Result。
No return value; the final velocity is written into Result.
椭圆与避让几何Ellipse & Avoidance Geometry
把配置里的避让半径与倍率折算成椭圆、把椭圆折算成某个接近方向上的标量半径,以及由单位尺寸换算出的胶囊偏移。它们在每帧解算前把几何准备好,求解器只处理数值。
These turn configured avoidance radii and multipliers into ellipses, an ellipse into a scalar radius for a given approach direction, and agent dimensions into a capsule offset. Geometry is prepared before each frame's solve so the solver only deals with numbers.
给定半长轴 a、半短轴 b 与长轴方向 majorDir,返回椭圆在接近方向 approachDir 上呈现的半径。求解器据此把方向相关的避让距离折算成一次标量比较。
Given semi-major axis a, semi-minor axis b and major-axis direction majorDir, returns the radius the ellipse presents along the approach direction approachDir. The solver uses it to reduce a direction-dependent avoidance distance to a single scalar comparison.
Input
| 参数Param | 类型Type | 说明Description |
|---|---|---|
a | float | 椭圆半长轴。Semi-major axis. |
b | float | 椭圆半短轴。Semi-minor axis. |
majorDir | const FVector2f& | 长轴在 2D 平面上的方向。Major-axis direction in the 2D plane. |
approachDir | const FVector2f& | 要测量的接近方向。Approach direction to measure along. |
Output
返回该接近方向上的椭圆半径。
Returns the ellipse radius along that approach direction.
按移动模型挑选摩擦/驱动所依据的前进轴:从朝向、期望速度与求解器速度三者中选出本帧驱动应沿其施加的那条轴;轴的选择由移动模型决定。
Picks the forward axis the friction model drives along, according to the movement model: from the heading, desired velocity and solver velocity it chooses the axis the drive is applied along this frame, with the movement model making that choice.
Input
| 参数Param | 类型Type | 说明Description |
|---|---|---|
MovementModel | EMovementModel | 当前使用的移动模型。Movement model in effect. |
Heading2D | const FVector& | 单位当前朝向(2D 部分)。Current agent heading (its 2D part). |
DesiredVel2D | const FVector& | 期望速度(2D 部分)。Desired velocity (2D part). |
SolverVel2D | const FVector& | 避让求解器输出的速度(2D 部分)。Velocity produced by the avoidance solver (2D part). |
Output
返回选定的前进轴(3D 向量)。
Returns the chosen forward axis as a 3D vector.
由基础半径与二维避让距离倍率构造避让椭圆。倍率的两个分量分别决定两个半轴上的伸缩;UpVector 给出地面平面的上方向,用来把倍率放进正确的平面坐标系。
Builds an avoidance ellipse from a base radius and a 2D avoidance-distance multiplier. The two multiplier components scale the two semi-axes; UpVector supplies the ground-plane up direction so the multiplier lands in the right planar frame.
Input
| 参数Param | 类型Type | 说明Description |
|---|---|---|
BaseRadius | float | 未伸缩的基础避让半径。Base avoidance radius before scaling. |
AvoidDistMult | const FVector2f& | 两个方向上的避让距离倍率。Avoidance-distance multipliers along the two axes. |
UpVector | const FVector3f& | 地面平面的上方向。Up direction of the ground plane. |
Output
返回构造好的 FEllipseParams。
Returns the constructed FEllipseParams.
由邻居的二维避让半径构造该邻居的避让椭圆:AvoidRadius 的 X、Y 分量分别映射为两个半轴,UpVector 给出地面平面取向。
Builds the avoidance ellipse of a neighbour from its 2D avoidance radius: the X and Y components of AvoidRadius map to the two semi-axes, with UpVector orienting the ground plane.
Input
| 参数Param | 类型Type | 说明Description |
|---|---|---|
AvoidRadius | const FVector2f& | 邻居的二维避让半径,两个分量对应两个半轴。Neighbour's 2D avoidance radius; its two components are the two semi-axes. |
UpVector | const FVector3f& | 地面平面的上方向。Up direction of the ground plane. |
Output
返回邻居的 FEllipseParams。
Returns the neighbour's FEllipseParams.
由基础移动速度与倒车速度比预判前进、倒车两个驱动速度。结果供「对齐到路径 / 对齐到移动方向」在必须倒车时比较正反两个方向,决定本帧按哪个方向驱动。
Forecasts the forward and reverse drive speeds from the base move speed and the reverse-speed ratio. The result lets the align-to-path / align-to-movement behaviours compare the forward and reverse options when the agent has to back up, and pick which one drives the frame.
Input
| 参数Param | 类型Type | 说明Description |
|---|---|---|
BaseMoveSpeed | float | 基础移动速度。Base movement speed. |
ReverseSpeedRatio | float | 倒车速度相对基础速度的比例。Reverse speed as a ratio of the base speed. |
Output
返回 FForecastDriveSpeeds,两个字段分别为预判的前进与倒车速度。
Returns FForecastDriveSpeeds, whose fields are the forecast forward and reverse speeds.
计算胶囊中心到其最低点(地面接触点)的垂直偏移:轴段半高加半径,按碰撞体上轴 ColliderUp 的取向合成。这就是胶囊中心到最低点的距离。
Computes the vertical offset from the capsule centre to its lowest point (the ground contact): shaft half-height plus radius, combined along the collider up axis ColliderUp. That distance is what the function returns.
Input
| 参数Param | 类型Type | 说明Description |
|---|---|---|
ShaftHalfHeight | float | 胶囊轴段半高(不含两端的半球)。Half-height of the capsule shaft, excluding the two end hemispheres. |
Radius | float | 胶囊半径。Capsule radius. |
ColliderUp | const FVector3f& | 碰撞体上轴方向。Up axis of the collider. |
Output
返回偏移量(世界单位)。
Returns the offset in world units.
载具物理Vehicle Physics
载具移动模型专用的三步:把速度按加速/减速上限逼近、按转向角与转向速率算驱动方向、以及把求解器速度收尾成本帧可执行的速度。地面模型不使用这一组。
Three steps specific to the vehicle movement model: approach a target velocity under acceleration and deceleration limits, derive a drive direction from a steering angle and rate, and turn the solver velocity into a velocity the vehicle can execute this frame. The ground model does not use them.
按加速与减速上限把 CurrentVel 原地推向 TargetVel:朝目标加速时用 Accel,需要减速时用 Decel,步长为 DT。结果是速度变化率受控的一步,而不是直接赋值。
Moves CurrentVel toward TargetVel in place under the acceleration and deceleration limits: Accel when speeding toward the target, Decel when slowing down, over a step of DT. The result is a rate-limited step rather than a direct assignment.
Input
| 参数Param | 类型Type | 说明Description |
|---|---|---|
CurrentVel | FVector& | 当前速度;输入输出,被本函数修改。Current velocity; in-out, modified by this function. |
TargetVel | const FVector& | 本帧想要达到的速度。Velocity to reach this frame. |
Accel | float | 加速上限。Acceleration limit. |
Decel | float | 减速上限。Deceleration limit. |
DT | float | 本帧步长(秒)。Frame delta time in seconds. |
Output
无返回值;原地改写 CurrentVel。
No return value; CurrentVel is rewritten in place.
轮式载具的转向驱动方向:把车身前向按最大转向角 MaxSteeringAngleDeg 与转向速率 SteeringRateDegPerSec 朝期望 2D 方向 DesiredDir2D 转过去,当前转向角通过 InOutSteeringAngleDeg 读写以跨帧保持。移动解算只在 MaxSteeringAngle 大于极小值时才用它替代直接前向。
The wheel-steered drive direction for a vehicle: turns the body forward toward the desired 2D direction DesiredDir2D, bounded by the maximum steering angle MaxSteeringAngleDeg and the steering rate SteeringRateDegPerSec, with the current steering angle carried across frames in InOutSteeringAngleDeg. The move solver uses it in place of the plain forward axis only when MaxSteeringAngle is above a tiny threshold.
Input
| 参数Param | 类型Type | 说明Description |
|---|---|---|
ForwardDirection | const FVector& | 车身当前前向。Current body forward direction. |
DesiredDir2D | const FVector& | 想要转到的 2D 方向。Desired 2D direction to steer toward. |
MaxSteeringAngleDeg | float | 最大转向角(度)。Maximum steering angle in degrees. |
SteeringRateDegPerSec | float | 转向速率(度/秒)。Steering rate in degrees per second. |
DeltaTime | float | 本帧步长(秒)。Frame delta time in seconds. |
CurrentForwardSpeed | float | 当前沿前向的速度。Current speed along the forward axis. |
InOutSteeringAngleDeg | float& | 输入输出参数,保存当前转向角(度)。In-out parameter holding the current steering angle in degrees. |
Output
返回本帧的驱动方向;副作用是更新 InOutSteeringAngleDeg 中的转向角。
Returns the drive direction for this frame; the side effect is updating the steering angle in InOutSteeringAngleDeg.
载具移动的收尾积算:吃进已投影到车身轴上的目标前进速度(按引用,可能被修正)、驱动方向、当前 2D 速度与移动 fragment,返回本帧最终速度;求解器已经给出速度,这一尾部把它收成载具本帧可执行的速度。
The closing integration step for vehicle movement: it takes the target forward speed already projected onto the body axis (by reference, possibly adjusted), the drive direction, the current 2D velocity and the movement fragments, and returns this frame's final velocity; the solver has already produced a velocity, and this tail turns it into one the vehicle can execute this frame.
Input
| 参数Param | 类型Type | 说明Description |
|---|---|---|
TargetForwardSpeed | float& | 目标前进速度;输入输出,可能被修正。Target forward speed; in-out, may be adjusted. |
DriveDirection | const FVector& | 本帧驱动方向。Drive direction for this frame. |
CurrentVelocity2D | const FVector& | 当前速度的 2D 部分。2D part of the current velocity. |
Move | const FMove& | 移动配置 fragment。Movement configuration fragment. |
Moving | const FMoving& | 移动运行时状态 fragment。Movement runtime state fragment. |
DeltaTime | float | 本帧步长(秒)。Frame delta time in seconds. |
SelfLocation | const FVector& | 单位的世界位置。World location of the agent. |
Output
返回本帧最终速度;副作用是改写 TargetForwardSpeed。
Returns the final velocity for this frame; the side effect is rewriting TargetForwardSpeed.
类方法Class Methods
处理器自身只有三个入口:构造函数定执行域,ConfigureQueries 建查询,Execute 每帧推进全部单位。移动算法都藏在私有方法与自由函数里,这三个入口负责把它们接到 Mass 框架的调度上。
The processor itself has only three entry points: the constructor fixes the execution domain, ConfigureQueries builds the query and Execute advances every agent each frame. The movement algorithms live in private methods and free functions; these three wire them into Mass scheduling.
构造函数只做三件事:关闭按处理阶段自动注册,声明必须在游戏线程执行,把执行域限定为 Standalone / Server / Client。运行参数、查询与算法选择都不在构造期决定。
The constructor does exactly three things: it turns off auto-registration with the processing phases, declares that execution must happen on the game thread, and restricts the execution domain to Standalone / Server / Client. Runtime parameters, queries and algorithm choices are all decided later.
Input
无参数。
No parameters.
Output
无返回值。副作用:写入 bAutoRegisterWithProcessingPhases = false、bRequiresGameThreadExecution = true 与 ExecutionFlags。
No return value. Side effects: sets bAutoRegisterWithProcessingPhases = false, bRequiresGameThreadExecution = true and ExecutionFlags.
配置本处理器的实体查询:初始化 EntityQuery,要求 FAgentTag 加完整的一套单位 fragment(配置类只读、运行状态可写),把 FNotifyShared 列为可选,最后把查询注册到处理器。移动与跳跃时钟都由本处理器持有,所以它们跨越的通知行也在这里一并收集,而不另跑一次逐单位通知遍历。
Configures the processor's entity query: initializes EntityQuery, requires FAgentTag plus the full agent fragment set (configuration read-only, runtime state read-write), lists FNotifyShared as optional, and finally registers the query with the processor. The move processor owns the locomotion and jump clocks, so the notify rows they cross are collected here as well instead of running a separate per-agent notify pass.
Input
| 参数Param | 类型Type | 说明Description |
|---|---|---|
EntityManager | const TSharedRef<FMassEntityManager>& | 实体管理器,EntityQuery 的初始化依赖。Entity manager the EntityQuery initializes against. |
Output
无返回值。副作用:EntityQuery 完成初始化并注册到本处理器,之后 Execute 才能用它遍历单位。
No return value. Side effect: EntityQuery is initialized and registered with the processor, after which Execute can iterate agents with it.
每帧移动入口,先做几道早退:战斗子系统、Mass API 子系统或哈希格子子系统取不到时直接返回;定点精度(bUseFixPointMath)开启时也返回——本处理器只跑浮点路径,定点路径由对应的定点移动处理器承担。随后排空 PendingFlowFieldLoads 中的同步流场加载请求,把解析出的流场指针写进单位的导航状态。确定性模式下先合并并排序本 tick 的发射力(按力大小升序、InstigatorID 与力向量作全序比较),再进入并行逐块循环,完成交通规则、避让求解、PBD 与位置积分。多子步独立物理开启(bStandalonePhysicsActive)时,内联的 PBD 段被绕过,碰撞交由物理处理器在移动相位之后处理。
The per-frame movement entry. It bails out early when the battle, Mass API or hash-grid subsystem is unavailable, and also returns when fixed-point math is on (bUseFixPointMath) — this processor runs the float path only, while the fixed-point counterpart covers the other. It then drains the synchronous flow-field load requests queued in PendingFlowFieldLoads, writing the resolved field pointers into the agents' navigation state. In deterministic mode it first merges and sorts this tick's launch forces (ascending magnitude, with InstigatorID and the force vector giving a total order), then enters the parallel per-chunk loop that applies traffic rules, avoidance, PBD and position integration. When the standalone multi-substep physics is active (bStandalonePhysicsActive), the inline PBD section is bypassed and collision is taken over by the physics processor after the full move phase.
Input
| 参数Param | 类型Type | 说明Description |
|---|---|---|
EntityManager | FMassEntityManager& | 实体管理器。Entity manager. |
Context | FMassExecutionContext& | 本次执行的 Mass 上下文,逐块循环与 fragment 视图都从它取得。Mass execution context for this run; the chunk loop and fragment views come from it. |
Output
无返回值。副作用:向 FLocating、FRotating、FMoving 等运行 fragment 写入本帧移动结果,消费已排队的发射力与流场加载请求,并按移动状态改写导航与动画状态。
No return value. Side effects: writes this frame's movement into runtime fragments such as FLocating, FRotating and FMoving, consumes the queued launch forces and flow-field load requests, and updates navigation and animation state from the movement results.
常量Constants
处理器内部缓存的一组 EEntityFlags 常量:每个都是 EBattleFlags 对应值的编译期转换,免去每处 HasFlag / SetFlag / ClearFlag 调用前的重复转换。它们不是配置项,不出现在任何面板上,也不需要作者改动。
A set of EEntityFlags constants cached inside the processor: each one is a compile-time cast of the matching EBattleFlags value, removing the repeated conversion at every HasFlag / SetFlag / ClearFlag call. They are not settings, appear on no panel, and are not something an author edits.
| 名称Name | 值Value | 说明Description |
|---|---|---|
FallingFlag | EBattleFlags::Falling | 单位处于空中(下落)状态。动画跳跃机通常等这个标记出现,所以主动起跳必须有独立的 JumpingFlag。The unit is airborne (falling). The animation jump machine normally waits for this flag, which is why an explicit jump needs its own JumpingFlag. |
JumpingFlag | EBattleFlags::Jumping | 主动起跳从冲量帧起就算离地:土狼时间的存在只是为了让单位能找回一处边缘,而跳跃明确宣告离开地面,所以动画跳跃机不得等 FallingFlag 才切状态。A deliberate jump is airborne from its impulse tick: coyote time exists so an agent can recover a ledge, while a jump explicitly declares the ground is being left, so the animation jump machine must not wait for FallingFlag. |
LaunchingFlag | EBattleFlags::Launching | 单位正受发射(冲量)推动。The unit is being driven by a launch impulse. |
BeingHitFlag | EBattleFlags::BeingHit | 被命中——休眠节流的唤醒源之一:停着的单位一被外部作用就必须恢复处理。Hit — one of the wake sources for the dormancy throttle: a parked unit must resume the frame something external starts acting on it. |
BeingPushedFlag | EBattleFlags::BeingPushed | 被推挤——休眠节流的另一个唤醒源。Pushed — the other wake source for the dormancy throttle. |
DyingFlag | EBattleFlags::Dying | 单位处于死亡过程中。The unit is in its dying state. |
AppearingFlag | EBattleFlags::Appearing | 单位仍处于出现(生成进入)过程。The unit is still appearing (spawning in). |
SleepingFlag | EBattleFlags::Sleeping | 单位处于休眠/停放状态。The unit is dormant or parked. |
PatrollingFlag | EBattleFlags::Patrolling | 单位正执行巡逻行为。The unit is running the patrol behaviour. |
AttackingFlag | EBattleFlags::Attacking | 单位的攻击行为处于激活状态。The unit's attack behaviour is active. |
ChasingFlag | EBattleFlags::Chasing | 单位正执行追击行为。The unit is chasing. |
ReturningFlag | EBattleFlags::Returning | 单位正在返回出发点。The unit is returning to its origin. |
ReinforcingFlag | EBattleFlags::Reinforcing | 单位正执行增援行为。The unit is reinforcing. |
PlayerDrivenFlag | EBattleFlags::PlayerDriven | 单位由玩家直接驱动,而非 AI。The unit is driven by the player rather than the AI. |
AStarMovingToFlag | EBattleFlags::AStarMovingTo | 单位正沿 A* 路径前往目标点。The unit is following an A* path toward a target. |
PendingDestroyFlag | EBattleFlags::PendingDestroy | 单位已排队等待销毁。The unit is queued for destruction. |
ActivatedFlag | EBattleFlags::Activated | 单位已被激活。The unit has been activated. |
SelectedFlag | EBattleFlags::Selected | 单位被玩家选中。The unit is selected by the player. |
BeingSelectFlag | EBattleFlags::BeingSelect | 单位正处于被选中的过程中。The unit is in the process of being selected. |
成员变量Members
处理器只持有两样实例数据:一个查询和一个流场加载队列,其余状态都放在 fragment、共享 fragment 或线程本地暂存里。
The processor holds just two pieces of instance data: one query and one flow-field load queue. All other state lives in fragments, shared fragments or the thread-local scratch.
| 名称Name | 类型Type | 默认值Default | 说明Description |
|---|---|---|---|
EntityQuery | FMassEntityQuery | — | 在 ConfigureQueries 里初始化并注册的实体查询:要求 FAgentTag 与整套移动 fragment,FNotifyShared 可选。Execute 的逐块循环由它驱动。The entity query initialized and registered in ConfigureQueries: it requires FAgentTag plus the full movement fragment set, with FNotifyShared optional. Execute's per-chunk loop is driven by it. |
PendingFlowFieldLoads | TQueue<FPendingFlowFieldLoad, EQueueMode::Mpsc> | — | 同步流场加载请求的多生产者、单消费者队列。Execute 开头逐个出队,把软指针解析成实际流场并写回单位的 FNavigating。Multi-producer, single-consumer queue of synchronous flow-field load requests. Execute dequeues them at its start, resolves each soft pointer to a live field and writes it back into the agent's FNavigating. |
私有方法Private Methods
以下方法不对外暴露,只在本处理器的解算流程内部使用;列出它们是为了说明避让求解的两条路径与墙约束的预处理位置。
These methods are not exposed; they are used inside the processor's own solve flow. They are listed here to show where wall-constraint preprocessing and the two avoidance solver paths sit.
| 名称Name | 说明Description |
|---|---|
PrecomputeWallConstraints | 单位开始解算前,把本帧墙约束预解进暂存上下文:每种障碍都归约成最近点加相对单位的法线,交给两个求解器共用。Pre-solves this frame's wall constraints into the scratch context before an agent is solved: every obstacle kind is reduced to a closest point plus an agent-relative normal for both solvers to share. |
ComputeRVO2AvoidingVelocity | ORCA 求解路径:用暂存的墙与邻居约束、自身椭圆/半径/质量、路径坐标系与交通开关,算出 FAvoiding 的速度。The ORCA solver path: computes FAvoiding's velocity from the gathered wall and neighbour constraints, the self ellipse/radius/mass, the path frame and the traffic switches. |
ComputeForceFieldAvoidingVelocity | 力场求解路径:输入与 ORCA 路径相同,另加力场强度、分离速度上限比例与速度阻尼。The force-field solver path: same inputs as the ORCA path plus field strength, separation speed cap fraction and velocity damping. |
管线角色Pipeline Role
执行域:ExecutionFlags 限定为 Standalone / Server / Client,并要求游戏线程执行,同时关闭按处理阶段自动注册。时间位置:移动在行为与投射物之后、宿主解算之前运行——坐骑解算必须读到本 tick 最终的父级变换;整段移动按 Subtick1 / Subtick2 两个子帧调度,两个子帧都调度时一次跑完,只调度一个时只跑对应分区。精度分工:bUseFixPointMath 打开时本处理器整帧返回,定点路径由对应的定点移动处理器承担。Execute 内部顺序是:排空流场加载请求 → 确定性模式下合并、排序、分发发射力 → 并行逐块循环(交通规则、ORCA 或力场避让、PBD、位置积分);独立多子步物理开启时内联 PBD 段被绕过,由物理处理器在移动相位之后接管碰撞。
Execution domain: ExecutionFlags is limited to Standalone / Server / Client, game-thread execution is required, and auto-registration with the processing phases is off. Placement in time: movement runs after behaviour and projectiles and before the host resolve — the mount resolve has to read this tick's final parent transforms; the whole move phase is scheduled as the two sub-frames Subtick1 and Subtick2, running in one pass when both are scheduled and processing only its partition when one is. Precision split: when bUseFixPointMath is on, this processor returns for the frame and the fixed-point move counterpart covers the path. Inside Execute the order is: drain flow-field load requests → in deterministic mode merge, sort and distribute launch forces → the parallel per-chunk loop (traffic rules, ORCA or force-field avoidance, PBD, position integration); with standalone multi-substep physics active, the inline PBD section is bypassed and the physics processor takes over collision after the move phase.
补充说明Notes
① 暂存区按线程持有:FAgentMoveScratchContext 每个工作线程一份,Reset() 清空内容但保留容量;巡逻与追击事件列表例外,按块手动清空。它从不出现在快照或网络数据里。
② 哨兵值 2.0:FTrafficEncounter 的 HeadingDot 与 ApproachDot 用它表示「该邻居的方向向量退化,这一对无效」;读取方必须先跳过,并且所有规则必须对 bAttackerFiltered 做一致的跳过,否则同一对在不同规则里得到不同结论。
③ 墙约束只表达平面:线段、盒体与场景命中都先归约成最近点加相对法线,两个求解器因此不按障碍种类分支;场景平面只写入 ObstaclePlanes,地面与天花板两个列表从不被填充。
④ 支撑与天花板用标量而非平面:平面是无限半空间,会把站在盒体旁边的单位抬起来,所以足迹判定放在收集阶段做;最高/最低值累加让结果与格子遍历顺序无关,不需要额外的确定性排序。
① Scratch is per thread: each worker thread keeps its own FAgentMoveScratchContext, and Reset() empties it while keeping capacity; the patrol and chase event lists are the exception and are cleared per chunk. It never appears in snapshots or network data.
② Sentinel 2.0: FTrafficEncounter uses it in HeadingDot and ApproachDot to mean "this neighbour's direction vector is degenerate, so the pair is invalid"; readers must skip such pairs, and every rule must honour bAttackerFiltered identically, otherwise the same pair is concluded differently by different rules.
③ Wall constraints are plane-only: segments, boxes and scene hits are all reduced to a closest point plus a relative normal first, so the two solvers do not branch on obstacle kind; scene planes go only into ObstaclePlanes, and the ground and ceiling lists are never filled.
④ Support and ceiling use scalars, not planes: a plane is an infinite half-space and would lift an agent standing beside a box, so the footprint test happens during gathering; accumulating the highest/lowest value makes the result independent of cell traversal order, with no extra deterministic sort needed.