00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __CT_IK_H__
00022 #define __CT_IK_H__
00023
00024 #include "csphyzik/solver.h"
00025
00030 #define DEFAULT_MAX_QV 0.5;
00031
00032 class ctArticulatedBody;
00033
00038 class ctInverseKinematics : public ctArticulatedGoalSolver
00039 {
00040 public:
00041 ctInverseKinematics( ctArticulatedBody &pab )
00042 : ab( pab ) { max_qv = DEFAULT_MAX_QV; };
00043
00044 virtual void solve( real t );
00045
00046
00047 ctVector3 get_linear_a ()
00048 { return ctVector3(0.0, 0.0, 0.0); }
00049
00050 ctVector3 get_angular_a ()
00051 { return ctVector3(0.0, 0.0, 0.0); }
00052
00053 void apply_impulse ( ctVector3 , ctVector3 )
00054 {};
00055
00056 void get_impulse_m_and_I_inv ( real* , ctMatrix3* ,
00057 const ctVector3& ,
00058 const ctVector3& ) {}
00059
00060
00061 protected:
00062 void solve_IK ( real t, ctVector3 &the_goal, ctVector3 &end_effector );
00063 void compute_joint_angle ( real t,
00064 ctVector3 &the_goal, ctVector3 &end_effector );
00065 ctArticulatedBody &ab;
00066 real max_qv;
00067
00068 };
00069
00070 #endif // __CT_IK_H__