header cleanup (no functional changes)
[blender.git] / source / blender / blenkernel / intern / bullet.c
1 /*
2  * $Id$
3  *
4  * ***** BEGIN GPL LICENSE BLOCK *****
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software Foundation,
18  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  *
20  * The Original Code is Copyright (C) Blender Foundation
21  * All rights reserved.
22  *
23  * The Original Code is: all of this file.
24  *
25  * Contributor(s): none yet.
26  *
27  * ***** END GPL LICENSE BLOCK *****
28  */
29
30 /** \file blender/blenkernel/intern/bullet.c
31  *  \ingroup bke
32  */
33
34
35 #include "MEM_guardedalloc.h"
36
37 /* types */
38 #include "DNA_object_force.h"   /* here is the softbody struct */
39
40 #include "BKE_bullet.h"
41
42
43 /* ************ Object level, exported functions *************** */
44
45 /* allocates and initializes general main data */
46 BulletSoftBody *bsbNew(void)
47 {
48         BulletSoftBody *bsb;
49         
50         bsb= MEM_callocN(sizeof(BulletSoftBody), "bulletsoftbody");
51                 
52         bsb->flag = OB_BSB_BENDING_CONSTRAINTS | OB_BSB_SHAPE_MATCHING | OB_BSB_AERO_VPOINT;
53         bsb->linStiff = 0.5f;
54         bsb->angStiff = 1.0f;
55         bsb->volume = 1.0f;
56
57         
58         bsb->viterations        =       0;
59         bsb->piterations        =       2;      
60         bsb->diterations        =       0;
61         bsb->citerations        =       4;
62         
63         bsb->kSRHR_CL           =       0.1f;
64         bsb->kSKHR_CL           =       1.f;
65         bsb->kSSHR_CL           =       0.5f;
66         bsb->kSR_SPLT_CL        =       0.5f;
67         
68         bsb->kSK_SPLT_CL        =       0.5f;
69         bsb->kSS_SPLT_CL        =       0.5f;
70         bsb->kVCF                       =       1;
71         bsb->kDP                        =       0;
72
73         bsb->kDG                        =       0;
74         bsb->kLF                        =       0;
75         bsb->kPR                        =       0;
76         bsb->kVC                        =       0;
77
78         bsb->kDF                        =       0.2f;
79         bsb->kMT                        =       0.05;
80         bsb->kCHR                       =       1.0f;
81         bsb->kKHR                       =       0.1f;
82
83         bsb->kSHR                       =       1.0f;
84         bsb->kAHR                       =       0.7f;
85         
86         bsb->collisionflags = 0;
87         //bsb->collisionflags = OB_BSB_COL_CL_RS + OB_BSB_COL_CL_SS;
88         bsb->numclusteriterations = 64;
89         bsb->welding = 0.f;
90
91         return bsb;
92 }
93
94 /* frees all */
95 void bsbFree(BulletSoftBody *bsb)
96 {
97         /* no internal data yet */
98         MEM_freeN(bsb);
99 }
100
101