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.h26
1 files changed, 14 insertions, 12 deletions
diff --git a/modules/gltf/gltf_document.h b/modules/gltf/gltf_document.h
index bda1ce87d6..3e8ea19045 100644
--- a/modules/gltf/gltf_document.h
+++ b/modules/gltf/gltf_document.h
@@ -31,11 +31,9 @@
#ifndef GLTF_DOCUMENT_H
#define GLTF_DOCUMENT_H
-#include "editor/import/resource_importer_scene.h"
-#include "editor/import/scene_importer_mesh_node_3d.h"
#include "gltf_animation.h"
-#include "modules/modules_enabled.gen.h"
-#include "scene/2d/node_2d.h"
+
+#include "editor/import/scene_importer_mesh_node_3d.h"
#include "scene/3d/bone_attachment_3d.h"
#include "scene/3d/light_3d.h"
#include "scene/3d/mesh_instance_3d.h"
@@ -45,6 +43,8 @@
#include "scene/resources/material.h"
#include "scene/resources/texture.h"
+#include "modules/modules_enabled.gen.h"
+
class GLTFState;
class GLTFSkin;
class GLTFNode;
@@ -205,7 +205,7 @@ private:
Vector<Color> _decode_accessor_as_color(Ref<GLTFState> state,
const GLTFAccessorIndex p_accessor,
const bool p_for_vertex);
- Vector<Quat> _decode_accessor_as_quat(Ref<GLTFState> state,
+ Vector<Quaternion> _decode_accessor_as_quaternion(Ref<GLTFState> state,
const GLTFAccessorIndex p_accessor,
const bool p_for_vertex);
Vector<Transform2D> _decode_accessor_as_xform2d(Ref<GLTFState> state,
@@ -214,7 +214,7 @@ private:
Vector<Basis> _decode_accessor_as_basis(Ref<GLTFState> state,
const GLTFAccessorIndex p_accessor,
const bool p_for_vertex);
- Vector<Transform> _decode_accessor_as_xform(Ref<GLTFState> state,
+ Vector<Transform3D> _decode_accessor_as_xform(Ref<GLTFState> state,
const GLTFAccessorIndex p_accessor,
const bool p_for_vertex);
Error _parse_meshes(Ref<GLTFState> state);
@@ -260,11 +260,12 @@ private:
Error _serialize_animations(Ref<GLTFState> state);
BoneAttachment3D *_generate_bone_attachment(Ref<GLTFState> state,
Skeleton3D *skeleton,
- const GLTFNodeIndex node_index);
+ 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);
- Light3D *_generate_light(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);
void _assign_scene_names(Ref<GLTFState> state);
@@ -272,8 +273,8 @@ private:
T _interpolate_track(const Vector<float> &p_times, const Vector<T> &p_values,
const float p_time,
const GLTFAnimation::Interpolation p_interp);
- GLTFAccessorIndex _encode_accessor_as_quats(Ref<GLTFState> state,
- const Vector<Quat> p_attribs,
+ GLTFAccessorIndex _encode_accessor_as_quaternions(Ref<GLTFState> state,
+ const Vector<Quaternion> p_attribs,
const bool p_for_vertex);
GLTFAccessorIndex _encode_accessor_as_weights(Ref<GLTFState> state,
const Vector<Color> p_attribs,
@@ -316,7 +317,7 @@ private:
const Vector<int32_t> p_attribs,
const bool p_for_vertex);
GLTFAccessorIndex _encode_accessor_as_xform(Ref<GLTFState> state,
- const Vector<Transform> p_attribs,
+ const Vector<Transform3D> p_attribs,
const bool p_for_vertex);
Error _encode_buffer_view(Ref<GLTFState> state, const double *src,
const int count, const GLTFType type,
@@ -332,7 +333,7 @@ private:
String interpolation_to_string(const GLTFAnimation::Interpolation p_interp);
GLTFAnimation::Track _convert_animation_track(Ref<GLTFState> state,
GLTFAnimation::Track p_track,
- Ref<Animation> p_animation, Transform p_bone_rest,
+ Ref<Animation> p_animation, Transform3D p_bone_rest,
int32_t p_track_i,
GLTFNodeIndex p_node_i);
Error _encode_buffer_bins(Ref<GLTFState> state, const String &p_path);
@@ -365,6 +366,7 @@ public:
void _generate_scene_node(Ref<GLTFState> state, Node *scene_parent,
Node3D *scene_root,
const GLTFNodeIndex node_index);
+ void _generate_skeleton_bone_node(Ref<GLTFState> state, Node *scene_parent, Node3D *scene_root, const GLTFNodeIndex node_index);
void _import_animation(Ref<GLTFState> state, AnimationPlayer *ap,
const GLTFAnimationIndex index, const int bake_fps);
GLTFMeshIndex _convert_mesh_instance(Ref<GLTFState> state,