Blender V2.61 - r43446
|
00001 /* 00002 * ***** BEGIN GPL LICENSE BLOCK ***** 00003 * 00004 * This program is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU General Public License 00006 * as published by the Free Software Foundation; either version 2 00007 * of the License, or (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software Foundation, 00016 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00017 * 00018 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. 00019 * All rights reserved. 00020 * 00021 * The Original Code is: all of this file. 00022 * 00023 * Original author: Laurence 00024 * Contributor(s): Brecht 00025 * 00026 * ***** END GPL LICENSE BLOCK ***** 00027 */ 00028 00068 #ifndef NAN_INCLUDED_IK_solver_h 00069 #define NAN_INCLUDED_IK_solver_h 00070 00071 #ifdef __cplusplus 00072 extern "C" { 00073 #endif 00074 00110 typedef void IK_Segment; 00111 00112 enum IK_SegmentFlag { 00113 IK_XDOF = 1, 00114 IK_YDOF = 2, 00115 IK_ZDOF = 4, 00116 IK_TRANS_XDOF = 8, 00117 IK_TRANS_YDOF = 16, 00118 IK_TRANS_ZDOF = 32 00119 }; 00120 00121 typedef enum IK_SegmentAxis { 00122 IK_X = 0, 00123 IK_Y = 1, 00124 IK_Z = 2, 00125 IK_TRANS_X = 3, 00126 IK_TRANS_Y = 4, 00127 IK_TRANS_Z = 5 00128 } IK_SegmentAxis; 00129 00130 extern IK_Segment *IK_CreateSegment(int flag); 00131 extern void IK_FreeSegment(IK_Segment *seg); 00132 00133 extern void IK_SetParent(IK_Segment *seg, IK_Segment *parent); 00134 extern void IK_SetTransform(IK_Segment *seg, float start[3], float rest_basis[][3], float basis[][3], float length); 00135 extern void IK_SetLimit(IK_Segment *seg, IK_SegmentAxis axis, float lmin, float lmax); 00136 extern void IK_SetStiffness(IK_Segment *seg, IK_SegmentAxis axis, float stiffness); 00137 00138 extern void IK_GetBasisChange(IK_Segment *seg, float basis_change[][3]); 00139 extern void IK_GetTranslationChange(IK_Segment *seg, float *translation_change); 00140 00154 typedef void IK_Solver; 00155 00156 IK_Solver *IK_CreateSolver(IK_Segment *root); 00157 void IK_FreeSolver(IK_Solver *solver); 00158 00159 void IK_SolverAddGoal(IK_Solver *solver, IK_Segment *tip, float goal[3], float weight); 00160 void IK_SolverAddGoalOrientation(IK_Solver *solver, IK_Segment *tip, float goal[][3], float weight); 00161 void IK_SolverSetPoleVectorConstraint(IK_Solver *solver, IK_Segment *tip, float goal[3], float polegoal[3], float poleangle, int getangle); 00162 float IK_SolverGetPoleAngle(IK_Solver *solver); 00163 00164 int IK_Solve(IK_Solver *solver, float tolerance, int max_iterations); 00165 00166 00167 #ifdef __cplusplus 00168 } 00169 #endif 00170 00171 #endif // NAN_INCLUDED_IK_solver_h 00172