10#include <unordered_set>
25 const auto& uid =
handle.uid();
43 std::vector<hpp::uuid> result;
49 push_if_set(result, pbr.get_color_map());
50 push_if_set(result, pbr.get_normal_map());
51 push_if_set(result, pbr.get_roughness_map());
52 push_if_set(result, pbr.get_metalness_map());
53 push_if_set(result, pbr.get_ao_map());
54 push_if_set(result, pbr.get_emissive_map());
68 const auto& uids = m.get_default_material_uids();
69 std::vector<hpp::uuid> result;
70 result.reserve(uids.size());
71 for(
const auto& uid : uids)
75 result.push_back(uid);
92 const hpp::uuid& target,
93 std::vector<hpp::uuid>& out)
96 [&](
const auto& kvp) ->
void
98 const auto&
handle = kvp.second;
104 auto loaded =
handle.peek();
111 if(std::find(deps.begin(), deps.end(), target) != deps.end())
113 out.push_back(
handle.uid());
120 std::vector<hpp::uuid> result;
129 -> std::vector<hpp::uuid>
131 std::vector<hpp::uuid> result;
137 std::unordered_set<hpp::uuid> visited;
138 std::deque<hpp::uuid> queue;
139 visited.insert(root);
140 queue.push_back(root);
142 while(!queue.empty())
144 const auto current = queue.front();
149 if(visited.insert(dep).second)
151 result.push_back(dep);
152 queue.push_back(dep);
Manages assets, including loading, unloading, and storage.
void for_each_asset(F &&callback)
Applies a callback function to each asset.
Base class for materials used in rendering.
Main class representing a 3D mesh with support for different LODs, submeshes, and skinning.
Class for physically-based rendering (PBR) materials.
auto find_transitive_loaded_dependents(asset_manager &am, const hpp::uuid &root) -> std::vector< hpp::uuid >
void collect_dependents(asset_manager &am, const hpp::uuid &target, std::vector< hpp::uuid > &out)
auto find_loaded_dependents(asset_manager &am, const hpp::uuid &uid) -> std::vector< hpp::uuid >
auto get_referenced_uids(const material &m) -> std::vector< hpp::uuid >
Thread-safe handle to an asset.