Blender V2.61 - r43446

BIK_api.h

Go to the documentation of this file.
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: Benoit Bolsee
00024  * Contributor(s): 
00025  *
00026  * ***** END GPL LICENSE BLOCK *****
00027  */
00028 
00034 #ifndef BIK_API_H
00035 #define BIK_API_H
00036 
00037 #ifdef __cplusplus
00038 extern "C" {
00039 #endif
00040 
00041 struct Object;
00042 struct bPoseChannel;
00043 struct bPose;
00044 struct bArmature;
00045 struct Scene;
00046 struct bConstraint;
00047 
00048 enum BIK_ParamType {
00049     BIK_PARAM_TYPE_FLOAT = 0,
00050     BIK_PARAM_TYPE_INT,
00051     BIK_PARAM_TYPE_STRING,
00052 };
00053 
00054 struct BIK_ParamValue {
00055     short type;         /* BIK_PARAM_TYPE_.. */
00056     short length;       /* for string, does not include terminating 0 */
00057     union {
00058         float f[8];
00059         int   i[8];
00060         char  s[32];
00061     } value;        
00062 };
00063 typedef struct BIK_ParamValue BIK_ParamValue;
00064 
00065 void BIK_initialize_tree(struct Scene *scene, struct Object *ob, float ctime);
00066 void BIK_execute_tree(struct Scene *scene, struct Object *ob, struct bPoseChannel *pchan, float ctime);
00067 void BIK_release_tree(struct Scene *scene, struct Object *ob, float ctime);
00068 void BIK_clear_data(struct bPose *pose);
00069 void BIK_clear_cache(struct bPose *pose);
00070 void BIK_update_param(struct bPose *pose);
00071 void BIK_test_constraint(struct Object *ob, struct bConstraint *cons);
00072 // not yet implemented
00073 int BIK_get_constraint_param(struct bPose *pose, struct bConstraint *cons, int id, BIK_ParamValue *value);
00074 int BIK_get_channel_param(struct bPose *pose, struct bPoseChannel *pchan, int id, BIK_ParamValue *value);
00075 int BIK_get_solver_param(struct bPose *pose, struct bPoseChannel *pchan, int id, BIK_ParamValue *value);
00076 
00077 // number of solver available
00078 // 0 = iksolver
00079 // 1 = iTaSC
00080 
00081 /* for use in BIK_get_constraint_param */
00082 #define BIK_PARAM_CONSTRAINT_ERROR      0
00083 
00084 /* for use in BIK_get_channel_param */
00085 #define BIK_PARAM_CHANNEL_JOINT         0
00086 
00087 /* for use in BIK_get_solver_param */
00088 #define BIK_PARAM_SOLVER_RANK           0
00089 #define BIK_PARAM_SOLVER_ITERATION      1
00090 
00091 #ifdef __cplusplus
00092 }
00093 #endif
00094 
00095 #endif // BIK_API_H
00096