Loading...
Searching...
No Matches
ObjLoader.hpp
1#pragma once
2#include <Threedim/TinyObj.hpp>
3#include <halp/controls.hpp>
4#include <halp/file_port.hpp>
5#include <halp/geometry.hpp>
6#include <halp/meta.hpp>
7#include <ossia/detail/mutex.hpp>
8
9namespace Threedim
10{
11
13{
14public:
15 halp_meta(name, "Object loader")
16 halp_meta(category, "Visuals/3D")
17 halp_meta(c_name, "obj_loader")
18 halp_meta(
19 authors,
20 "Jean-Michaƫl Celerier, TinyOBJ authors, miniPLY authors, Eigen authors")
21 halp_meta(manual_url, "https://ossia.io/score-docs/processes/meshes.html#obj-loader")
22 halp_meta(uuid, "5df71765-505f-4ab7-98c1-f305d10a01ef")
23
24 struct ins
25 {
26 struct obj_t : halp::file_port<"3D file">
27 {
28 halp_meta(extensions, "3D files (*.obj *.ply)");
29 static std::function<void(ObjLoader&)> process(file_type data);
30 } obj;
31 PositionControl position;
32 RotationControl rotation;
33 ScaleControl scale;
34 } inputs;
35
36 struct
37 {
38 struct : halp::mesh
39 {
40 halp_meta(name, "Geometry");
41 std::vector<halp::dynamic_geometry> mesh;
42 } geometry;
43 } outputs;
44
45 void operator()();
46
47 void rebuild_geometry();
48
49 std::vector<mesh> meshinfo{};
50 float_vec complete;
51};
52
53}
Definition ObjLoader.hpp:13
Definition ObjLoader.hpp:27
Definition ObjLoader.hpp:25
Definition TinyObj.hpp:63
Definition TinyObj.hpp:68
Definition TinyObj.hpp:72
Definition TinyObj.hpp:18