~diresu/blender/blender-command-port

« back to all changes in this revision

Viewing changes to source/blender/blenkernel/BKE_softbody.h

  • Committer: theeth
  • Date: 2008-10-14 16:52:04 UTC
  • Revision ID: vcs-imports@canonical.com-20081014165204-r32w2gm6s0osvdhn
copy back trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * BKE_softbody.h 
 
3
 *      
 
4
 * $Id: BKE_softbody.h 
 
5
 *
 
6
 * ***** BEGIN GPL LICENSE BLOCK *****
 
7
 *
 
8
 * This program is free software; you can redistribute it and/or
 
9
 * modify it under the terms of the GNU General Public License
 
10
 * as published by the Free Software Foundation; either version 2
 
11
 * of the License, or (at your option) any later version.
 
12
 *
 
13
 * This program is distributed in the hope that it will be useful,
 
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
16
 * GNU General Public License for more details.
 
17
 *
 
18
 * You should have received a copy of the GNU General Public License
 
19
 * along with this program; if not, write to the Free Software Foundation,
 
20
 * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
21
 *
 
22
 * The Original Code is Copyright (C) Blender Foundation.
 
23
 * All rights reserved.
 
24
 *
 
25
 * The Original Code is: all of this file.
 
26
 *
 
27
 * Contributor(s): none yet.
 
28
 *
 
29
 * ***** END GPL LICENSE BLOCK *****
 
30
 */
 
31
#ifndef BKE_SOFTBODY_H
 
32
#define BKE_SOFTBODY_H
 
33
 
 
34
struct Object;
 
35
struct SoftBody;
 
36
 
 
37
typedef struct BodyPoint {
 
38
        float origS[3], origE[3], origT[3], pos[3], vec[3], force[3];
 
39
        float goal;
 
40
        float prevpos[3], prevvec[3], prevdx[3], prevdv[3]; /* used for Heun integration */
 
41
    float impdv[3],impdx[3];
 
42
    int nofsprings; int *springs;
 
43
        float choke,choke2,frozen;
 
44
        float colball;
 
45
        short flag;
 
46
        char octantflag;
 
47
} BodyPoint;
 
48
 
 
49
/* allocates and initializes general main data */
 
50
extern struct SoftBody  *sbNew(void);
 
51
 
 
52
/* frees internal data and softbody itself */
 
53
extern void                             sbFree(struct SoftBody *sb);
 
54
 
 
55
/* frees simulation data to reset simulation */
 
56
extern void                             sbFreeSimulation(struct SoftBody *sb);
 
57
 
 
58
/* do one simul step, reading and writing vertex locs from given array */
 
59
extern void                             sbObjectStep(struct Object *ob, float framnr, float (*vertexCos)[3], int numVerts);
 
60
 
 
61
/* makes totally fresh start situation, resets time */
 
62
extern void                             sbObjectToSoftbody(struct Object *ob);
 
63
 
 
64
/* links the softbody module to a 'test for Interrupt' function */
 
65
/* pass NULL to unlink again */
 
66
extern void             sbSetInterruptCallBack(int (*f)(void));
 
67
 
 
68
/* writing to cache for bake editing */
 
69
extern void                     sbWriteCache(struct Object *ob, int framenr);
 
70
 
 
71
#endif
 
72