|
Blender
V2.59
|
00001 /* 00002 * $Id: BIK_api.h 35240 2011-02-27 20:24:49Z jesterking $ 00003 * ***** BEGIN GPL LICENSE BLOCK ***** 00004 * 00005 * This program is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU General Public License 00007 * as published by the Free Software Foundation; either version 2 00008 * of the License, or (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software Foundation, 00017 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00018 * 00019 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. 00020 * All rights reserved. 00021 * 00022 * The Original Code is: all of this file. 00023 * 00024 * Original author: Benoit Bolsee 00025 * Contributor(s): 00026 * 00027 * ***** END GPL LICENSE BLOCK ***** 00028 */ 00029 00035 #ifndef BIK_API_H 00036 #define BIK_API_H 00037 00038 #ifdef __cplusplus 00039 extern "C" { 00040 #endif 00041 00042 struct Object; 00043 struct bPoseChannel; 00044 struct bPose; 00045 struct bArmature; 00046 struct Scene; 00047 struct bConstraint; 00048 00049 enum BIK_ParamType { 00050 BIK_PARAM_TYPE_FLOAT = 0, 00051 BIK_PARAM_TYPE_INT, 00052 BIK_PARAM_TYPE_STRING, 00053 }; 00054 00055 struct BIK_ParamValue { 00056 short type; /* BIK_PARAM_TYPE_.. */ 00057 short length; /* for string, does not include terminating 0 */ 00058 union { 00059 float f[8]; 00060 int i[8]; 00061 char s[32]; 00062 } value; 00063 }; 00064 typedef struct BIK_ParamValue BIK_ParamValue; 00065 00066 void BIK_initialize_tree(struct Scene *scene, struct Object *ob, float ctime); 00067 void BIK_execute_tree(struct Scene *scene, struct Object *ob, struct bPoseChannel *pchan, float ctime); 00068 void BIK_release_tree(struct Scene *scene, struct Object *ob, float ctime); 00069 void BIK_clear_data(struct bPose *pose); 00070 void BIK_clear_cache(struct bPose *pose); 00071 void BIK_update_param(struct bPose *pose); 00072 void BIK_test_constraint(struct Object *ob, struct bConstraint *cons); 00073 // not yet implemented 00074 int BIK_get_constraint_param(struct bPose *pose, struct bConstraint *cons, int id, BIK_ParamValue *value); 00075 int BIK_get_channel_param(struct bPose *pose, struct bPoseChannel *pchan, int id, BIK_ParamValue *value); 00076 int BIK_get_solver_param(struct bPose *pose, struct bPoseChannel *pchan, int id, BIK_ParamValue *value); 00077 00078 // number of solver available 00079 // 0 = iksolver 00080 // 1 = iTaSC 00081 00082 /* for use in BIK_get_constraint_param */ 00083 #define BIK_PARAM_CONSTRAINT_ERROR 0 00084 00085 /* for use in BIK_get_channel_param */ 00086 #define BIK_PARAM_CHANNEL_JOINT 0 00087 00088 /* for use in BIK_get_solver_param */ 00089 #define BIK_PARAM_SOLVER_RANK 0 00090 #define BIK_PARAM_SOLVER_ITERATION 1 00091 00092 #ifdef __cplusplus 00093 } 00094 #endif 00095 00096 #endif // BIK_API_H 00097