0.2.0-dev Download ZIP
93 lines ·5.8 KB Raw
| 1 | /**************************************************************************/ |
| 2 | /* spring_bone_simulator_3d.compat.inc */ |
| 3 | /**************************************************************************/ |
| 4 | /* This file is part of: */ |
| 5 | /* GODOT ENGINE */ |
| 6 | /* https://godotengine.org */ |
| 7 | /**************************************************************************/ |
| 8 | /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ |
| 9 | /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ |
| 10 | /* */ |
| 11 | /* Permission is hereby granted, free of charge, to any person obtaining */ |
| 12 | /* a copy of this software and associated documentation files (the */ |
| 13 | /* "Software"), to deal in the Software without restriction, including */ |
| 14 | /* without limitation the rights to use, copy, modify, merge, publish, */ |
| 15 | /* distribute, sublicense, and/or sell copies of the Software, and to */ |
| 16 | /* permit persons to whom the Software is furnished to do so, subject to */ |
| 17 | /* the following conditions: */ |
| 18 | /* */ |
| 19 | /* The above copyright notice and this permission notice shall be */ |
| 20 | /* included in all copies or substantial portions of the Software. */ |
| 21 | /* */ |
| 22 | /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ |
| 23 | /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ |
| 24 | /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ |
| 25 | /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ |
| 26 | /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ |
| 27 | /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ |
| 28 | /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ |
| 29 | /**************************************************************************/ |
| 30 | |
| 31 | #ifndef DISABLE_DEPRECATED |
| 32 | |
| 33 | #include "spring_bone_simulator_3d.h" |
| 34 | |
| 35 | #include "core/object/class_db.h" |
| 36 | |
| 37 | namespace compat::SpringBoneSimulator3D { |
| 38 | enum BoneDirection : int { |
| 39 | BONE_DIRECTION_PLUS_X = SkeletonModifier3D::BONE_DIRECTION_PLUS_X, |
| 40 | BONE_DIRECTION_MINUS_X = SkeletonModifier3D::BONE_DIRECTION_MINUS_X, |
| 41 | BONE_DIRECTION_PLUS_Y = SkeletonModifier3D::BONE_DIRECTION_PLUS_Y, |
| 42 | BONE_DIRECTION_MINUS_Y = SkeletonModifier3D::BONE_DIRECTION_MINUS_Y, |
| 43 | BONE_DIRECTION_PLUS_Z = SkeletonModifier3D::BONE_DIRECTION_PLUS_Z, |
| 44 | BONE_DIRECTION_MINUS_Z = SkeletonModifier3D::BONE_DIRECTION_MINUS_Z, |
| 45 | BONE_DIRECTION_FROM_PARENT = SkeletonModifier3D::BONE_DIRECTION_FROM_PARENT, |
| 46 | }; |
| 47 | |
| 48 | enum RotationAxis : int { |
| 49 | ROTATION_AXIS_X = SkeletonModifier3D::ROTATION_AXIS_X, |
| 50 | ROTATION_AXIS_Y = SkeletonModifier3D::ROTATION_AXIS_Y, |
| 51 | ROTATION_AXIS_Z = SkeletonModifier3D::ROTATION_AXIS_Z, |
| 52 | ROTATION_AXIS_ALL = SkeletonModifier3D::ROTATION_AXIS_ALL, |
| 53 | ROTATION_AXIS_CUSTOM = SkeletonModifier3D::ROTATION_AXIS_CUSTOM, |
| 54 | }; |
| 55 | } //namespace compat::SpringBoneSimulator3D |
| 56 | |
| 57 | VARIANT_ENUM_CAST(compat::SpringBoneSimulator3D::BoneDirection); |
| 58 | VARIANT_ENUM_CAST(compat::SpringBoneSimulator3D::RotationAxis); |
| 59 | |
| 60 | compat::SpringBoneSimulator3D::BoneDirection SpringBoneSimulator3D::_get_end_bone_direction_bind_compat_110120(int p_index) const { |
| 61 | return static_cast<compat::SpringBoneSimulator3D::BoneDirection>((int)get_end_bone_direction(p_index)); |
| 62 | } |
| 63 | |
| 64 | void SpringBoneSimulator3D::_set_end_bone_direction_bind_compat_110120(int p_index, compat::SpringBoneSimulator3D::BoneDirection p_bone_direction) { |
| 65 | set_end_bone_direction(p_index, static_cast<SkeletonModifier3D::BoneDirection>((int)p_bone_direction)); |
| 66 | } |
| 67 | |
| 68 | compat::SpringBoneSimulator3D::RotationAxis SpringBoneSimulator3D::_get_rotation_axis_bind_compat_110120(int p_index) const { |
| 69 | return static_cast<compat::SpringBoneSimulator3D::RotationAxis>((int)get_rotation_axis(p_index)); |
| 70 | } |
| 71 | |
| 72 | void SpringBoneSimulator3D::_set_rotation_axis_bind_compat_110120(int p_index, compat::SpringBoneSimulator3D::RotationAxis p_axis) { |
| 73 | set_rotation_axis(p_index, static_cast<SkeletonModifier3D::RotationAxis>((int)p_axis)); |
| 74 | } |
| 75 | |
| 76 | compat::SpringBoneSimulator3D::RotationAxis SpringBoneSimulator3D::_get_joint_rotation_axis_bind_compat_110120(int p_index, int p_joint) const { |
| 77 | return static_cast<compat::SpringBoneSimulator3D::RotationAxis>((int)get_joint_rotation_axis(p_index, p_joint)); |
| 78 | } |
| 79 | |
| 80 | void SpringBoneSimulator3D::_set_joint_rotation_axis_bind_compat_110120(int p_index, int p_joint, compat::SpringBoneSimulator3D::RotationAxis p_axis) { |
| 81 | set_joint_rotation_axis(p_index, p_joint, static_cast<SkeletonModifier3D::RotationAxis>((int)p_axis)); |
| 82 | } |
| 83 | |
| 84 | void SpringBoneSimulator3D::_bind_compatibility_methods() { |
| 85 | ClassDB::bind_compatibility_method(D_METHOD("get_end_bone_direction", "index"), &SpringBoneSimulator3D::_get_end_bone_direction_bind_compat_110120); |
| 86 | ClassDB::bind_compatibility_method(D_METHOD("set_end_bone_direction", "index", "bone_direction"), &SpringBoneSimulator3D::_set_end_bone_direction_bind_compat_110120); |
| 87 | ClassDB::bind_compatibility_method(D_METHOD("get_rotation_axis", "index"), &SpringBoneSimulator3D::_get_rotation_axis_bind_compat_110120); |
| 88 | ClassDB::bind_compatibility_method(D_METHOD("set_rotation_axis", "index", "axis"), &SpringBoneSimulator3D::_set_rotation_axis_bind_compat_110120); |
| 89 | ClassDB::bind_compatibility_method(D_METHOD("get_joint_rotation_axis", "index", "joint"), &SpringBoneSimulator3D::_get_joint_rotation_axis_bind_compat_110120); |
| 90 | ClassDB::bind_compatibility_method(D_METHOD("set_joint_rotation_axis", "index", "joint", "axis"), &SpringBoneSimulator3D::_set_joint_rotation_axis_bind_compat_110120); |
| 91 | } |
| 92 | |
| 93 | #endif // DISABLE_DEPRECATED |