Fix compiling SkeletonIK with disable_3d

Fixes #20825.
This commit is contained in:
Rémi Verschelde 2018-08-19 12:09:41 +02:00
parent 94908f08e5
commit 238a78f13f
3 changed files with 11 additions and 3 deletions

View file

@ -34,6 +34,8 @@
#include "skeleton_ik.h" #include "skeleton_ik.h"
#ifndef _3D_DISABLED
FabrikInverseKinematic::ChainItem *FabrikInverseKinematic::ChainItem::find_child(const BoneId p_bone_id) { FabrikInverseKinematic::ChainItem *FabrikInverseKinematic::ChainItem::find_child(const BoneId p_bone_id) {
for (int i = childs.size() - 1; 0 <= i; --i) { for (int i = childs.size() - 1; 0 <= i; --i) {
if (p_bone_id == childs[i].bone) { if (p_bone_id == childs[i].bone) {
@ -549,3 +551,5 @@ void SkeletonIK::_solve_chain() {
return; return;
FabrikInverseKinematic::solve(task, interpolation, use_magnet, magnet_position); FabrikInverseKinematic::solve(task, interpolation, use_magnet, magnet_position);
} }
#endif // _3D_DISABLED

View file

@ -31,6 +31,8 @@
#ifndef SKELETON_IK_H #ifndef SKELETON_IK_H
#define SKELETON_IK_H #define SKELETON_IK_H
#ifndef _3D_DISABLED
/** /**
* @author AndreaCatania * @author AndreaCatania
*/ */
@ -209,4 +211,6 @@ private:
void _solve_chain(); void _solve_chain();
}; };
#endif // _3D_DISABLED
#endif // SKELETON_IK_H #endif // SKELETON_IK_H

View file

@ -51,7 +51,6 @@
#include "scene/2d/parallax_background.h" #include "scene/2d/parallax_background.h"
#include "scene/2d/parallax_layer.h" #include "scene/2d/parallax_layer.h"
#include "scene/2d/particles_2d.h" #include "scene/2d/particles_2d.h"
#include "scene/2d/path_2d.h" #include "scene/2d/path_2d.h"
#include "scene/2d/physics_body_2d.h" #include "scene/2d/physics_body_2d.h"
#include "scene/2d/polygon_2d.h" #include "scene/2d/polygon_2d.h"
@ -366,14 +365,12 @@ void register_scene_types() {
ClassDB::register_class<Spatial>(); ClassDB::register_class<Spatial>();
ClassDB::register_virtual_class<SpatialGizmo>(); ClassDB::register_virtual_class<SpatialGizmo>();
ClassDB::register_class<Skeleton>(); ClassDB::register_class<Skeleton>();
ClassDB::register_class<SkeletonIK>();
ClassDB::register_class<AnimationPlayer>(); ClassDB::register_class<AnimationPlayer>();
ClassDB::register_class<Tween>(); ClassDB::register_class<Tween>();
OS::get_singleton()->yield(); //may take time to init OS::get_singleton()->yield(); //may take time to init
#ifndef _3D_DISABLED #ifndef _3D_DISABLED
ClassDB::register_class<BoneAttachment>();
ClassDB::register_virtual_class<VisualInstance>(); ClassDB::register_virtual_class<VisualInstance>();
ClassDB::register_virtual_class<GeometryInstance>(); ClassDB::register_virtual_class<GeometryInstance>();
ClassDB::register_class<Camera>(); ClassDB::register_class<Camera>();
@ -438,6 +435,9 @@ void register_scene_types() {
ClassDB::register_class<PhysicalBone>(); ClassDB::register_class<PhysicalBone>();
ClassDB::register_class<SoftBody>(); ClassDB::register_class<SoftBody>();
ClassDB::register_class<SkeletonIK>();
ClassDB::register_class<BoneAttachment>();
ClassDB::register_class<VehicleBody>(); ClassDB::register_class<VehicleBody>();
ClassDB::register_class<VehicleWheel>(); ClassDB::register_class<VehicleWheel>();
ClassDB::register_class<Area>(); ClassDB::register_class<Area>();