summaryrefslogtreecommitdiff
path: root/modules/gltf/gltf_state.h
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gltf/gltf_state.h')
-rw-r--r--modules/gltf/gltf_state.h60
1 files changed, 33 insertions, 27 deletions
diff --git a/modules/gltf/gltf_state.h b/modules/gltf/gltf_state.h
index d03434d2f1..d2a4948f06 100644
--- a/modules/gltf/gltf_state.h
+++ b/modules/gltf/gltf_state.h
@@ -31,23 +31,19 @@
#ifndef GLTF_STATE_H
#define GLTF_STATE_H
-#include "gltf_accessor.h"
-#include "gltf_animation.h"
-#include "gltf_buffer_view.h"
-#include "gltf_camera.h"
-#include "gltf_document.h"
-#include "gltf_document_extension.h"
-#include "gltf_light.h"
-#include "gltf_mesh.h"
-#include "gltf_node.h"
-#include "gltf_skeleton.h"
-#include "gltf_skin.h"
-#include "gltf_texture.h"
-
-#include "core/io/resource.h"
-#include "core/templates/map.h"
-#include "core/templates/pair.h"
-#include "core/templates/vector.h"
+#include "extensions/gltf_light.h"
+#include "gltf_template_convert.h"
+#include "structures/gltf_accessor.h"
+#include "structures/gltf_animation.h"
+#include "structures/gltf_buffer_view.h"
+#include "structures/gltf_camera.h"
+#include "structures/gltf_mesh.h"
+#include "structures/gltf_node.h"
+#include "structures/gltf_skeleton.h"
+#include "structures/gltf_skin.h"
+#include "structures/gltf_texture.h"
+
+#include "core/templates/rb_map.h"
#include "scene/animation/animation_player.h"
#include "scene/resources/texture.h"
@@ -56,12 +52,15 @@ class GLTFState : public Resource {
friend class GLTFDocument;
String filename;
+ String base_path;
Dictionary json;
int major_version = 0;
int minor_version = 0;
Vector<uint8_t> glb_data;
bool use_named_skin_binds = false;
+ bool use_khr_texture_transform = false;
+ bool discard_meshes_and_materials = false;
Vector<Ref<GLTFNode>> nodes;
Vector<Vector<uint8_t>> buffers;
@@ -71,7 +70,7 @@ class GLTFState : public Resource {
Vector<Ref<GLTFMesh>> meshes; // meshes are loaded directly, no reason not to.
Vector<AnimationPlayer *> animation_players;
- Map<Ref<BaseMaterial3D>, GLTFMaterialIndex> material_cache;
+ HashMap<Ref<BaseMaterial3D>, GLTFMaterialIndex> material_cache;
Vector<Ref<BaseMaterial3D>> materials;
String scene_name;
@@ -82,16 +81,16 @@ class GLTFState : public Resource {
Vector<Ref<GLTFSkin>> skins;
Vector<Ref<GLTFCamera>> cameras;
Vector<Ref<GLTFLight>> lights;
- Set<String> unique_names;
- Set<String> unique_animation_names;
+ HashSet<String> unique_names;
+ HashSet<String> unique_animation_names;
Vector<Ref<GLTFSkeleton>> skeletons;
- Map<GLTFSkeletonIndex, GLTFNodeIndex> skeleton_to_node;
+ HashMap<GLTFSkeletonIndex, GLTFNodeIndex> skeleton_to_node;
Vector<Ref<GLTFAnimation>> animations;
- Map<GLTFNodeIndex, Node *> scene_nodes;
+ HashMap<GLTFNodeIndex, Node *> scene_nodes;
- Map<ObjectID, GLTFSkeletonIndex> skeleton3d_to_gltf_skeleton;
- Map<ObjectID, Map<ObjectID, GLTFSkinIndex>> skin_and_skeleton3d_to_gltf_skin;
+ HashMap<ObjectID, GLTFSkeletonIndex> skeleton3d_to_gltf_skeleton;
+ HashMap<ObjectID, HashMap<ObjectID, GLTFSkinIndex>> skin_and_skeleton3d_to_gltf_skin;
protected:
static void _bind_methods();
@@ -112,6 +111,9 @@ public:
bool get_use_named_skin_binds();
void set_use_named_skin_binds(bool p_use_named_skin_binds);
+ bool get_discard_meshes_and_materials();
+ void set_discard_meshes_and_materials(bool p_discard_meshes_and_materials);
+
Array get_nodes();
void set_nodes(Array p_nodes);
@@ -133,6 +135,9 @@ public:
String get_scene_name();
void set_scene_name(String p_scene_name);
+ String get_base_path();
+ void set_base_path(String p_base_path);
+
Array get_root_nodes();
void set_root_nodes(Array p_root_nodes);
@@ -172,7 +177,7 @@ public:
AnimationPlayer *get_animation_player(int idx);
- //void set_scene_nodes(Map<GLTFNodeIndex, Node *> p_scene_nodes) {
+ //void set_scene_nodes(RBMap<GLTFNodeIndex, Node *> p_scene_nodes) {
// this->scene_nodes = p_scene_nodes;
//}
@@ -180,11 +185,12 @@ public:
// this->animation_players = p_animation_players;
//}
- //Map<Ref<Material>, GLTFMaterialIndex> get_material_cache() {
+ //RBMap<Ref<Material>, GLTFMaterialIndex> get_material_cache() {
// return this->material_cache;
//}
- //void set_material_cache(Map<Ref<Material>, GLTFMaterialIndex> p_material_cache) {
+ //void set_material_cache(RBMap<Ref<Material>, GLTFMaterialIndex> p_material_cache) {
// this->material_cache = p_material_cache;
//}
};
+
#endif // GLTF_STATE_H