Path: blob/master/modules/gltf/structures/gltf_skeleton.h
10278 views
/**************************************************************************/1/* gltf_skeleton.h */2/**************************************************************************/3/* This file is part of: */4/* GODOT ENGINE */5/* https://godotengine.org */6/**************************************************************************/7/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */8/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */9/* */10/* Permission is hereby granted, free of charge, to any person obtaining */11/* a copy of this software and associated documentation files (the */12/* "Software"), to deal in the Software without restriction, including */13/* without limitation the rights to use, copy, modify, merge, publish, */14/* distribute, sublicense, and/or sell copies of the Software, and to */15/* permit persons to whom the Software is furnished to do so, subject to */16/* the following conditions: */17/* */18/* The above copyright notice and this permission notice shall be */19/* included in all copies or substantial portions of the Software. */20/* */21/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */22/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */23/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */24/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */25/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */26/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */27/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */28/**************************************************************************/2930#pragma once3132#include "../gltf_defines.h"3334#include "core/io/resource.h"35#include "scene/3d/bone_attachment_3d.h"36#include "scene/3d/skeleton_3d.h"3738class GLTFSkeleton : public Resource {39GDCLASS(GLTFSkeleton, Resource);40friend class GLTFDocument;41friend class SkinTool;42friend class FBXDocument;4344private:45// The *synthesized* skeletons joints46Vector<GLTFNodeIndex> joints;4748// The roots of the skeleton. If there are multiple, each root must have the49// same parent (ie roots are siblings)50Vector<GLTFNodeIndex> roots;5152// The created Skeleton3D for the scene53Skeleton3D *godot_skeleton = nullptr;5455// Set of unique bone names for the skeleton56HashSet<String> unique_names;5758HashMap<int32_t, GLTFNodeIndex> godot_bone_node;5960Vector<BoneAttachment3D *> bone_attachments;6162protected:63static void _bind_methods();6465public:66Vector<GLTFNodeIndex> get_joints();67void set_joints(Vector<GLTFNodeIndex> p_joints);6869Vector<GLTFNodeIndex> get_roots();70void set_roots(Vector<GLTFNodeIndex> p_roots);7172Skeleton3D *get_godot_skeleton();7374// Skeleton *get_godot_skeleton() {75// return godot_skeleton;76// }77// void set_godot_skeleton(Skeleton p_*godot_skeleton) {78// godot_skeleton = p_godot_skeleton;79// }8081TypedArray<String> get_unique_names();82void set_unique_names(TypedArray<String> p_unique_names);8384//RBMap<int32_t, GLTFNodeIndex> get_godot_bone_node() {85// return godot_bone_node;86//}87//void set_godot_bone_node(const RBMap<int32_t, GLTFNodeIndex> &p_godot_bone_node) {88// godot_bone_node = p_godot_bone_node;89//}90Dictionary get_godot_bone_node();91void set_godot_bone_node(Dictionary p_indict);9293//Dictionary get_godot_bone_node() {94// return VariantConversion::to_dict(godot_bone_node);95//}96//void set_godot_bone_node(Dictionary p_indict) {97// VariantConversion::set_from_dict(godot_bone_node, p_indict);98//}99100BoneAttachment3D *get_bone_attachment(int idx);101102int32_t get_bone_attachment_count();103};104105106