← Back to team overview

yade-dev team mailing list archive

[svn] r1806 - trunk/pkg/realtime-rigidbody/Engine/EngineUnit

 

Author: eudoxos
Date: 2009-06-23 09:40:04 +0200 (Tue, 23 Jun 2009)
New Revision: 1806

Modified:
   trunk/pkg/realtime-rigidbody/Engine/EngineUnit/InteractingBox2InteractingBox4ClosestFeatures.cpp
   trunk/pkg/realtime-rigidbody/Engine/EngineUnit/InteractingBox2InteractingSphere4ClosestFeatures.cpp
   trunk/pkg/realtime-rigidbody/Engine/EngineUnit/InteractingSphere2InteractingSphere4ClosestFeatures.cpp
Log:
Fix error-tolerant law which uses no interactionPhysics: add void Interaction physics in the geometry functor if returning true, to make Interaction::isReal return true. (Shouldn't we remove ErrorTolerant...? Does it have some serious use?)



Modified: trunk/pkg/realtime-rigidbody/Engine/EngineUnit/InteractingBox2InteractingBox4ClosestFeatures.cpp
===================================================================
--- trunk/pkg/realtime-rigidbody/Engine/EngineUnit/InteractingBox2InteractingBox4ClosestFeatures.cpp	2009-06-18 04:53:23 UTC (rev 1805)
+++ trunk/pkg/realtime-rigidbody/Engine/EngineUnit/InteractingBox2InteractingBox4ClosestFeatures.cpp	2009-06-23 07:40:04 UTC (rev 1806)
@@ -185,6 +185,8 @@
 		shared_ptr<ClosestFeatures> cf = shared_ptr<ClosestFeatures>(new ClosestFeatures());
 		cf->closestsPoints.push_back(std::pair<Vector3r,Vector3r>(pa,pb));
 		c->interactionGeometry = cf;
+		// add void interactionPhysics, even though ClosestFeatures doesn't use it. Interaction::isReal tests its presence, however.
+		c->interactionPhysics=shared_ptr<InteractionPhysics>(new InteractionPhysics());
 		
 		nbInteractions++;
 
@@ -396,6 +398,9 @@
 		nbInteractions++;
 	}
 	c->interactionGeometry = cf;
+
+	// add void interactionPhysics, even though ClosestFeatures doesn't use it. Interaction::isReal tests its presence, however.
+	c->interactionPhysics=shared_ptr<InteractionPhysics>(new InteractionPhysics());
 	
 	return true;
 }

Modified: trunk/pkg/realtime-rigidbody/Engine/EngineUnit/InteractingBox2InteractingSphere4ClosestFeatures.cpp
===================================================================
--- trunk/pkg/realtime-rigidbody/Engine/EngineUnit/InteractingBox2InteractingSphere4ClosestFeatures.cpp	2009-06-18 04:53:23 UTC (rev 1805)
+++ trunk/pkg/realtime-rigidbody/Engine/EngineUnit/InteractingBox2InteractingSphere4ClosestFeatures.cpp	2009-06-23 07:40:04 UTC (rev 1806)
@@ -79,7 +79,10 @@
 		shared_ptr<ClosestFeatures> cf = shared_ptr<ClosestFeatures>(new ClosestFeatures());
 		cf->closestsPoints.push_back(std::pair<Vector3r,Vector3r>(pt1,pt2));
 		interaction->interactionGeometry = cf;
-		
+
+		// add void interactionPhysics, even though ClosestFeatures doesn't use it. Interaction::isReal tests its presence, however.
+		interaction->interactionPhysics=shared_ptr<InteractionPhysics>(new InteractionPhysics());
+
 		return true;	
 	}
 
@@ -100,9 +103,10 @@
 	
 	shared_ptr<ClosestFeatures> cf = shared_ptr<ClosestFeatures>(new ClosestFeatures());
 	cf->closestsPoints.push_back(std::pair<Vector3r,Vector3r>(pt1,pt2));
+	// add void interactionPhysics, even though ClosestFeatures doesn't use it. Interaction::isReal tests its presence, however.
+	interaction->interactionPhysics=shared_ptr<InteractionPhysics>(new InteractionPhysics());
 	
 	interaction->interactionGeometry = cf;
-	
 	return true;
 }
 

Modified: trunk/pkg/realtime-rigidbody/Engine/EngineUnit/InteractingSphere2InteractingSphere4ClosestFeatures.cpp
===================================================================
--- trunk/pkg/realtime-rigidbody/Engine/EngineUnit/InteractingSphere2InteractingSphere4ClosestFeatures.cpp	2009-06-18 04:53:23 UTC (rev 1805)
+++ trunk/pkg/realtime-rigidbody/Engine/EngineUnit/InteractingSphere2InteractingSphere4ClosestFeatures.cpp	2009-06-23 07:40:04 UTC (rev 1806)
@@ -28,6 +28,9 @@
 		shared_ptr<ClosestFeatures> cf = shared_ptr<ClosestFeatures>(new ClosestFeatures());
 		cf->closestsPoints.push_back(std::pair<Vector3r,Vector3r>(se31.position-v*s1->radius,se32.position+v*s2->radius));
 		c->interactionGeometry = cf;
+		// add void interactionPhysics, even though ClosestFeatures doesn't use it. Interaction::isReal tests its presence, however.
+		c->interactionPhysics=shared_ptr<InteractionPhysics>(new InteractionPhysics());
+
 		return true;
 	}
 	else