~ubuntu-branches/ubuntu/maverick/blender/maverick

« back to all changes in this revision

Viewing changes to source/blender/blenkernel/intern/bullet.c

  • Committer: Bazaar Package Importer
  • Author(s): Khashayar Naderehvandi, Khashayar Naderehvandi, Alessio Treglia
  • Date: 2009-01-22 16:53:59 UTC
  • mfrom: (14.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20090122165359-v0996tn7fbit64ni
Tags: 2.48a+dfsg-1ubuntu1
[ Khashayar Naderehvandi ]
* Merge from debian experimental (LP: #320045), Ubuntu remaining changes:
  - Add patch correcting header file locations.
  - Add libvorbis-dev and libgsm1-dev to Build-Depends.
  - Use avcodec_decode_audio2() in source/blender/src/hddaudio.c

[ Alessio Treglia ]
* Add missing previous changelog entries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*  
 
2
 * 
 
3
 * $Id: bullet.c 17028 2008-10-11 20:52:43Z erwin $
 
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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, 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
 
 
86
        return bsb;
 
87
}
 
88
 
 
89
/* frees all */
 
90
void bsbFree(BulletSoftBody *bsb)
 
91
{
 
92
        /* no internal data yet */
 
93
        MEM_freeN(bsb);
 
94
}
 
95
 
 
96