<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://pybullet.org/Bullet/phpBB3/app.php/feed/topic/625" />

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2006-10-28T02:42:07+00:00</updated>

	<author><name><![CDATA[Real-Time Physics Simulation Forum]]></name></author>
	<id>https://pybullet.org/Bullet/phpBB3/app.php/feed/topic/625</id>

		<entry>
		<author><name><![CDATA[Erwin Coumans]]></name></author>
		<updated>2006-10-28T02:42:07+00:00</updated>

		<published>2006-10-28T02:42:07+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2240#p2240</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2240#p2240"/>
		<title type="html"><![CDATA[Box vs. Box primitive collision in Bullet ?]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2240#p2240"><![CDATA[
Hi Andrei,<br><br>Bullet 2.19a has a comparison collision algorithm in Extras/AlternativeCollisionAlgorithms/<br><br>There is also a native Bullet btSphereTriangleCollisionAlgorithm in src/BulletCollision/CollisionDispatch.<br><br>Have fun,<br>Erwin<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2">Erwin Coumans</a> — Sat Oct 28, 2006 2:42 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Erwin Coumans]]></name></author>
		<updated>2006-10-27T15:35:13+00:00</updated>

		<published>2006-10-27T15:35:13+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2233#p2233</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2233#p2233"/>
		<title type="html"><![CDATA[Box vs. Box primitive collision in Bullet ?]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2233#p2233"><![CDATA[
<blockquote class="uncited"><div>Here is my code in Bullet 2.18a.<br>If a single box rests on the ground box, everything seems fine. However, for bigger stacks, things go crazy. The behavior is the same with both SOR_LCP and impulse approaches. The problem is definitely in my code.</div></blockquote>I haven't had the time yet to add the box-box comparison code in the Extras folder of Bullet (I have some old code that works, should take about an hour or so to update).<br><br>Have you checked this:<br><br>* is the normal pointing from B towards A in worldspace?<br>* is the penetration depth negative when overlap (positive distance means separation in Bullet)<br>* are the contact points in world space?<br><br>Thanks,<br>Erwin<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2">Erwin Coumans</a> — Fri Oct 27, 2006 3:35 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Erwin Coumans]]></name></author>
		<updated>2006-10-26T01:13:06+00:00</updated>

		<published>2006-10-26T01:13:06+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2215#p2215</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2215#p2215"/>
		<title type="html"><![CDATA[Box vs. Box primitive collision in Bullet ?]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2215#p2215"><![CDATA[
Indeed, this clipping method assumes convex polyhedra. In Bullet I'm using the contact caching and reduction method, and I'm happy with the results for both convex polyhedra and implicit convexes. The CcdPhysicsDemo shows stable implicit cylinders stacking. I'll add the clipping method as a comparison.<br><blockquote class="uncited"><div>Doesn't seem so hot for implicit surfaces. The references all seem to care about whether you have face or edge features in the remaining simplex. I suppose you would have to classify the source of the vertex somehow (for a cylinder side, it would be a line from top to bottom). Sounds like a lot of book-keeping.</div></blockquote><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2">Erwin Coumans</a> — Thu Oct 26, 2006 1:13 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[dog]]></name></author>
		<updated>2006-10-26T01:09:57+00:00</updated>

		<published>2006-10-26T01:09:57+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2214#p2214</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2214#p2214"/>
		<title type="html"><![CDATA[Box vs. Box primitive collision in Bullet ?]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2214#p2214"><![CDATA[
Doesn't seem so hot for implicit surfaces. The references all seem to care about whether you have face or edge features in the remaining simplex. I suppose you would have to classify the source of the vertex somehow (for a cylinder side, it would be a line from top to bottom). Sounds like a lot of book-keeping.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=60">dog</a> — Thu Oct 26, 2006 1:09 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Erwin Coumans]]></name></author>
		<updated>2006-10-26T00:45:27+00:00</updated>

		<published>2006-10-26T00:45:27+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2213#p2213</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2213#p2213"/>
		<title type="html"><![CDATA[Box vs. Box primitive collision in Bullet ?]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2213#p2213"><![CDATA[
<blockquote class="uncited"><div><blockquote class="uncited"><div> There are improvements that I'm intending to add to improve the contact manifold generation and maintenance. <br><br>... it is possible to perform direct clipping to get all points at a time, still using GJK. Basically ODE and other libraries first determine the separating axis, and then clip/project the most parallel features for this axis. This can be done using GJK or SAT.</div></blockquote>Do you have any links to papers on this?</div></blockquote>In 2002 on comp.graphics.algorithms John Nagle describes the projection on the separating plane and then the 2D contact clipping method:<br><a href="http://groups.google.co.uk/group/comp.games.development.programming.algorithms/browse_frm/thread/b6316c1311b726a0/118bae17f95d39db" class="postlink">http://groups.google.co.uk/group/comp.g ... 17f95d39db</a><br><blockquote class="uncited"><div>What you want is the "contact polygon". <br>For two nearby, non-intersecting convex polyhedra, here's <br>the algorithm. <br><br>    1.  First, get from GJK (inside SOLID) the final simplex from <br>        the GJK algorithm.  This defines the closest set of features <br>        for the two nearby bodies.  Each body will have one, two, <br>        or three points in the simplex.  A body with one point <br>        indicates the closest point is a vertex.  A body with three <br>        points indicates the closest point is in the interior of <br>        a face.  A body with two points indicates either that the <br>        contact is along an edge or on a diagonal of a face. <br><br><br>    2.  With this data extracted, for each face, find the <br>        "most parallel face" for each object.  This is the <br>        face most perpendicular to the line through the <br>        closest points reported by GJK.  If the GJK simplex <br>        defined a face, that's the face.  If it defined a <br>        vertex, pick the most parallel face of those meeting <br>        at that vertex.  If the simplex defined an edge, pick <br>        the most parallel face that includes that edge.  The <br>        output of this step is two faces, one on each body. <br><br><br>    3.  Project both faces from the previous step onto the <br>        plane which goes through the midpoint of the line segment <br>        between the closest points, and is perpendicular to <br>        that line.  This yields two convex polygons in a plane. <br><br><br>    4.  Compute the intersection of those two convex polygons. <br>        This is the contact polygon. <br><br><br>This is all straightforward geometry and bookkeeping.  Check <br>those GJK simplicies, though; if you get a simplex that has <br>points from more than one face, you've found a problem <br>with GJK (roundoff errors can occur) or the original geometry <br>wasn't convex.  The input geometry should not have coplanar <br>faces.  So don't tesselate your convex hulls.  When you <br>have a cube on a bigger cube, you want a square contact <br>polygon, not a triangle. <br><br><br>                                        John Nagle <br><br><br>                                        Animats <br><br><br></div></blockquote>Some discussion on this forum:<br><a href="http://www.continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=39" class="postlink">http://www.continuousphysics.com/Bullet ... c.php?t=39</a><br>Bullet contains an implementation (contributed by Simon Hobbs) of this projection/intersection for convex polyhedra in Extras/SATConvexCollision/Hull.cpp see<div class="codebox"><p>Code: </p><pre><code>int Hull::AddContactsHullHull(btSeparation&amp; sep, const Point3* pVertsA, const Point3* pVertsB,   const Transform&amp; trA, const Transform&amp; trB,const Hull&amp; hullA,const Hull&amp; hullB,   HullContactCollector* hullContactCollector){...}</code></pre></div>Jan Bender offered another recent contact generation/clipping method, I haven't found the time to integrate it into Bullet yet. Kenny Erleben's book Physics Based Animation discusses some other contact generation methods.<br>Erwin<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2">Erwin Coumans</a> — Thu Oct 26, 2006 12:45 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[dog]]></name></author>
		<updated>2006-10-25T20:30:09+00:00</updated>

		<published>2006-10-25T20:30:09+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2212#p2212</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2212#p2212"/>
		<title type="html"><![CDATA[Box vs. Box primitive collision in Bullet ?]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2212#p2212"><![CDATA[
<blockquote class="uncited"><div> There are improvements that I'm intending to add to improve the contact manifold generation and maintenance. <br><br>... it is possible to perform direct clipping to get all points at a time, still using GJK. Basically ODE and other libraries first determine the separating axis, and then clip/project the most parallel features for this axis. This can be done using GJK or SAT.</div></blockquote>Do you have any links to papers on this?<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=60">dog</a> — Wed Oct 25, 2006 8:30 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[andrei.lupas]]></name></author>
		<updated>2006-10-25T14:07:09+00:00</updated>

		<published>2006-10-25T14:07:09+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2210#p2210</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2210#p2210"/>
		<title type="html"><![CDATA[Box vs. Box primitive collision in Bullet ?]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2210#p2210"><![CDATA[
Here is my code in Bullet 2.18a.<br>If a single box rests on the ground box, everything seems fine. However, for bigger stacks, things go crazy. The behavior is the same with both SOR_LCP and impulse approaches. The problem is definitely in my code.<br><br>Maybe I don't understand well the relation between 3D coordinate system assumed by ODE and Bullet respectively.<br><div class="codebox"><p>Code: </p><pre><code>void btBoxBoxCollisionAlgorithm::processCollision (btCollisionObject* col0,btCollisionObject* col1,const btDispatcherInfo&amp; dispatchInfo,btManifoldResult* resultOut){if (!m_manifoldPtr)return;btBoxShape* box0 = (btBoxShape*)col0-&gt;m_collisionShape;btBoxShape* box1 = (btBoxShape*)col1-&gt;m_collisionShape;btVector3 Box_0_pos = col0-&gt;m_worldTransform.getOrigin();btVector3 Box_1_pos = col1-&gt;m_worldTransform.getOrigin();btMatrix3x3 Box_0_rot = col0-&gt;m_worldTransform.getBasis();btMatrix3x3 Box_1_rot = col1-&gt;m_worldTransform.getBasis();btVector3 Box_0_halfSide = box0-&gt;getHalfExtents();btVector3 Box_1_halfSide = box1-&gt;getHalfExtents();//Z axis in Bullet corresponds to Y axis in ODE and vice-versa ?!dMatrix3 R0, R1;dVector3 P0, P1;dVector3 side0, side1;//Swap Y, Z for position vectorsP0[0] = Box_0_pos[0]; P0[1] = Box_0_pos[2]; P0[2] = Box_0_pos[1];P1[0] = Box_1_pos[0]; P1[1] = Box_1_pos[2]; P1[2] = Box_1_pos[1];R0[0] = Box_0_rot[0][0]; R0[1] = Box_0_rot[0][1]; R0[2]  = Box_0_rot[0][2]; R0[3] = 0;R0[4] = Box_0_rot[1][0]; R0[5] = Box_0_rot[1][1]; R0[6]  = Box_0_rot[1][2]; R0[7] = 0;R0[8] = Box_0_rot[2][0]; R0[9] = Box_0_rot[2][1]; R0[10] = Box_0_rot[2][2]; R0[11]= 0;R1[0] = Box_1_rot[0][0]; R1[1] = Box_1_rot[0][1]; R1[2]  = Box_1_rot[0][2]; R1[3] = 0;R1[4] = Box_1_rot[1][0]; R1[5] = Box_1_rot[1][1]; R1[6]  = Box_1_rot[1][2]; R1[7] = 0;R1[8] = Box_1_rot[2][0]; R1[9] = Box_1_rot[2][1]; R1[10] = Box_1_rot[2][2]; R1[11]= 0;//Swap Y, Z for half-sides; ODE takes full box size (halfSize * 2)side0[0] = Box_0_halfSide[0]*2; side0[1] = Box_0_halfSide[2]*2; side0[2]= Box_0_halfSide[1]*2;side1[0] = Box_1_halfSide[0]*2; side1[1] = Box_1_halfSide[2]*2; side1[2]= Box_1_halfSide[1]*2;#define MAXC 4 //maximum 4 contacts alloweddContactGeom contacts[MAXC];int skip = sizeof(dContactGeom);dVector3 normal;dReal depth;//not used;int retCode;//not used;int noContacts;//ODE box-box collision:noContacts = dBoxBox(P0, R0, side0,  P1, R1, side1, normal, &amp;depth, &amp;retCode, MAXC, &amp;contacts[0], skip);if(noContacts == 0)return;//Now add contacts to maniford:btVector3 SIMD_normal;SIMD_normal[0] = -normal[0];SIMD_normal[1] = -normal[2];SIMD_normal[2] = -normal[1];btVector3 SIMD_pos;resultOut-&gt;setPersistentManifold(m_manifoldPtr);for(int i=0; i&lt;noContacts; i++){SIMD_pos[0] = contacts[i].pos[0];SIMD_pos[1] = contacts[i].pos[2];SIMD_pos[2] = contacts[i].pos[1];resultOut-&gt;addContactPoint(SIMD_normal, SIMD_pos, -contacts[i].depth);}}</code></pre></div><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=1074">andrei.lupas</a> — Wed Oct 25, 2006 2:07 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Erwin Coumans]]></name></author>
		<updated>2006-10-23T15:07:08+00:00</updated>

		<published>2006-10-23T15:07:08+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2202#p2202</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2202#p2202"/>
		<title type="html"><![CDATA[Box vs. Box primitive collision in Bullet ?]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2202#p2202"><![CDATA[
OK, I will add such sample. I'll add the ODE box-box integration in the /Extras folder.<br><br>Dirk:<br>Bullet automatically sets the accumulated impulse to zero for new points, if you reset / clear out all manifold points each frame.<br>As I mentioned before, there is no reason to add a special box-box, GJK should simulate/run fine. Using GJK with out without warm starting you ocan stably stack more then 3 boxes at 60 hertz with default 9.8 gravity.<br>I will add some option to disable/toggle warmstarting, it doesn't improve stability much for Bullet actually.<br><br>Andrei:<br>Can you explain why you are not happy with Bullet's box-box? The CcdPhysicsDemo can be easily modified to use boxes instead of cylinders. Can you provide/modify a Bullet sample that shows which performance/quality improvement are needed? <br><br>Hope this helps,<br>Erwin<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2">Erwin Coumans</a> — Mon Oct 23, 2006 3:07 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[andrei.lupas]]></name></author>
		<updated>2006-10-23T15:04:53+00:00</updated>

		<published>2006-10-23T15:04:53+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2201#p2201</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2201#p2201"/>
		<title type="html"><![CDATA[Box vs. Box primitive collision in Bullet ?]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2201#p2201"><![CDATA[
<blockquote class="uncited"><div>In the past I had some comparison sample code running the ODE box-box inside Bullet framework without problems. You want me to add this as a demo, for comparison?</div></blockquote>That would be excelent<br><br>Thanks a lot !<br>Andrei.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=1074">andrei.lupas</a> — Mon Oct 23, 2006 3:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dirk Gregorius]]></name></author>
		<updated>2006-10-23T15:01:22+00:00</updated>

		<published>2006-10-23T15:01:22+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2200#p2200</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2200#p2200"/>
		<title type="html"><![CDATA[Box vs. Box primitive collision in Bullet ?]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2200#p2200"><![CDATA[
You must make sure that you clear the accumulated impulses to zero. The sequentiel impulses are clamped against the accumulated impulse when you pass the contact points from dBoxBox. Not applying the accumulated impulse is not enough in your case. Let me know if this helps. At 10 iterations you should be able to do at least 3 boxes without warmstarting. <br><br>Cheers,<br>-Dirk<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=14">Dirk Gregorius</a> — Mon Oct 23, 2006 3:01 pm</p><hr />
]]></content>
	</entry>
	</feed>
