← Back to team overview

yade-dev team mailing list archive

[svn] r1707 - trunk/core

 

Author: eudoxos
Date: 2009-03-01 21:52:50 +0100 (Sun, 01 Mar 2009)
New Revision: 1707

Modified:
   trunk/core/Collider.cpp
Log:
1. Small fix in the collider code.


Modified: trunk/core/Collider.cpp
===================================================================
--- trunk/core/Collider.cpp	2009-03-01 20:35:11 UTC (rev 1706)
+++ trunk/core/Collider.cpp	2009-03-01 20:52:50 UTC (rev 1707)
@@ -16,7 +16,7 @@
 	/* logically, we have 4 possibilities
 	 * 1.  real  new → ¬new, keep
 	 * 2.  real ¬new → keep (same as 1.)
-	 * 3. ¬real  new → ???
+	 * 3. ¬real  new → keep (remains in potential state)
 	 * 4. ¬real ¬new → delete
 	 */
 	
@@ -25,10 +25,12 @@
 	if( I->isReal &&  I->isNew){ I->isNew=false; return true; }
 	// case 2.
 	if( I->isReal && !I->isNew) return true; 
-	//case 3.
-	if(!I->isReal && I->isNew){ /* ??? copied from PersistentSAPCollider; what is the logic here?? */ I->isReal=false; return true; }
-	// remove interactions deleted by the constitutive law
-	if(!I->isNew && !I->isReal) return false; // should be deleted
+	// case 3.
+	// Keep interaction in potential state (the collider _must_ delete it once it is not in potential state anymore, however)
+	if(!I->isReal &&  I->isNew) return true;
+	// case 4.
+	// Remove interactions deleted by the constitutive law
+	if(!I->isReal && !I->isNew) return false; // should be deleted
 
 	assert(false); // unreachable
 }