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:
authorDaniel Genrich <daniel.genrich@gmx.net>2008-02-07 01:59:56 +0300
committerDaniel Genrich <daniel.genrich@gmx.net>2008-02-07 01:59:56 +0300
commiteb281bff39d255011e82ae8cbf8129eed811d7ec (patch)
tree3c3a01d4a9877034e9e797b6102d09fbd0d24568 /source/blender/blenkernel/intern/implicit.c
parentdb6cef56029bbc233d3f559f48dc1934404c4ace (diff)
Cloth: 1. fix problem with pinning (reported by ZanQdo), 2. fix cache protected + 'not saved' gui message bug (reported by Tobias Regenbrecht)
Diffstat (limited to 'source/blender/blenkernel/intern/implicit.c')
-rw-r--r--source/blender/blenkernel/intern/implicit.c29
1 files changed, 7 insertions, 22 deletions
diff --git a/source/blender/blenkernel/intern/implicit.c b/source/blender/blenkernel/intern/implicit.c
index 8490966283e..8c3aa514cf0 100644
--- a/source/blender/blenkernel/intern/implicit.c
+++ b/source/blender/blenkernel/intern/implicit.c
@@ -60,7 +60,7 @@
#include "BKE_modifier.h"
#include "BKE_utildefines.h"
#include "BKE_global.h"
-#include "BIF_editdeform.h"
+#include "BIF_editdeform.h"
#ifdef _WIN32
@@ -111,9 +111,6 @@ double itval()
}
#endif
-/* callbacks for errors and interrupts and some goo */
-static int (*CT_localInterruptCallBack)(void) = NULL;
-
static float I[3][3] = {{1,0,0},{0,1,0},{0,0,1}};
static float ZERO[3][3] = {{0,0,0}, {0,0,0}, {0,0,0}};
@@ -783,7 +780,7 @@ int implicit_init (Object *ob, ClothModifierData *clmd)
{
id->A[i].r = id->A[i].c = id->dFdV[i].r = id->dFdV[i].c = id->dFdX[i].r = id->dFdX[i].c = id->P[i].c = id->P[i].r = id->Pinv[i].c = id->Pinv[i].r = id->bigI[i].c = id->bigI[i].r = id->M[i].r = id->M[i].c = i;
- if(verts [i].goal >= SOFTGOALSNAP)
+ if(verts [i].flags & CLOTH_VERT_FLAG_PINNED)
{
id->S[pinned].pinned = 1;
id->S[pinned].c = id->S[pinned].r = i;
@@ -1337,6 +1334,7 @@ void cloth_calc_force(ClothModifierData *clmd, lfVector *lF, lfVector *lX, lfVec
submul_lfvectorS(lF, lV, spring_air, numverts);
/* do goal stuff */
+ /*
if(clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL)
{
for(i = 0; i < numverts; i++)
@@ -1353,15 +1351,13 @@ void cloth_calc_force(ClothModifierData *clmd, lfVector *lF, lfVector *lX, lfVec
VECADDS(lF[i], lF[i], auxvect, -ks);
// calulate damping forces generated by goals
-
VECSUB(velgoal,verts[i].xold, verts[i].xconst);
kd = clmd->sim_parms->goalfrict * 0.01f; // friction force scale taken from SB
VECSUBADDSS(lF[i], velgoal, kd, lV[i], kd);
-
-
}
}
}
+ */
/* handle external forces like wind */
if(effectors)
@@ -1459,7 +1455,7 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase
for(i = 0; i < numverts; i++)
{
// update velocities with constrained velocities from pinned verts
- if(verts [i].goal >= SOFTGOALSNAP)
+ if(verts [i].flags & CLOTH_VERT_FLAG_PINNED)
{
VECSUB(id->V[i], verts[i].xconst, verts[i].xold);
// VecMulf(id->V[i], 1.0 / dt);
@@ -1500,7 +1496,7 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase
if(clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL)
{
- if(verts [i].goal >= SOFTGOALSNAP)
+ if(verts [i].flags & CLOTH_VERT_FLAG_PINNED)
{
float tvect[3] = {.0,.0,.0};
// VECSUB(tvect, id->Xnew[i], verts[i].xold);
@@ -1528,7 +1524,7 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase
if(clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_GOAL)
{
- if(verts [i].goal >= SOFTGOALSNAP)
+ if(verts [i].flags & CLOTH_VERT_FLAG_PINNED)
{
continue;
}
@@ -1580,12 +1576,6 @@ int implicit_solver (Object *ob, float frame, ClothModifierData *clmd, ListBase
if(effectors) pdEndEffectors(effectors);
- /* ask for user break */
- /*
- don't work very well, gives problems with ctrl-a + esc
- if (CT_localInterruptCallBack && CT_localInterruptCallBack())
- return 0;
- */
}
for(i = 0; i < numverts; i++)
@@ -1631,8 +1621,3 @@ void implicit_set_positions (ClothModifierData *clmd)
printf("implicit_set_positions\n");
}
-/* Cloth global visible functions */
-void clmdSetInterruptCallBack(int (*f)(void))
-{
- CT_localInterruptCallBack = f;
-}