{
stack_index = modifiers_indexInObject(ob, (ModifierData *)clmd);
- PTCache_id_clear((ID *)ob, framenr, stack_index);
+ BKE_ptcache_id_clear((ID *)ob, PTCACHE_CLEAR_AFTER, framenr, stack_index);
}
}
static void cloth_write_cache(Object *ob, ClothModifierData *clmd, float framenr)
stack_index = modifiers_indexInObject(ob, (ModifierData *)clmd);
- fp = PTCache_id_fopen((ID *)ob, 'w', framenr, stack_index);
+ fp = BKE_ptcache_id_fopen((ID *)ob, 'w', framenr, stack_index);
if(!fp) return;
for(a = 0; a < cloth->numverts; a++)
stack_index = modifiers_indexInObject(ob, (ModifierData *)clmd);
- fp = PTCache_id_fopen((ID *)ob, 'r', framenr, stack_index);
+ fp = BKE_ptcache_id_fopen((ID *)ob, 'r', framenr, stack_index);
if(!fp)
ret = 0;
else {
{
ClothSpring *spring = NULL, *tspring = NULL, *tspring2 = NULL;
unsigned int struct_springs = 0, shear_springs=0, bend_springs = 0;
- unsigned int i = 0;
+ unsigned int i = 0, j = 0;
unsigned int numverts = dm->getNumVerts ( dm );
unsigned int numedges = dm->getNumEdges ( dm );
unsigned int numfaces = dm->getNumFaces ( dm );
}
}
+ // calc collision balls *slow*
+ // better: use precalculated list with O(1) index access to all springs of a vertex
+ // missing for structural since it's not needed for building bending springs
+ /*
+ for ( i = 0; i < numverts; i++ )
+ {
+ search = cloth->springs;
+ for ( j = 0; j < struct_springs; j++ )
+ {
+ if ( !search )
+ break;
+
+ tspring = search->link;
+
+ if((tspring->ij == i) || (tspring->kl == i))
+ {
+ akku += bs->len;
+ akku_count++,
+ min = MIN2(bs->len,min);
+ max = MAX2(bs->len,max);
+ }
+ }
+ }
+ */
// shear springs
for ( i = 0; i < numfaces; i++ )
{