FMeshRenderProxyCache
The game-thread half of the persistent render scene: one proxy per entity that draws through a MeshRenderer, holding what the mesh gather used to look up again for every entity on every view — five hashed component lookups and the collider's surface type, which for a collider naming a .mphysmat is a mutex-guarded cache lookup.
- Module
- Game
- Header
#include "Scene/MeshRenderProxyCache.h"- Namespace
Mowo
The list is rebuilt only when the world's signature version moves. Every create, destroy, AddComponent, RemoveComponent, snapshot restore and world reset bumps it, and those are the only operations that move component storage, so a pointer taken under one version stays valid until the version changes. Field edits need no rebuild because the proxy reads the components live; the one derived value, the surface type, is re-resolved only when the collider's own fields or the physics-material cache generation change.
The proxy never holds a mesh or a material. Those are read through the MeshRenderer each frame, so an in-place asset hot reload that frees and replaces a mesh's internals can never leave a proxy pointing at the old one.
Public functions
| Returns | Name | Description |
|---|---|---|
bool | Sync | Brings the proxies in line with the world; true when the list was rebuilt. |
uint32_t | ResolveSurfaceType | The collider's surface type as a physics contact would resolve it, from the proxy's memo unless the collider or the material cache changed. |
const std::vector<FProxy>& | GetProxies | |
uint64_t | GetSyncedVersion | The signature version the proxies were built under. |
void | Invalidate | Forces the next Sync to rebuild, for a caller that swaps the world's contents behind its back. |
uint64_t | GetRebuildCount | |
uint64_t | GetSurfaceResolveCount |
Function details
Sync
bool Sync(World& world)Brings the proxies in line with the world; true when the list was rebuilt.
ResolveSurfaceType
uint32_t ResolveSurfaceType(const FProxy& proxy)The collider's surface type as a physics contact would resolve it, from the proxy's memo unless the collider or the material cache changed.
GetProxies
const std::vector<FProxy>& GetProxies() constGetSyncedVersion
uint64_t GetSyncedVersion() constThe signature version the proxies were built under. A caller walking the list stops the moment the world's version differs from it.
Invalidate
void Invalidate()Forces the next Sync to rebuild, for a caller that swaps the world's contents behind its back.
GetRebuildCount
uint64_t GetRebuildCount() constGetSurfaceResolveCount
uint64_t GetSurfaceResolveCount() const