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