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