gltf_document.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433
  1. /*************************************************************************/
  2. /* gltf_document.h */
  3. /*************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /*************************************************************************/
  8. /* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
  9. /* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
  10. /* */
  11. /* Permission is hereby granted, free of charge, to any person obtaining */
  12. /* a copy of this software and associated documentation files (the */
  13. /* "Software"), to deal in the Software without restriction, including */
  14. /* without limitation the rights to use, copy, modify, merge, publish, */
  15. /* distribute, sublicense, and/or sell copies of the Software, and to */
  16. /* permit persons to whom the Software is furnished to do so, subject to */
  17. /* the following conditions: */
  18. /* */
  19. /* The above copyright notice and this permission notice shall be */
  20. /* included in all copies or substantial portions of the Software. */
  21. /* */
  22. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  23. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  24. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
  25. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  26. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  27. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  28. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  29. /*************************************************************************/
  30. #ifndef GLTF_DOCUMENT_H
  31. #define GLTF_DOCUMENT_H
  32. #include "editor/import/resource_importer_scene.h"
  33. #include "editor/import/scene_importer_mesh_node_3d.h"
  34. #include "gltf_animation.h"
  35. #include "modules/modules_enabled.gen.h"
  36. #include "scene/2d/node_2d.h"
  37. #include "scene/3d/bone_attachment_3d.h"
  38. #include "scene/3d/light_3d.h"
  39. #include "scene/3d/mesh_instance_3d.h"
  40. #include "scene/3d/node_3d.h"
  41. #include "scene/3d/skeleton_3d.h"
  42. #include "scene/animation/animation_player.h"
  43. #include "scene/resources/material.h"
  44. #include "scene/resources/texture.h"
  45. class GLTFState;
  46. class GLTFSkin;
  47. class GLTFNode;
  48. class GLTFSpecGloss;
  49. class GLTFSkeleton;
  50. using GLTFAccessorIndex = int;
  51. using GLTFAnimationIndex = int;
  52. using GLTFBufferIndex = int;
  53. using GLTFBufferViewIndex = int;
  54. using GLTFCameraIndex = int;
  55. using GLTFImageIndex = int;
  56. using GLTFMaterialIndex = int;
  57. using GLTFMeshIndex = int;
  58. using GLTFLightIndex = int;
  59. using GLTFNodeIndex = int;
  60. using GLTFSkeletonIndex = int;
  61. using GLTFSkinIndex = int;
  62. using GLTFTextureIndex = int;
  63. class GLTFDocument : public Resource {
  64. GDCLASS(GLTFDocument, Resource);
  65. friend class GLTFState;
  66. friend class GLTFSkin;
  67. friend class GLTFSkeleton;
  68. public:
  69. const int32_t JOINT_GROUP_SIZE = 4;
  70. enum GLTFType {
  71. TYPE_SCALAR,
  72. TYPE_VEC2,
  73. TYPE_VEC3,
  74. TYPE_VEC4,
  75. TYPE_MAT2,
  76. TYPE_MAT3,
  77. TYPE_MAT4,
  78. };
  79. enum {
  80. ARRAY_BUFFER = 34962,
  81. ELEMENT_ARRAY_BUFFER = 34963,
  82. TYPE_BYTE = 5120,
  83. TYPE_UNSIGNED_BYTE = 5121,
  84. TYPE_SHORT = 5122,
  85. TYPE_UNSIGNED_SHORT = 5123,
  86. TYPE_UNSIGNED_INT = 5125,
  87. TYPE_FLOAT = 5126,
  88. COMPONENT_TYPE_BYTE = 5120,
  89. COMPONENT_TYPE_UNSIGNED_BYTE = 5121,
  90. COMPONENT_TYPE_SHORT = 5122,
  91. COMPONENT_TYPE_UNSIGNED_SHORT = 5123,
  92. COMPONENT_TYPE_INT = 5125,
  93. COMPONENT_TYPE_FLOAT = 5126,
  94. };
  95. private:
  96. template <class T>
  97. static Array to_array(const Vector<T> &p_inp) {
  98. Array ret;
  99. for (int i = 0; i < p_inp.size(); i++) {
  100. ret.push_back(p_inp[i]);
  101. }
  102. return ret;
  103. }
  104. template <class T>
  105. static Array to_array(const Set<T> &p_inp) {
  106. Array ret;
  107. typename Set<T>::Element *elem = p_inp.front();
  108. while (elem) {
  109. ret.push_back(elem->get());
  110. elem = elem->next();
  111. }
  112. return ret;
  113. }
  114. template <class T>
  115. static void set_from_array(Vector<T> &r_out, const Array &p_inp) {
  116. r_out.clear();
  117. for (int i = 0; i < p_inp.size(); i++) {
  118. r_out.push_back(p_inp[i]);
  119. }
  120. }
  121. template <class T>
  122. static void set_from_array(Set<T> &r_out, const Array &p_inp) {
  123. r_out.clear();
  124. for (int i = 0; i < p_inp.size(); i++) {
  125. r_out.insert(p_inp[i]);
  126. }
  127. }
  128. template <class K, class V>
  129. static Dictionary to_dict(const Map<K, V> &p_inp) {
  130. Dictionary ret;
  131. for (typename Map<K, V>::Element *E = p_inp.front(); E; E = E->next()) {
  132. ret[E->key()] = E->value();
  133. }
  134. return ret;
  135. }
  136. template <class K, class V>
  137. static void set_from_dict(Map<K, V> &r_out, const Dictionary &p_inp) {
  138. r_out.clear();
  139. Array keys = p_inp.keys();
  140. for (int i = 0; i < keys.size(); i++) {
  141. r_out[keys[i]] = p_inp[keys[i]];
  142. }
  143. }
  144. double _filter_number(double p_float);
  145. String _get_component_type_name(const uint32_t p_component);
  146. int _get_component_type_size(const int component_type);
  147. Error _parse_scenes(Ref<GLTFState> state);
  148. Error _parse_nodes(Ref<GLTFState> state);
  149. String _get_type_name(const GLTFType p_component);
  150. String _get_accessor_type_name(const GLTFDocument::GLTFType p_type);
  151. String _sanitize_scene_name(const String &name);
  152. String _gen_unique_name(Ref<GLTFState> state, const String &p_name);
  153. String _sanitize_bone_name(const String &name);
  154. String _gen_unique_bone_name(Ref<GLTFState> state,
  155. const GLTFSkeletonIndex skel_i,
  156. const String &p_name);
  157. GLTFTextureIndex _set_texture(Ref<GLTFState> state, Ref<Texture2D> p_texture);
  158. Ref<Texture2D> _get_texture(Ref<GLTFState> state,
  159. const GLTFTextureIndex p_texture);
  160. Error _parse_json(const String &p_path, Ref<GLTFState> state);
  161. Error _parse_glb(const String &p_path, Ref<GLTFState> state);
  162. void _compute_node_heights(Ref<GLTFState> state);
  163. Error _parse_buffers(Ref<GLTFState> state, const String &p_base_path);
  164. Error _parse_buffer_views(Ref<GLTFState> state);
  165. GLTFType _get_type_from_str(const String &p_string);
  166. Error _parse_accessors(Ref<GLTFState> state);
  167. Error _decode_buffer_view(Ref<GLTFState> state, double *dst,
  168. const GLTFBufferViewIndex p_buffer_view,
  169. const int skip_every, const int skip_bytes,
  170. const int element_size, const int count,
  171. const GLTFType type, const int component_count,
  172. const int component_type, const int component_size,
  173. const bool normalized, const int byte_offset,
  174. const bool for_vertex);
  175. Vector<double> _decode_accessor(Ref<GLTFState> state,
  176. const GLTFAccessorIndex p_accessor,
  177. const bool p_for_vertex);
  178. Vector<float> _decode_accessor_as_floats(Ref<GLTFState> state,
  179. const GLTFAccessorIndex p_accessor,
  180. const bool p_for_vertex);
  181. Vector<int> _decode_accessor_as_ints(Ref<GLTFState> state,
  182. const GLTFAccessorIndex p_accessor,
  183. const bool p_for_vertex);
  184. Vector<Vector2> _decode_accessor_as_vec2(Ref<GLTFState> state,
  185. const GLTFAccessorIndex p_accessor,
  186. const bool p_for_vertex);
  187. Vector<Vector3> _decode_accessor_as_vec3(Ref<GLTFState> state,
  188. const GLTFAccessorIndex p_accessor,
  189. const bool p_for_vertex);
  190. Vector<Color> _decode_accessor_as_color(Ref<GLTFState> state,
  191. const GLTFAccessorIndex p_accessor,
  192. const bool p_for_vertex);
  193. Vector<Quat> _decode_accessor_as_quat(Ref<GLTFState> state,
  194. const GLTFAccessorIndex p_accessor,
  195. const bool p_for_vertex);
  196. Vector<Transform2D> _decode_accessor_as_xform2d(Ref<GLTFState> state,
  197. const GLTFAccessorIndex p_accessor,
  198. const bool p_for_vertex);
  199. Vector<Basis> _decode_accessor_as_basis(Ref<GLTFState> state,
  200. const GLTFAccessorIndex p_accessor,
  201. const bool p_for_vertex);
  202. Vector<Transform> _decode_accessor_as_xform(Ref<GLTFState> state,
  203. const GLTFAccessorIndex p_accessor,
  204. const bool p_for_vertex);
  205. Error _parse_meshes(Ref<GLTFState> state);
  206. Error _serialize_textures(Ref<GLTFState> state);
  207. Error _serialize_images(Ref<GLTFState> state, const String &p_path);
  208. Error _serialize_lights(Ref<GLTFState> state);
  209. Error _parse_images(Ref<GLTFState> state, const String &p_base_path);
  210. Error _parse_textures(Ref<GLTFState> state);
  211. Error _parse_materials(Ref<GLTFState> state);
  212. void _set_texture_transform_uv1(const Dictionary &d, Ref<BaseMaterial3D> material);
  213. void spec_gloss_to_rough_metal(Ref<GLTFSpecGloss> r_spec_gloss,
  214. Ref<BaseMaterial3D> p_material);
  215. static void spec_gloss_to_metal_base_color(const Color &p_specular_factor,
  216. const Color &p_diffuse,
  217. Color &r_base_color,
  218. float &r_metallic);
  219. GLTFNodeIndex _find_highest_node(Ref<GLTFState> state,
  220. const Vector<GLTFNodeIndex> &subset);
  221. bool _capture_nodes_in_skin(Ref<GLTFState> state, Ref<GLTFSkin> skin,
  222. const GLTFNodeIndex node_index);
  223. void _capture_nodes_for_multirooted_skin(Ref<GLTFState> state, Ref<GLTFSkin> skin);
  224. Error _expand_skin(Ref<GLTFState> state, Ref<GLTFSkin> skin);
  225. Error _verify_skin(Ref<GLTFState> state, Ref<GLTFSkin> skin);
  226. Error _parse_skins(Ref<GLTFState> state);
  227. Error _determine_skeletons(Ref<GLTFState> state);
  228. Error _reparent_non_joint_skeleton_subtrees(
  229. Ref<GLTFState> state, Ref<GLTFSkeleton> skeleton,
  230. const Vector<GLTFNodeIndex> &non_joints);
  231. Error _reparent_to_fake_joint(Ref<GLTFState> state, Ref<GLTFSkeleton> skeleton,
  232. const GLTFNodeIndex node_index);
  233. Error _determine_skeleton_roots(Ref<GLTFState> state,
  234. const GLTFSkeletonIndex skel_i);
  235. Error _create_skeletons(Ref<GLTFState> state);
  236. Error _map_skin_joints_indices_to_skeleton_bone_indices(Ref<GLTFState> state);
  237. Error _serialize_skins(Ref<GLTFState> state);
  238. Error _create_skins(Ref<GLTFState> state);
  239. bool _skins_are_same(const Ref<Skin> skin_a, const Ref<Skin> skin_b);
  240. void _remove_duplicate_skins(Ref<GLTFState> state);
  241. Error _serialize_cameras(Ref<GLTFState> state);
  242. Error _parse_cameras(Ref<GLTFState> state);
  243. Error _parse_lights(Ref<GLTFState> state);
  244. Error _parse_animations(Ref<GLTFState> state);
  245. Error _serialize_animations(Ref<GLTFState> state);
  246. BoneAttachment3D *_generate_bone_attachment(Ref<GLTFState> state,
  247. Skeleton3D *skeleton,
  248. const GLTFNodeIndex node_index);
  249. EditorSceneImporterMeshNode3D *_generate_mesh_instance(Ref<GLTFState> state, Node *scene_parent, const GLTFNodeIndex node_index);
  250. Camera3D *_generate_camera(Ref<GLTFState> state, Node *scene_parent,
  251. const GLTFNodeIndex node_index);
  252. Light3D *_generate_light(Ref<GLTFState> state, Node *scene_parent, const GLTFNodeIndex node_index);
  253. Node3D *_generate_spatial(Ref<GLTFState> state, Node *scene_parent,
  254. const GLTFNodeIndex node_index);
  255. void _assign_scene_names(Ref<GLTFState> state);
  256. template <class T>
  257. T _interpolate_track(const Vector<float> &p_times, const Vector<T> &p_values,
  258. const float p_time,
  259. const GLTFAnimation::Interpolation p_interp);
  260. GLTFAccessorIndex _encode_accessor_as_quats(Ref<GLTFState> state,
  261. const Vector<Quat> p_attribs,
  262. const bool p_for_vertex);
  263. GLTFAccessorIndex _encode_accessor_as_weights(Ref<GLTFState> state,
  264. const Vector<Color> p_attribs,
  265. const bool p_for_vertex);
  266. GLTFAccessorIndex _encode_accessor_as_joints(Ref<GLTFState> state,
  267. const Vector<Color> p_attribs,
  268. const bool p_for_vertex);
  269. GLTFAccessorIndex _encode_accessor_as_floats(Ref<GLTFState> state,
  270. const Vector<real_t> p_attribs,
  271. const bool p_for_vertex);
  272. GLTFAccessorIndex _encode_accessor_as_vec2(Ref<GLTFState> state,
  273. const Vector<Vector2> p_attribs,
  274. const bool p_for_vertex);
  275. void _calc_accessor_vec2_min_max(int i, const int element_count, Vector<double> &type_max, Vector2 attribs, Vector<double> &type_min) {
  276. if (i == 0) {
  277. for (int32_t type_i = 0; type_i < element_count; type_i++) {
  278. type_max.write[type_i] = attribs[(i * element_count) + type_i];
  279. type_min.write[type_i] = attribs[(i * element_count) + type_i];
  280. }
  281. }
  282. for (int32_t type_i = 0; type_i < element_count; type_i++) {
  283. type_max.write[type_i] = MAX(attribs[(i * element_count) + type_i], type_max[type_i]);
  284. type_min.write[type_i] = MIN(attribs[(i * element_count) + type_i], type_min[type_i]);
  285. type_max.write[type_i] = _filter_number(type_max.write[type_i]);
  286. type_min.write[type_i] = _filter_number(type_min.write[type_i]);
  287. }
  288. }
  289. GLTFAccessorIndex _encode_accessor_as_vec3(Ref<GLTFState> state,
  290. const Vector<Vector3> p_attribs,
  291. const bool p_for_vertex);
  292. GLTFAccessorIndex _encode_accessor_as_color(Ref<GLTFState> state,
  293. const Vector<Color> p_attribs,
  294. const bool p_for_vertex);
  295. void _calc_accessor_min_max(int p_i, const int p_element_count, Vector<double> &p_type_max, Vector<double> p_attribs, Vector<double> &p_type_min);
  296. GLTFAccessorIndex _encode_accessor_as_ints(Ref<GLTFState> state,
  297. const Vector<int32_t> p_attribs,
  298. const bool p_for_vertex);
  299. GLTFAccessorIndex _encode_accessor_as_xform(Ref<GLTFState> state,
  300. const Vector<Transform> p_attribs,
  301. const bool p_for_vertex);
  302. Error _encode_buffer_view(Ref<GLTFState> state, const double *src,
  303. const int count, const GLTFType type,
  304. const int component_type, const bool normalized,
  305. const int byte_offset, const bool for_vertex,
  306. GLTFBufferViewIndex &r_accessor);
  307. Error _encode_accessors(Ref<GLTFState> state);
  308. Error _encode_buffer_views(Ref<GLTFState> state);
  309. Error _serialize_materials(Ref<GLTFState> state);
  310. Error _serialize_meshes(Ref<GLTFState> state);
  311. Error _serialize_nodes(Ref<GLTFState> state);
  312. Error _serialize_scenes(Ref<GLTFState> state);
  313. String interpolation_to_string(const GLTFAnimation::Interpolation p_interp);
  314. GLTFAnimation::Track _convert_animation_track(Ref<GLTFState> state,
  315. GLTFAnimation::Track p_track,
  316. Ref<Animation> p_animation, Transform p_bone_rest,
  317. int32_t p_track_i,
  318. GLTFNodeIndex p_node_i);
  319. Error _encode_buffer_bins(Ref<GLTFState> state, const String &p_path);
  320. Error _encode_buffer_glb(Ref<GLTFState> state, const String &p_path);
  321. Error _serialize_bone_attachment(Ref<GLTFState> state);
  322. Dictionary _serialize_texture_transform_uv1(Ref<BaseMaterial3D> p_material);
  323. Dictionary _serialize_texture_transform_uv2(Ref<BaseMaterial3D> p_material);
  324. Error _serialize_version(Ref<GLTFState> state);
  325. Error _serialize_file(Ref<GLTFState> state, const String p_path);
  326. Error _serialize_extensions(Ref<GLTFState> state) const;
  327. public:
  328. // http://www.itu.int/rec/R-REC-BT.601
  329. // http://www.itu.int/dms_pubrec/itu-r/rec/bt/R-REC-BT.601-7-201103-I!!PDF-E.pdf
  330. static constexpr float R_BRIGHTNESS_COEFF = 0.299f;
  331. static constexpr float G_BRIGHTNESS_COEFF = 0.587f;
  332. static constexpr float B_BRIGHTNESS_COEFF = 0.114f;
  333. private:
  334. // https://github.com/microsoft/glTF-SDK/blob/master/GLTFSDK/Source/PBRUtils.cpp#L9
  335. // https://bghgary.github.io/glTF/convert-between-workflows-bjs/js/babylon.pbrUtilities.js
  336. static float solve_metallic(float p_dielectric_specular, float diffuse,
  337. float specular,
  338. float p_one_minus_specular_strength);
  339. static float get_perceived_brightness(const Color p_color);
  340. static float get_max_component(const Color &p_color);
  341. public:
  342. void _process_mesh_instances(Ref<GLTFState> state, Node *scene_root);
  343. void _generate_scene_node(Ref<GLTFState> state, Node *scene_parent,
  344. Node3D *scene_root,
  345. const GLTFNodeIndex node_index);
  346. void _import_animation(Ref<GLTFState> state, AnimationPlayer *ap,
  347. const GLTFAnimationIndex index, const int bake_fps);
  348. GLTFMeshIndex _convert_mesh_instance(Ref<GLTFState> state,
  349. MeshInstance3D *p_mesh_instance);
  350. void _convert_mesh_instances(Ref<GLTFState> state);
  351. GLTFCameraIndex _convert_camera(Ref<GLTFState> state, Camera3D *p_camera);
  352. void _convert_light_to_gltf(Light3D *light, Ref<GLTFState> state, Node3D *spatial, Ref<GLTFNode> gltf_node);
  353. GLTFLightIndex _convert_light(Ref<GLTFState> state, Light3D *p_light);
  354. GLTFSkeletonIndex _convert_skeleton(Ref<GLTFState> state, Skeleton3D *p_skeleton);
  355. void _convert_spatial(Ref<GLTFState> state, Node3D *p_spatial, Ref<GLTFNode> p_node);
  356. void _convert_scene_node(Ref<GLTFState> state, Node *p_current, Node *p_root,
  357. const GLTFNodeIndex p_gltf_current,
  358. const GLTFNodeIndex p_gltf_root);
  359. #ifdef MODULE_CSG_ENABLED
  360. void _convert_csg_shape_to_gltf(Node *p_current, GLTFNodeIndex p_gltf_parent, Ref<GLTFNode> gltf_node, Ref<GLTFState> state);
  361. #endif // MODULE_CSG_ENABLED
  362. void _create_gltf_node(Ref<GLTFState> state,
  363. Node *p_scene_parent,
  364. GLTFNodeIndex current_node_i,
  365. GLTFNodeIndex p_parent_node_index,
  366. GLTFNodeIndex p_root_gltf_node,
  367. Ref<GLTFNode> gltf_node);
  368. void _convert_animation_player_to_gltf(
  369. AnimationPlayer *animation_player, Ref<GLTFState> state,
  370. const GLTFNodeIndex &p_gltf_current,
  371. const GLTFNodeIndex &p_gltf_root_index,
  372. Ref<GLTFNode> p_gltf_node, Node *p_scene_parent,
  373. Node *p_root);
  374. void _check_visibility(Node *p_node, bool &retflag);
  375. void _convert_camera_to_gltf(Camera3D *camera, Ref<GLTFState> state,
  376. Node3D *spatial,
  377. Ref<GLTFNode> gltf_node);
  378. #ifdef MODULE_GRIDMAP_ENABLED
  379. void _convert_grid_map_to_gltf(
  380. Node *p_scene_parent,
  381. const GLTFNodeIndex &p_parent_node_index,
  382. const GLTFNodeIndex &p_root_node_index,
  383. Ref<GLTFNode> gltf_node, Ref<GLTFState> state,
  384. Node *p_root_node);
  385. #endif // MODULE_GRIDMAP_ENABLED
  386. void _convert_mult_mesh_instance_to_gltf(
  387. Node *p_scene_parent,
  388. const GLTFNodeIndex &p_parent_node_index,
  389. const GLTFNodeIndex &p_root_node_index,
  390. Ref<GLTFNode> gltf_node, Ref<GLTFState> state,
  391. Node *p_root_node);
  392. void _convert_skeleton_to_gltf(
  393. Node *p_scene_parent, Ref<GLTFState> state,
  394. const GLTFNodeIndex &p_parent_node_index,
  395. const GLTFNodeIndex &p_root_node_index,
  396. Ref<GLTFNode> gltf_node, Node *p_root_node);
  397. void _convert_bone_attachment_to_gltf(Node *p_scene_parent,
  398. Ref<GLTFState> state,
  399. Ref<GLTFNode> gltf_node,
  400. bool &retflag);
  401. void _convert_mesh_to_gltf(Node *p_scene_parent,
  402. Ref<GLTFState> state, Node3D *spatial,
  403. Ref<GLTFNode> gltf_node);
  404. void _convert_animation(Ref<GLTFState> state, AnimationPlayer *ap,
  405. String p_animation_track_name);
  406. Error serialize(Ref<GLTFState> state, Node *p_root, const String &p_path);
  407. Error parse(Ref<GLTFState> state, String p_paths, bool p_read_binary = false);
  408. };
  409. #endif // GLTF_DOCUMENT_H