1$#include "IK/IKSolver.h"
2
3class IKSolver : public Component
4{
5    enum Algorithm
6    {
7        ONE_BONE = 0,
8        TWO_BONE,
9        FABRIK
10    };
11
12    enum Feature
13    {
14        JOINT_ROTATIONS = 0x01,
15        TARGET_ROTATIONS = 0x02,
16        UPDATE_ORIGINAL_POSE = 0x04,
17        UPDATE_ACTIVE_POSE = 0x08,
18        USE_ORIGINAL_POSE = 0x10,
19        CONSTRAINTS = 0x20,
20        AUTO_SOLVE = 0x40
21    };
22
23    void RebuildChainTrees();
24    void RecalculateSegmentLengths();
25    void CalculateJointRotations();
26    void Solve();
27
28    void ApplyOriginalPoseToScene();
29    void ApplySceneToOriginalPose();
30    void ApplyActivePoseToScene();
31    void ApplySceneToActivePose();
32    void ApplyOriginalPoseToActivePose();
33
34    void DrawDebugGeometry(bool depthTest);
35
36    tolua_property__get_set Algorithm algorithm;
37    tolua_property__get_set unsigned maximumIterations;
38    tolua_property__get_set float tolerance;
39
40    tolua_property__get_set bool JOINT_ROTATIONS;
41    tolua_property__get_set bool TARGET_ROTATIONS;
42    tolua_property__get_set bool UPDATE_ORIGINAL_POSE;
43    tolua_property__get_set bool UPDATE_ACTIVE_POSE;
44    tolua_property__get_set bool USE_ORIGINAL_POSE;
45    tolua_property__get_set bool CONSTRAINTS;
46    tolua_property__get_set bool AUTO_SOLVE;
47};
48