14#include <lagrange/SurfaceMesh.h>
15#include <lagrange/scene/Scene.h>
17namespace lagrange::scene::utils {
20[[deprecated(
"Use Scene::add_child instead")]]
inline void add_child(
22 ElementId child_index)
24 node.children.push_back(child_index);
28template <
typename Scalar,
typename Index>
29[[deprecated(
"Use Scene::add_child instead")]] ElementId
30add_child(Scene<Scalar, Index>& scene, Node& node, Node child)
32 ElementId child_idx = scene.nodes.size();
33 scene.nodes.push_back(child);
34 node.children.push_back(child_idx);
39template <
typename Scalar,
typename Index>
40[[deprecated(
"Use Scene::add(mesh) instead")]] ElementId add_mesh(
41 Scene<Scalar, Index>& scene,
42 SurfaceMesh<Scalar, Index> mesh)
44 scene.meshes.emplace_back(std::move(mesh));
45 return scene.meshes.size() - 1;
51template <
typename Scalar,
typename Index>
52Eigen::Affine3f compute_global_node_transform(
const Scene<Scalar, Index>& scene, ElementId node_idx)
54 if (node_idx == lagrange::invalid<size_t>())
return Eigen::Affine3f::Identity();
55 const Node& n = scene.nodes[node_idx];
56 return compute_global_node_transform<Scalar, Index>(scene, n.parent) * n.transform;
74template <
typename Scalar,
typename Index>
75void convert_texcoord_uv_st(
76 SurfaceMesh<Scalar, Index>& mesh,
uint32_t AttributeId
Identified to be used to access an attribute.
Definition: AttributeFwd.h:73