summaryrefslogtreecommitdiff
path: root/modules/gltf/gltf_document.h
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gltf/gltf_document.h')
-rw-r--r--modules/gltf/gltf_document.h24
1 files changed, 15 insertions, 9 deletions
diff --git a/modules/gltf/gltf_document.h b/modules/gltf/gltf_document.h
index 18aeb81bc0..7317c6a9a3 100644
--- a/modules/gltf/gltf_document.h
+++ b/modules/gltf/gltf_document.h
@@ -33,8 +33,11 @@
#include "gltf_animation.h"
-#include "editor/import/scene_importer_mesh_node_3d.h"
+#include "core/variant/dictionary.h"
+#include "core/variant/variant.h"
+#include "gltf_document_extension_convert_importer_mesh.h"
#include "scene/3d/bone_attachment_3d.h"
+#include "scene/3d/importer_mesh_instance_3d.h"
#include "scene/3d/light_3d.h"
#include "scene/3d/mesh_instance_3d.h"
#include "scene/3d/node_3d.h"
@@ -54,6 +57,7 @@ class GLTFSkeleton;
class CSGShape3D;
class GridMap;
class MultiMeshInstance3D;
+class GLTFDocumentExtension;
using GLTFAccessorIndex = int;
using GLTFAnimationIndex = int;
@@ -74,11 +78,13 @@ class GLTFDocument : public Resource {
friend class GLTFState;
friend class GLTFSkin;
friend class GLTFSkeleton;
+ TypedArray<GLTFDocumentExtension> document_extensions;
private:
const float BAKE_FPS = 30.0f;
public:
+ GLTFDocument();
const int32_t JOINT_GROUP_SIZE = 4;
enum GLTFType {
TYPE_SCALAR,
@@ -118,6 +124,8 @@ public:
Error save_scene(Node *p_node, const String &p_path,
const String &p_src_path, uint32_t p_flags,
float p_bake_fps, Ref<GLTFState> r_state);
+ void set_extensions(TypedArray<GLTFDocumentExtension> p_extensions);
+ TypedArray<GLTFDocumentExtension> get_extensions() const;
private:
template <class T>
@@ -280,12 +288,10 @@ private:
Skeleton3D *skeleton,
const GLTFNodeIndex node_index,
const GLTFNodeIndex bone_index);
- EditorSceneImporterMeshNode3D *_generate_mesh_instance(Ref<GLTFState> state, Node *scene_parent, const GLTFNodeIndex node_index);
- Camera3D *_generate_camera(Ref<GLTFState> state, Node *scene_parent,
- const GLTFNodeIndex node_index);
- Node3D *_generate_light(Ref<GLTFState> state, Node *scene_parent, const GLTFNodeIndex node_index);
- Node3D *_generate_spatial(Ref<GLTFState> state, Node *scene_parent,
- const GLTFNodeIndex node_index);
+ ImporterMeshInstance3D *_generate_mesh_instance(Ref<GLTFState> state, Node *parent_node, const GLTFNodeIndex node_index);
+ Camera3D *_generate_camera(Ref<GLTFState> state, Node *parent_node, const GLTFNodeIndex node_index);
+ Node3D *_generate_light(Ref<GLTFState> state, Node *parent_node, const GLTFNodeIndex node_index);
+ Node3D *_generate_spatial(Ref<GLTFState> state, Node *parent_node, const GLTFNodeIndex node_index);
void _assign_scene_names(Ref<GLTFState> state);
template <class T>
T _interpolate_track(const Vector<float> &p_times, const Vector<T> &p_values,
@@ -420,8 +426,8 @@ public:
GLTFNodeIndex p_root_node_index,
Ref<GLTFNode> gltf_node, Ref<GLTFState> state);
#endif // MODULE_GRIDMAP_ENABLED
- void _convert_mult_mesh_instance_to_gltf(
- MultiMeshInstance3D *p_scene_parent,
+ void _convert_multi_mesh_instance_to_gltf(
+ MultiMeshInstance3D *p_multi_mesh_instance,
GLTFNodeIndex p_parent_node_index,
GLTFNodeIndex p_root_node_index,
Ref<GLTFNode> gltf_node, Ref<GLTFState> state);