← Back to team overview

yade-users team mailing list archive

Questions on ScGeom

 











Hi everyone,

I've been looking at ScGeom, and I'm puzzled about the boolean "isNew".    Has "isNew" been used correctly when assigning prevNormal?  In the following, "c" is "interaction".   If c->interactionGeometry is true, it would mean that interactionGeometry has already existed?  Wouldn't c->interactionGeometry mean isOld?

bool isNew=c->interactionGeometry;
        if(c->interactionGeometry) scm=YADE_PTR_CAST<ScGeom>(c->interactionGeometry);
        else { scm=shared_ptr<ScGeom>(new ScGeom()); c->interactionGeometry=scm; }

        Real penetrationDepth=s1->radius+s2->radius-normal.Normalize(); /* Normalize() works in-place and returns length before normalization; from here, normal is unit vector */
        scm->contactPoint=se31.position+(s1->radius-0.5*penetrationDepth)*normal;//0.5*(pt1+pt2);
        #ifdef SCG_SHEAR
            if(isNew) scm->prevNormal=normal; 
            else scm->prevNormal=scm->normal;


Yours,

CWBoon
 		 	   		  
_________________________________________________________________
Windows 7: Simplify what you do everyday. Find the right PC for you.
http://windows.microsoft.com/shop

Follow ups