From 7c1a21c385ac8450e295f73a71f104ab17a076c5 Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Mon, 17 Mar 2008 21:45:40 +0000 Subject: Collision Modifier/KDOP: Rearrange things to be more generic. Also fix possible crash if not enough memory there. --- source/blender/blenkernel/intern/cloth.c | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'source/blender/blenkernel/intern/cloth.c') diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index d2834571316..a58fdab8c91 100644 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@ -190,11 +190,6 @@ BVH *bvh_build_from_cloth (ClothModifierData *clmd, float epsilon) // springs = cloth->springs; // numsprings = cloth->numsprings; - - bvh->flags = 0; - bvh->leaf_tree = NULL; - bvh->leaf_root = NULL; - bvh->tree = NULL; bvh->epsilon = epsilon; bvh->numfaces = cloth->numfaces; @@ -211,20 +206,9 @@ BVH *bvh_build_from_cloth (ClothModifierData *clmd, float epsilon) return NULL; } - bvh->current_xold = MEM_callocN ( sizeof ( MVert ) * bvh->numverts, "bvh->current_xold" ); - - if (bvh->current_xold == NULL) - { - printf("bvh: Out of memory.\n"); - MEM_freeN(bvh->current_x); - MEM_freeN(bvh); - return NULL; - } - for(i = 0; i < bvh->numverts; i++) { VECCOPY(bvh->current_x[i].co, verts[i].tx); - VECCOPY(bvh->current_xold[i].co, verts[i].txold); } bvh_build (bvh); -- cgit v1.2.3