merge with/from trunk at r35190
[blender.git] / source / blender / modifiers / intern / MOD_collision.c
index fd43e057144a0e8e41a2e13dcee512d08ec07c6c..07b35cdf3346ff99b3a107c508b7af16820ed671 100644 (file)
 *
 */
 
+/** \file blender/modifiers/intern/MOD_collision.c
+ *  \ingroup modifiers
+ */
+
+
 #include "DNA_scene_types.h"
 #include "DNA_object_types.h"
 #include "DNA_meshdata_types.h"
@@ -37,6 +42,8 @@
 #include "MEM_guardedalloc.h"
 
 #include "BLI_math.h"
+#include "BLI_utildefines.h"
+
 
 #include "BKE_collision.h"
 #include "BKE_cdderivedmesh.h"
@@ -46,6 +53,7 @@
 #include "BKE_pointcache.h"
 #include "BKE_scene.h"
 
+#include "MOD_util.h"
 
 static void initData(ModifierData *md) 
 {
@@ -94,19 +102,20 @@ static void freeData(ModifierData *md)
        }
 }
 
-static int dependsOnTime(ModifierData *md)
+static int dependsOnTime(ModifierData *UNUSED(md))
 {
        return 1;
 }
 
-static void deformVerts(
-                                         ModifierData *md, Object *ob, DerivedMesh *derivedData,
-          float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc)
+static void deformVerts(ModifierData *md, Object *ob,
+                                               DerivedMesh *derivedData,
+                                               float (*vertexCos)[3],
+                                               int UNUSED(numVerts),
+                                               int UNUSED(useRenderParams),
+                                               int UNUSED(isFinalCalc))
 {
        CollisionModifierData *collmd = (CollisionModifierData*) md;
        DerivedMesh *dm = NULL;
-       float current_time = 0;
-       unsigned int numverts = 0, i = 0;
        MVert *tempVert = NULL;
        
        /* if possible use/create DerivedMesh */
@@ -121,6 +130,9 @@ static void deformVerts(
        
        if(dm)
        {
+               float current_time = 0;
+               unsigned int numverts = 0;
+
                CDDM_apply_vert_coords(dm, vertexCos);
                CDDM_calc_normals(dm);
                
@@ -132,7 +144,9 @@ static void deformVerts(
                numverts = dm->getNumVerts ( dm );
                
                if((current_time > collmd->time)|| (BKE_ptcache_get_continue_physics()))
-               {       
+               {
+                       unsigned int i;
+
                        // check if mesh has changed
                        if(collmd->x && (numverts != collmd->numverts))
                                freeData((ModifierData *)collmd);
@@ -238,6 +252,7 @@ ModifierTypeInfo modifierType_Collision = {
 
        /* copyData */          0,
        /* deformVerts */       deformVerts,
+       /* deformMatrices */    0,
        /* deformVertsEM */     0,
        /* deformMatricesEM */  0,
        /* applyModifier */     0,
@@ -248,6 +263,7 @@ ModifierTypeInfo modifierType_Collision = {
        /* isDisabled */        0,
        /* updateDepgraph */    0,
        /* dependsOnTime */     dependsOnTime,
+       /* dependsOnNormals */  0,
        /* foreachObjectLink */ 0,
        /* foreachIDLink */     0,
 };