14#include <lagrange/SurfaceMesh.h>
15#include <lagrange/scene/Scene.h>
16#include <lagrange/scene/api.h>
18namespace lagrange::scene::utils {
21[[deprecated(
"Use Scene::add_child instead")]]
inline void add_child(
23 ElementId child_index)
25 node.children.push_back(child_index);
29template <
typename Scalar,
typename Index>
30[[deprecated(
"Use Scene::add_child instead")]] ElementId
31add_child(Scene<Scalar, Index>& scene, Node& node, Node child)
33 ElementId child_idx = scene.nodes.size();
34 scene.nodes.push_back(child);
35 node.children.push_back(child_idx);
40template <
typename Scalar,
typename Index>
41[[deprecated(
"Use Scene::add(mesh) instead")]] ElementId add_mesh(
42 Scene<Scalar, Index>& scene,
43 SurfaceMesh<Scalar, Index> mesh)
45 scene.meshes.emplace_back(std::move(mesh));
46 return scene.meshes.size() - 1;
52template <
typename Scalar,
typename Index>
53Eigen::Affine3f compute_global_node_transform(
const Scene<Scalar, Index>& scene, ElementId node_idx)
56 const Node& n = scene.nodes[node_idx];
57 return compute_global_node_transform<Scalar, Index>(scene, n.parent) * n.transform;
69LA_SCENE_API Eigen::Affine3f camera_view_transform(
71 const Eigen::Affine3f& world_from_local = Eigen::Affine3f::Identity());
80LA_SCENE_API Eigen::Projective3f camera_projection_transform(
const Camera& camera);
97template <
typename Scalar,
typename Index>
98void convert_texcoord_uv_st(
99 SurfaceMesh<Scalar, Index>& mesh,
uint32_t AttributeId
Identified to be used to access an attribute.
Definition AttributeFwd.h:73
constexpr T invalid()
You can use invalid<T>() to get a value that can represent "invalid" values, such as invalid indices ...
Definition invalid.h:40