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