MCPcopy Create free account
hub / github.com/WiVRn/WiVRn / get_node_name

Function get_node_name

client/render/scene_components.cpp:58–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58std::string get_node_name(const entt::registry & scene, entt::entity entity)
59{
60 auto name_parent = [&](entt::entity entity) -> std::pair<std::string, entt::entity> {
61 const auto & node = scene.get<components::node>(entity);
62 if (node.name == "")
63 return {std::to_string((int)entity), node.parent};
64 else
65 return {node.name, node.parent};
66 };
67
68 std::string name;
69 std::tie(name, entity) = name_parent(entity);
70
71 while (entity != entt::null)
72 {
73 std::string tmp;
74 std::tie(tmp, entity) = name_parent(entity);
75 name = tmp + "/" + name;
76 }
77
78 return name;
79}

Callers 1

applyMethod · 0.85

Calls 1

to_stringFunction · 0.85

Tested by

no test coverage detected