svn merge ^/trunk/blender -r40644:40720
[blender.git] / source / blender / modifiers / intern / MOD_fluidsim_util.c
index 61345427d1c9b2f3eca7c770a92486ad3332215e..a42e8475e8d1c23becf1a0be4ad7758db2375519 100644 (file)
@@ -90,10 +90,10 @@ void fluidsim_init(FluidsimModifierData *fluidmd)
                fss->viscosityValue = 1.0;
                fss->viscosityExponent = 6;
                
-               // dg TODO: change this to []
-               fss->gravx = 0.0;
-               fss->gravy = 0.0;
-               fss->gravz = -9.81;
+               fss->grav[0] = 0.0;
+               fss->grav[1] = 0.0;
+               fss->grav[2] = -9.81;
+
                fss->animStart = 0.0; 
                fss->animEnd = 4.0;
                fss->gstar = 0.005; // used as normgstar
@@ -111,7 +111,7 @@ void fluidsim_init(FluidsimModifierData *fluidmd)
                // no bounding box needed
                
                // todo - reuse default init from elbeem!
-               fss->typeFlags = OB_FSBND_PARTSLIP;
+               fss->typeFlags = OB_FSBND_PARTSLIP | OB_FSSG_NOOBS;
                fss->domainNovecgen = 0;
                fss->volumeInitType = 1; // volume
                fss->partSlipValue = 0.2;
@@ -226,7 +226,7 @@ static DerivedMesh *fluidsim_read_obj(const char *filename)
                return NULL;
        }
 
-       dm = CDDM_new(numverts, 0, numfaces);
+       dm = CDDM_new(numverts, 0, numfaces, 0, 0);
 
        if(!dm)
        {
@@ -282,7 +282,7 @@ static DerivedMesh *fluidsim_read_obj(const char *filename)
        }
 
        // read triangles from file
-       mf = CDDM_get_faces(dm);
+       mf = CDDM_get_tessfaces(dm);
        for(i=numfaces; i>0; i--, mf++)
        {
                int face[3];
@@ -507,12 +507,12 @@ static DerivedMesh *fluidsim_read_cache(DerivedMesh *orgdm, FluidsimModifierData
        }
 
        // assign material + flags to new dm
-       mface = orgdm->getFaceArray(orgdm);
+       mface = orgdm->getTessFaceArray(orgdm);
        mat_nr = mface[0].mat_nr;
        flag = mface[0].flag;
 
-       mface = dm->getFaceArray(dm);
-       numfaces = dm->getNumFaces(dm);
+       mface = dm->getTessFaceArray(dm);
+       numfaces = dm->getNumTessFaces(dm);
        for(i=0; i<numfaces; i++)
        {
                mface[i].mat_nr = mat_nr;