SVN maintenance.
[blender.git] / source / blender / modifiers / intern / MOD_softbody.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) 2005 by the Blender Foundation.
21 * All rights reserved.
22 *
23 * Contributor(s): Daniel Dunbar
24 *                 Ton Roosendaal,
25 *                 Ben Batt,
26 *                 Brecht Van Lommel,
27 *                 Campbell Barton
28 *
29 * ***** END GPL LICENSE BLOCK *****
30 *
31 */
32
33 #include "stddef.h"
34 #include "string.h"
35 #include "stdarg.h"
36 #include "math.h"
37 #include "float.h"
38
39 #include "BLI_kdtree.h"
40 #include "BLI_rand.h"
41 #include "BLI_uvproject.h"
42
43 #include "MEM_guardedalloc.h"
44
45 #include "DNA_armature_types.h"
46 #include "DNA_camera_types.h"
47 #include "DNA_curve_types.h"
48 #include "DNA_key_types.h"
49 #include "DNA_material_types.h"
50 #include "DNA_object_fluidsim.h"
51
52
53 #include "BKE_action.h"
54 #include "BKE_bmesh.h"
55 #include "BKE_cloth.h"
56 #include "BKE_cdderivedmesh.h"
57 #include "BKE_displist.h"
58 #include "BKE_fluidsim.h"
59 #include "BKE_global.h"
60 #include "BKE_multires.h"
61 #include "BKE_key.h"
62 #include "BKE_lattice.h"
63 #include "BKE_material.h"
64 #include "BKE_mesh.h"
65 #include "BKE_modifier.h"
66 #include "BKE_object.h"
67 #include "BKE_paint.h"
68 #include "BKE_particle.h"
69 #include "BKE_pointcache.h"
70 #include "BKE_scene.h"
71 #include "BKE_smoke.h"
72 #include "BKE_softbody.h"
73 #include "BKE_subsurf.h"
74 #include "BKE_texture.h"
75
76 #include "depsgraph_private.h"
77 #include "BKE_deform.h"
78 #include "BKE_shrinkwrap.h"
79
80 #include "LOD_decimation.h"
81
82 #include "CCGSubSurf.h"
83
84 #include "RE_shader_ext.h"
85
86 #include "MOD_modifiertypes.h"
87
88 static void deformVerts(
89                                          ModifierData *md, Object *ob, DerivedMesh *derivedData,
90           float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc)
91 {
92         sbObjectStep(md->scene, ob, (float)md->scene->r.cfra, vertexCos, numVerts);
93 }
94
95 static int dependsOnTime(ModifierData *md)
96 {
97         return 1;
98 }
99
100
101 ModifierTypeInfo modifierType_Softbody = {
102         /* name */              "Softbody",
103         /* structName */        "SoftbodyModifierData",
104         /* structSize */        sizeof(SoftbodyModifierData),
105         /* type */              eModifierTypeType_OnlyDeform,
106         /* flags */             eModifierTypeFlag_AcceptsCVs
107                                                         | eModifierTypeFlag_RequiresOriginalData
108                                                         | eModifierTypeFlag_Single,
109
110         /* copyData */          0,
111         /* deformVerts */       deformVerts,
112         /* deformVertsEM */     0,
113         /* deformMatricesEM */  0,
114         /* applyModifier */     0,
115         /* applyModifierEM */   0,
116         /* initData */          0,
117         /* requiredDataMask */  0,
118         /* freeData */          0,
119         /* isDisabled */        0,
120         /* updateDepgraph */    0,
121         /* dependsOnTime */     dependsOnTime,
122         /* foreachObjectLink */ 0,
123         /* foreachIDLink */     0,
124 };