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.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/source/blender/modifiers/intern/MOD_collision.c b/source/blender/modifiers/intern/MOD_collision.c
index 4c5ce184c22..b3faf6c140a 100644
--- a/source/blender/modifiers/intern/MOD_collision.c
+++ b/source/blender/modifiers/intern/MOD_collision.c
@@ -71,7 +71,8 @@ static void freeData(ModifierData *md)
{
CollisionModifierData *collmd = (CollisionModifierData*) md;
- if (collmd) {
+ if (collmd)
+ {
if (collmd->bvhtree)
BLI_bvhtree_free(collmd->bvhtree);
if (collmd->x)
@@ -119,12 +120,14 @@ static void deformVerts(ModifierData *md, Object *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;
@@ -138,17 +141,20 @@ static void deformVerts(ModifierData *md, Object *ob,
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))
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
- for ( i = 0; i < numverts; i++ ) {
+ for ( i = 0; i < numverts; i++ )
+ {
// we save global positions
mul_m4_v3( ob->obmat, collmd->x[i].co );
}