[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [13374] branches/cloth/blender/source/ blender: fix for collision modifier not reseted after first run + made the pushpin more like one
Daniel Genrich
daniel.genrich at gmx.net
Wed Jan 23 18:58:11 CET 2008
Revision: 13374
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=13374
Author: genscher
Date: 2008-01-23 18:58:09 +0100 (Wed, 23 Jan 2008)
Log Message:
-----------
fix for collision modifier not reseted after first run + made the pushpin more like one
Modified Paths:
--------------
branches/cloth/blender/source/blender/blenkernel/intern/cloth.c
branches/cloth/blender/source/blender/blenkernel/intern/modifier.c
branches/cloth/blender/source/blender/src/drawobject.c
Modified: branches/cloth/blender/source/blender/blenkernel/intern/cloth.c
===================================================================
--- branches/cloth/blender/source/blender/blenkernel/intern/cloth.c 2008-01-23 15:51:25 UTC (rev 13373)
+++ branches/cloth/blender/source/blender/blenkernel/intern/cloth.c 2008-01-23 17:58:09 UTC (rev 13374)
@@ -621,6 +621,12 @@
clmd->sim_parms->dt = 1.0f / clmd->sim_parms->stepsPerFrame;
clmd->sim_parms->sim_time = current_time;
+
+ /* check if cache is active / if file is already saved */
+ if ((!G.relbase_valid) && ( deltaTime != 1.0f ))
+ {
+ clmd->sim_parms->flags |= CLOTH_SIMSETTINGS_FLAG_RESET;
+ }
if(clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_RESET)
{
Modified: branches/cloth/blender/source/blender/blenkernel/intern/modifier.c
===================================================================
--- branches/cloth/blender/source/blender/blenkernel/intern/modifier.c 2008-01-23 15:51:25 UTC (rev 13373)
+++ branches/cloth/blender/source/blender/blenkernel/intern/modifier.c 2008-01-23 17:58:09 UTC (rev 13374)
@@ -5130,6 +5130,8 @@
current_time = bsystem_time ( ob, ( float ) G.scene->r.cfra, 0.0 );
+ // printf("current_time %f, collmd->time %f\n", current_time, collmd->time);
+
if(current_time > collmd->time)
{
numverts = dm->getNumVerts ( dm );
@@ -5194,6 +5196,10 @@
collmd->time = current_time;
}
+ else
+ {
+ collmd->time = current_time;
+ }
}
if(dm)
Modified: branches/cloth/blender/source/blender/src/drawobject.c
===================================================================
--- branches/cloth/blender/source/blender/src/drawobject.c 2008-01-23 15:51:25 UTC (rev 13373)
+++ branches/cloth/blender/source/blender/src/drawobject.c 2008-01-23 17:58:09 UTC (rev 13374)
@@ -5421,7 +5421,13 @@
if(!(clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_RESET))
{
verts = cloth->verts;
-
+ /*
+ // this makes the screen pink
+ glEnable(GL_LIGHTING);
+ glEnable(GL_COLOR_MATERIAL);
+ glShadeModel(GL_SMOOTH);
+ */
+
for(i = 0; i < cloth->numverts; i++)
{
if(verts[i].flags & CLOTH_VERT_FLAG_PINNED)
@@ -5443,27 +5449,49 @@
glScalef(size[0], size[1], size[2]);
// gluSphere(qobj, 1.0, 8, 5);
+
glTranslatef(0, 0, 1.0);
- gluDisk(qobj, 0, 0.4, 8, 5);
- gluCylinder(qobj, 0.4, 0.4, 1.0, 8, 5);
+ gluDisk(qobj, 0, 0.25, 8, 5);
+ glTranslatef(0, 0, -1.0);
+
+ glTranslatef(0, 0, 0.875);
+ gluCylinder(qobj, 0.15, 0.25, 0.125, 8, 5);
+
+ glTranslatef(0, 0, -0.25);
+ gluCylinder(qobj, 0.15, 0.15, 0.25, 8, 5);
+
+ glTranslatef(0, 0, -0.125);
+ gluCylinder(qobj, 0.25, 0.15, 0.125, 8, 5);
+
+ // gluDisk(qobj, 0, 0.5, 8, 5);
+
+ /*
glTranslatef(0, 0, 1.0);
gluDisk(qobj, 0, 0.4, 8, 5);
-
- glTranslatef(0, 0, -2.0);
+ */
/*
col[0] = 0.53;
col[1] = 0.54;
col[2] = 0.0;
glColor3fv(col);
*/
- gluCylinder(qobj, 0.0, 0.2, 1.0, 8, 5);
+ glTranslatef(0, 0, -0.5);
+ gluCylinder(qobj, 0.0, 0.05, 0.5, 8, 5);
+ glTranslatef(0, 0, 0.5);
+ gluDisk(qobj, 0, 0.25, 8, 5);
+
glPopMatrix();
gluDeleteQuadric(qobj);
}
}
+ /*
+ glShadeModel(GL_FLAT);
+ glDisable(GL_COLOR_MATERIAL);
+ glDisable(GL_LIGHTING);
+ */
}
}
}
More information about the Bf-blender-cvs
mailing list