Blender V2.61 - r43446

BKE_softbody.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) Blender Foundation.
00019  * All rights reserved.
00020  *
00021  * The Original Code is: all of this file.
00022  *
00023  * Contributor(s): none yet.
00024  *
00025  * ***** END GPL LICENSE BLOCK *****
00026  */
00027 #ifndef BKE_SOFTBODY_H
00028 #define BKE_SOFTBODY_H
00029 
00034 struct Object;
00035 struct Scene;
00036 struct SoftBody;
00037 
00038 typedef struct BodyPoint {
00039     float origS[3], origE[3], origT[3], pos[3], vec[3], force[3];
00040     float goal;
00041     float prevpos[3], prevvec[3], prevdx[3], prevdv[3]; /* used for Heun integration */
00042     float impdv[3],impdx[3];
00043     int nofsprings; int *springs;
00044     float choke,choke2,frozen;
00045     float colball;
00046     short loc_flag; //reserved by locale module specific states
00047     //char octantflag;
00048     float mass;
00049     float springweight;
00050 } BodyPoint;
00051 
00052 /* allocates and initializes general main data */
00053 extern struct SoftBody  *sbNew(struct Scene *scene);
00054 
00055 /* frees internal data and softbody itself */
00056 extern void             sbFree(struct SoftBody *sb);
00057 
00058 /* frees simulation data to reset simulation */
00059 extern void             sbFreeSimulation(struct SoftBody *sb);
00060 
00061 /* do one simul step, reading and writing vertex locs from given array */
00062 extern void             sbObjectStep(struct Scene *scene, struct Object *ob, float framnr, float (*vertexCos)[3], int numVerts);
00063 
00064 /* makes totally fresh start situation, resets time */
00065 extern void             sbObjectToSoftbody(struct Object *ob);
00066 
00067 /* links the softbody module to a 'test for Interrupt' function */
00068 /* pass NULL to unlink again */
00069 extern void             sbSetInterruptCallBack(int (*f)(void));
00070 
00071 extern void             SB_estimate_transform(Object *ob,float lloc[3],float lrot[3][3],float lscale[3][3]);
00072 
00073 
00074 #endif
00075