Blender V2.61 - r43446

MOD_softbody.c

Go to the documentation of this file.
00001 /*
00002  * ***** BEGIN GPL LICENSE BLOCK *****
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software  Foundation,
00016  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  *
00018  * The Original Code is Copyright (C) 2005 by the Blender Foundation.
00019  * All rights reserved.
00020  *
00021  * Contributor(s): Daniel Dunbar
00022  *                 Ton Roosendaal,
00023  *                 Ben Batt,
00024  *                 Brecht Van Lommel,
00025  *                 Campbell Barton
00026  *
00027  * ***** END GPL LICENSE BLOCK *****
00028  *
00029  */
00030 
00035 #include <stdio.h>
00036 
00037 #include "DNA_scene_types.h"
00038 
00039 #include "BLI_utildefines.h"
00040 
00041 #include "BKE_cdderivedmesh.h"
00042 #include "BKE_particle.h"
00043 #include "BKE_softbody.h"
00044 
00045 #include "MOD_modifiertypes.h"
00046 
00047 static void deformVerts(ModifierData *md, Object *ob,
00048                         DerivedMesh *UNUSED(derivedData),
00049                         float (*vertexCos)[3],
00050                         int numVerts,
00051                         int UNUSED(useRenderParams),
00052                         int UNUSED(isFinalCalc))
00053 {
00054     sbObjectStep(md->scene, ob, (float)md->scene->r.cfra, vertexCos, numVerts);
00055 }
00056 
00057 static int dependsOnTime(ModifierData *UNUSED(md))
00058 {
00059     return 1;
00060 }
00061 
00062 
00063 ModifierTypeInfo modifierType_Softbody = {
00064     /* name */              "Softbody",
00065     /* structName */        "SoftbodyModifierData",
00066     /* structSize */        sizeof(SoftbodyModifierData),
00067     /* type */              eModifierTypeType_OnlyDeform,
00068     /* flags */             eModifierTypeFlag_AcceptsCVs
00069                             | eModifierTypeFlag_RequiresOriginalData
00070                             | eModifierTypeFlag_Single,
00071 
00072     /* copyData */          NULL,
00073     /* deformVerts */       deformVerts,
00074     /* deformMatrices */    NULL,
00075     /* deformVertsEM */     NULL,
00076     /* deformMatricesEM */  NULL,
00077     /* applyModifier */     NULL,
00078     /* applyModifierEM */   NULL,
00079     /* initData */          NULL,
00080     /* requiredDataMask */  NULL,
00081     /* freeData */          NULL,
00082     /* isDisabled */        NULL,
00083     /* updateDepgraph */    NULL,
00084     /* dependsOnTime */     dependsOnTime,
00085     /* dependsOnNormals */  NULL,
00086     /* foreachObjectLink */ NULL,
00087     /* foreachIDLink */     NULL,
00088     /* foreachTexLink */    NULL,
00089 };