Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/modifiers/intern/MOD_collision.c')
-rw-r--r--source/blender/modifiers/intern/MOD_collision.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/source/blender/modifiers/intern/MOD_collision.c b/source/blender/modifiers/intern/MOD_collision.c
index a1467c55ecf..b3faf6c140a 100644
--- a/source/blender/modifiers/intern/MOD_collision.c
+++ b/source/blender/modifiers/intern/MOD_collision.c
@@ -73,19 +73,19 @@ static void freeData(ModifierData *md)
if (collmd)
{
- if(collmd->bvhtree)
+ if (collmd->bvhtree)
BLI_bvhtree_free(collmd->bvhtree);
- if(collmd->x)
+ if (collmd->x)
MEM_freeN(collmd->x);
- if(collmd->xnew)
+ if (collmd->xnew)
MEM_freeN(collmd->xnew);
- if(collmd->current_x)
+ if (collmd->current_x)
MEM_freeN(collmd->current_x);
- if(collmd->current_xnew)
+ if (collmd->current_xnew)
MEM_freeN(collmd->current_xnew);
- if(collmd->current_v)
+ if (collmd->current_v)
MEM_freeN(collmd->current_v);
- if(collmd->mfaces)
+ if (collmd->mfaces)
MEM_freeN(collmd->mfaces);
collmd->x = NULL;
@@ -117,16 +117,16 @@ static void deformVerts(ModifierData *md, Object *ob,
MVert *tempVert = NULL;
/* if possible use/create DerivedMesh */
- if(derivedData) dm = CDDM_copy(derivedData);
- else if(ob->type==OB_MESH) dm = CDDM_from_mesh(ob->data, ob);
+ if (derivedData) dm = CDDM_copy(derivedData);
+ else if (ob->type==OB_MESH) dm = CDDM_from_mesh(ob->data, ob);
- if(!ob->pd)
+ if (!ob->pd)
{
printf("CollisionModifier deformVerts: Should not happen!\n");
return;
}
- if(dm)
+ if (dm)
{
float current_time = 0;
unsigned int numverts = 0;
@@ -136,20 +136,20 @@ static void deformVerts(ModifierData *md, Object *ob,
current_time = BKE_curframe(md->scene);
- if(G.rt > 0)
+ if (G.rt > 0)
printf("current_time %f, collmd->time_xnew %f\n", current_time, collmd->time_xnew);
numverts = dm->getNumVerts ( dm );
- if((current_time > collmd->time_xnew)|| (BKE_ptcache_get_continue_physics()))
+ if ((current_time > collmd->time_xnew)|| (BKE_ptcache_get_continue_physics()))
{
unsigned int i;
// check if mesh has changed
- if(collmd->x && (numverts != collmd->numverts))
+ if (collmd->x && (numverts != collmd->numverts))
freeData((ModifierData *)collmd);
- if(collmd->time_xnew == -1000) // first time
+ if (collmd->time_xnew == -1000) // first time
{
collmd->x = dm->dupVertArray(dm); // frame start position
@@ -176,7 +176,7 @@ static void deformVerts(ModifierData *md, Object *ob,
collmd->time_x = collmd->time_xnew = current_time;
}
- else if(numverts == collmd->numverts) {
+ else if (numverts == collmd->numverts) {
// put positions to old positions
tempVert = collmd->x;
collmd->x = collmd->xnew;
@@ -194,8 +194,8 @@ static void deformVerts(ModifierData *md, Object *ob,
memcpy(collmd->current_x, collmd->x, numverts*sizeof(MVert));
/* check if GUI setting has changed for bvh */
- if(collmd->bvhtree) {
- if(ob->pd->pdef_sboft != BLI_bvhtree_getepsilon(collmd->bvhtree)) {
+ if (collmd->bvhtree) {
+ if (ob->pd->pdef_sboft != BLI_bvhtree_getepsilon(collmd->bvhtree)) {
BLI_bvhtree_free(collmd->bvhtree);
collmd->bvhtree = bvhtree_build_from_mvert(collmd->mfaces, collmd->numfaces, collmd->current_x, numverts, ob->pd->pdef_sboft);
}
@@ -213,12 +213,12 @@ static void deformVerts(ModifierData *md, Object *ob,
collmd->time_xnew = current_time;
}
- else if(numverts != collmd->numverts) {
+ else if (numverts != collmd->numverts) {
freeData((ModifierData *)collmd);
}
}
- else if(current_time < collmd->time_xnew) {
+ else if (current_time < collmd->time_xnew) {
freeData((ModifierData *)collmd);
}
else {
@@ -228,7 +228,7 @@ static void deformVerts(ModifierData *md, Object *ob,
}
}
- if(dm)
+ if (dm)
dm->release(dm);
}