summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2018-08-19 12:09:41 +0200
committerRémi Verschelde <rverschelde@gmail.com>2018-08-19 12:09:41 +0200
commit238a78f13f337c8d86a0b7a7af1c752b274e54a3 (patch)
tree81e7423f212a9d07c0d4b4fc24acc15b4d96d369
parent94908f08e530a409b6b90829aa85533758cd2d4e (diff)
Fix compiling SkeletonIK with disable_3d
Fixes #20825.
-rw-r--r--scene/animation/skeleton_ik.cpp4
-rw-r--r--scene/animation/skeleton_ik.h4
-rw-r--r--scene/register_scene_types.cpp6
3 files changed, 11 insertions, 3 deletions
diff --git a/scene/animation/skeleton_ik.cpp b/scene/animation/skeleton_ik.cpp
index 4991cedfab..9b1cb1369a 100644
--- a/scene/animation/skeleton_ik.cpp
+++ b/scene/animation/skeleton_ik.cpp
@@ -34,6 +34,8 @@
#include "skeleton_ik.h"
+#ifndef _3D_DISABLED
+
FabrikInverseKinematic::ChainItem *FabrikInverseKinematic::ChainItem::find_child(const BoneId p_bone_id) {
for (int i = childs.size() - 1; 0 <= i; --i) {
if (p_bone_id == childs[i].bone) {
@@ -549,3 +551,5 @@ void SkeletonIK::_solve_chain() {
return;
FabrikInverseKinematic::solve(task, interpolation, use_magnet, magnet_position);
}
+
+#endif // _3D_DISABLED
diff --git a/scene/animation/skeleton_ik.h b/scene/animation/skeleton_ik.h
index 366c599c01..08fb00e798 100644
--- a/scene/animation/skeleton_ik.h
+++ b/scene/animation/skeleton_ik.h
@@ -31,6 +31,8 @@
#ifndef SKELETON_IK_H
#define SKELETON_IK_H
+#ifndef _3D_DISABLED
+
/**
* @author AndreaCatania
*/
@@ -209,4 +211,6 @@ private:
void _solve_chain();
};
+#endif // _3D_DISABLED
+
#endif // SKELETON_IK_H
diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp
index 382bddfb4e..d066814069 100644
--- a/scene/register_scene_types.cpp
+++ b/scene/register_scene_types.cpp
@@ -51,7 +51,6 @@
#include "scene/2d/parallax_background.h"
#include "scene/2d/parallax_layer.h"
#include "scene/2d/particles_2d.h"
-
#include "scene/2d/path_2d.h"
#include "scene/2d/physics_body_2d.h"
#include "scene/2d/polygon_2d.h"
@@ -366,14 +365,12 @@ void register_scene_types() {
ClassDB::register_class<Spatial>();
ClassDB::register_virtual_class<SpatialGizmo>();
ClassDB::register_class<Skeleton>();
- ClassDB::register_class<SkeletonIK>();
ClassDB::register_class<AnimationPlayer>();
ClassDB::register_class<Tween>();
OS::get_singleton()->yield(); //may take time to init
#ifndef _3D_DISABLED
- ClassDB::register_class<BoneAttachment>();
ClassDB::register_virtual_class<VisualInstance>();
ClassDB::register_virtual_class<GeometryInstance>();
ClassDB::register_class<Camera>();
@@ -438,6 +435,9 @@ void register_scene_types() {
ClassDB::register_class<PhysicalBone>();
ClassDB::register_class<SoftBody>();
+ ClassDB::register_class<SkeletonIK>();
+ ClassDB::register_class<BoneAttachment>();
+
ClassDB::register_class<VehicleBody>();
ClassDB::register_class<VehicleWheel>();
ClassDB::register_class<Area>();