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:
authorCampbell Barton <ideasman42@gmail.com>2010-02-24 21:06:51 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-02-24 21:06:51 +0300
commitaebe86bef1e13e3ce0a4d7a67b7cf5f6d9c1cd66 (patch)
tree02dfb80bbcd6c0a89c21dd8710e81cd91a493198 /source/blender/blenkernel/intern/collision.c
parentb888a32eee8147b028464336ad2404d8155c64dd (diff)
hair was running collision functions (copy to/from collision arrays), even when collision could not be done.
Diffstat (limited to 'source/blender/blenkernel/intern/collision.c')
-rw-r--r--source/blender/blenkernel/intern/collision.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c
index b726437a874..b024ba5f4e1 100644
--- a/source/blender/blenkernel/intern/collision.c
+++ b/source/blender/blenkernel/intern/collision.c
@@ -1550,8 +1550,8 @@ static int cloth_bvh_objcollisions_resolve ( ClothModifierData * clmd, Collision
// cloth - object collisions
int cloth_bvh_objcollision (Object *ob, ClothModifierData * clmd, float step, float dt )
{
- Cloth *cloth=NULL;
- BVHTree *cloth_bvh=NULL;
+ Cloth *cloth= clmd->clothObject;
+ BVHTree *cloth_bvh= cloth->bvhtree;
int i=0, numfaces = 0, numverts = 0, k, l, j;
int rounds = 0; // result counts applied collisions; ic is for debug output;
ClothVertex *verts = NULL;
@@ -1559,16 +1559,12 @@ int cloth_bvh_objcollision (Object *ob, ClothModifierData * clmd, float step, fl
Object **collobjs = NULL;
int numcollobj = 0;
- if ( ( clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_COLLOBJ ) || ! ( ( ( Cloth * ) clmd->clothObject )->bvhtree ) )
- {
+ if ((clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_COLLOBJ) || cloth_bvh==NULL)
return 0;
- }
- cloth = clmd->clothObject;
verts = cloth->verts;
- cloth_bvh = ( BVHTree * ) cloth->bvhtree;
- numfaces = clmd->clothObject->numfaces;
- numverts = clmd->clothObject->numverts;
+ numfaces = cloth->numfaces;
+ numverts = cloth->numverts;
////////////////////////////////////////////////////////////
// static collisions
@@ -1672,8 +1668,8 @@ int cloth_bvh_objcollision (Object *ob, ClothModifierData * clmd, float step, fl
// collisions = 1;
verts = cloth->verts; // needed for openMP
- numfaces = clmd->clothObject->numfaces;
- numverts = clmd->clothObject->numverts;
+ numfaces = cloth->numfaces;
+ numverts = cloth->numverts;
verts = cloth->verts;