UDN
Search public documentation:
ActorTickingCH
English Translation
日本語訳
한국어
Interested in the Unreal Engine?
Visit the Unreal Technology site.
Looking for jobs and company info?
Check out the Epic games site.
Questions about support via UDN?
Contact the UDN Staff
日本語訳
한국어
Interested in the Unreal Engine?
Visit the Unreal Technology site.
Looking for jobs and company info?
Check out the Epic games site.
Questions about support via UDN?
Contact the UDN Staff
Actor 更新
概述
TG_PreAsyncGroup
TG_DuringAsyncGroup
TG_PostAsyncGroup
- 如果它改变碰撞、产生可碰撞的actors,写入到Novodex数据中,那么它应该放入到TG_PreAsyncWork中。一般这样的Actors是Pawns、Weapons(武器)及某些刚体类。
- 如果Actor不能改变碰撞、可以产生可碰撞的Actors(不可碰撞的Actors也可以)或者可以改变Novodex数据,那么Actor应该放入到TG_DuringAsyncWork组中。这是最好的地方,因为更新Actors所消耗的时间隐藏了任何花费在仿真物理所消耗的时间,比如这里2毫秒的更新时间意味着大约有长达2毫秒的仿真时间是没有的。粒子系统、音频、AI处理可以放入到这个组中。
- 如果Actor需要在更新它的Unreal数据前从Novodex 获得数据,那么它必须放到 TG_PostAsyncWork组中。车辆和布娃娃一般会放入到这个组中。
Actor 产生
组件更新
Tick(更新)的代码流程
游戏线程 | 物理线程 |
---|---|
遍历世界的Actor列表,并更新这些是 TG_PreAsyncWork组的Actors,然后延迟所有其它Actors的更新 | 空闲 |
对于每个更新过的Actor,遍历所组件列表来更新TG_PreAsyncWork组中的Actors,延迟所有其它Actors的更新 | 空闲 |
通知启动物理线程 | 启动仿真 |
更新每个位于TG_DuringAsyncWork列表中的Actor | 仿真物理 |
对于Actor中的每个组件,根据需要更新延迟的组件。 | 仿真物理 |
更新每个延迟直到TG_DuringAsycnWork出现的才进行更新的组件 | 仿真物理 |
直到物理处理完成之前处于阻塞状态 | 返回仿真结果 |
更新位于TG_PostAsyncWork列表中的每个Actor。 | 空闲 |
更新Actor中的每个组件 | 空闲 |
更新每个延迟更新直到TG_PostAsycnWork出现的才进行更新的组件 | 空闲 |
渲染& 重复 | 空闲 |
详细的代码流程 (超出更新之外)
代码流程(每帧)
Object ticking Pre-physics controller (input) pawn (script) Components SkeletalMeshComponent: update animations, skeleton controls, then compute the matrices Physics, async pawn physics Post-physics Camera tick Viewport tick "server travelling" "client travelling" streaming Render Calculate VP matrix (ask camera in script, returns cached value) Controller.PreRender UTPawn.PreRender (pretty good thing for licencees to use as well) Render everything Audio Callgraph computation