Path: blob/master/modules/gltf/structures/gltf_node.h
10278 views
/**************************************************************************/1/* gltf_node.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"3536class GLTFNode : public Resource {37GDCLASS(GLTFNode, Resource);38friend class GLTFDocument;39friend class SkinTool;40friend class FBXDocument;4142private:43String original_name;44GLTFNodeIndex parent = -1;45int height = -1;46Transform3D transform;47GLTFMeshIndex mesh = -1;48GLTFCameraIndex camera = -1;49GLTFSkinIndex skin = -1;50GLTFSkeletonIndex skeleton = -1;51bool joint = false;52bool visible = true;53Vector<int> children;54GLTFLightIndex light = -1;55Dictionary additional_data;5657protected:58static void _bind_methods();5960public:61String get_original_name();62void set_original_name(String p_name);6364GLTFNodeIndex get_parent();65void set_parent(GLTFNodeIndex p_parent);6667int get_height();68void set_height(int p_height);6970Transform3D get_xform();71void set_xform(Transform3D p_xform);7273Transform3D get_rest_xform();74void set_rest_xform(Transform3D p_rest_xform);7576GLTFMeshIndex get_mesh();77void set_mesh(GLTFMeshIndex p_mesh);7879GLTFCameraIndex get_camera();80void set_camera(GLTFCameraIndex p_camera);8182GLTFSkinIndex get_skin();83void set_skin(GLTFSkinIndex p_skin);8485GLTFSkeletonIndex get_skeleton();86void set_skeleton(GLTFSkeletonIndex p_skeleton);8788Vector3 get_position();89void set_position(Vector3 p_position);9091Quaternion get_rotation();92void set_rotation(Quaternion p_rotation);9394Vector3 get_scale();95void set_scale(Vector3 p_scale);9697Vector<int> get_children();98void set_children(Vector<int> p_children);99void append_child_index(int p_child_index);100101GLTFLightIndex get_light();102void set_light(GLTFLightIndex p_light);103104bool get_visible();105void set_visible(bool p_visible);106107Variant get_additional_data(const StringName &p_extension_name);108bool has_additional_data(const StringName &p_extension_name);109void set_additional_data(const StringName &p_extension_name, Variant p_additional_data);110111NodePath get_scene_node_path(Ref<GLTFState> p_state, bool p_handle_skeletons = true);112};113114115