<?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/8746" />

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2013-02-14T16:59:20+00:00</updated>

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

		<entry>
		<author><name><![CDATA[Dirk Gregorius]]></name></author>
		<updated>2013-02-14T16:59:20+00:00</updated>

		<published>2013-02-14T16:59:20+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=29990#p29990</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=29990#p29990"/>
		<title type="html"><![CDATA[Re: Collision with a quad terrain]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=29990#p29990"><![CDATA[
That should not double the impulse. Say you solve the same contact point twice in a row. In the first pass you solve the contact point the relative velocity becomes zero. In the second pass the relative velocity is zero and there is no impulse. So if the impulse doubles this is a bug. I would drop a box onto a vertex where eight triangles originate. This should not make any problems. I would solve this first.<br><br>The convex hull approach is nice, but what if the triangles are concave? You might get ghost collisions. I would still use some processing. E.g. for the example above you really don't want to solve eight manifolds. Even though it is robust it is just not efficient. Instead I would cluster triangles with a similar normal (e.g. k-means). Three clusters are usually sufficient. There is an article about this in GPG 4 by Adam and Pierre from nVidia.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=14">Dirk Gregorius</a> — Thu Feb 14, 2013 4:59 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[c0der]]></name></author>
		<updated>2013-02-14T06:22:12+00:00</updated>

		<published>2013-02-14T06:22:12+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=29987#p29987</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=29987#p29987"/>
		<title type="html"><![CDATA[Re: Collision with a quad terrain]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=29987#p29987"><![CDATA[
Found a problem with this approach, for anyone who may run into this problem...<br><br> Testing against 6 triangles generates more contacts than necessary, leading to jittery physics. An example is two contacts on neighbouring triangles are too close and cause double the impulse in close proximity. <br><br>I have now used a convex hull approach, building a convex hull dynamically according to the triangles of the terrain that the OBB intersects and finally running a SAT test against the hull. <br><br>This is a much better approach. I implemented the quickhull algorithm to build the convex hull. I have not made it robust yet i.e. handling if the outer point is too close to the hyperplane of a face etc. but after running some tests, it works perfectly well for a terrain, where the patches of triangles collided against are near convex anyway.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=9431">c0der</a> — Thu Feb 14, 2013 6:22 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dirk Gregorius]]></name></author>
		<updated>2013-01-28T00:37:29+00:00</updated>

		<published>2013-01-28T00:37:29+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=29798#p29798</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=29798#p29798"/>
		<title type="html"><![CDATA[Re: Collision with a quad terrain]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=29798#p29798"><![CDATA[
They only maintain a small portion of the game in memory and stream in what is needed.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=14">Dirk Gregorius</a> — Mon Jan 28, 2013 12:37 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[c0der]]></name></author>
		<updated>2013-01-26T13:28:53+00:00</updated>

		<published>2013-01-26T13:28:53+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=29792#p29792</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=29792#p29792"/>
		<title type="html"><![CDATA[Re: Collision with a quad terrain]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=29792#p29792"><![CDATA[
That's true! It is interesting how large games such as GTA handle a large amount of collisions in a huge world. Perhaps things like using really simple primitives like bounding spheres to keep objects from overlapping each other when they're out of view or too far from the camera for the detail to be seen, and taking advantage of putting objects to sleep.<br><br>This is similar to using LOD for rendering the world, as for rendering kilometres of terrain.<br><br>That's just my thoughts on the logic of it but I am not really sure if it's the best approach.<br><br>What do the experienced pros think of this?<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=9431">c0der</a> — Sat Jan 26, 2013 1:28 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dirk Gregorius]]></name></author>
		<updated>2013-01-25T20:58:54+00:00</updated>

		<published>2013-01-25T20:58:54+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=29788#p29788</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=29788#p29788"/>
		<title type="html"><![CDATA[Re: Collision with a quad terrain]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=29788#p29788"><![CDATA[
Nice! There was another I thing I noticed. You cannot cull collision if it not in the camera. This essentially means everything that is not visible will fall out of the world.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=14">Dirk Gregorius</a> — Fri Jan 25, 2013 8:58 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[c0der]]></name></author>
		<updated>2013-01-25T09:46:02+00:00</updated>

		<published>2013-01-25T09:46:02+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=29782#p29782</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=29782#p29782"/>
		<title type="html"><![CDATA[Re: Collision with a quad terrain]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=29782#p29782"><![CDATA[
Solved, used a grid to partition the terrain and simple AABB tests to narrow the collision down to 6 triangles and finally applied SAT to generate contacts between the terrain triangles and OBB. <br><br>Very fast for anyone who is trying to find a way to do OBB-terrain collisions with physics response<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=9431">c0der</a> — Fri Jan 25, 2013 9:46 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[c0der]]></name></author>
		<updated>2013-01-13T03:25:06+00:00</updated>

		<published>2013-01-13T03:25:06+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=29658#p29658</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=29658#p29658"/>
		<title type="html"><![CDATA[Collision with a quad terrain]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=29658#p29658"><![CDATA[
Hi,<br><br>I have a terrain partitioned into a quadtree and the rendering is fast, but collision detection for physics is slow. <br><br>I am trying to test an OBB against the terrain as follows:<br><br>Basically, if the node is in the viewing frustum, and we are at the leaf node, I check if the OBB is above that visible node's AABB. This is a fast SAT test that doesn't affect the frame rate. <br><br>Now that there are 2192 triangles in the node that the OBB is above, it is inefficient to perform the SAT test on every one of those triangles and it is slowing the frame rate considerably for physics.<br><br>Does anyone have any suggestions on how I would go about performing the collision detection. Should I build a smaller quadtree out of those triangles and do the collision tests?<br><div class="codebox"><p>Code: </p><pre><code>void CollisionQuadtreeNode *pNode, Plane *pFrustumPlanes, const OBB &amp;obb){    // Check if node is in the view frustum        if(pNode-&gt;aabb.cull(pFrustumPlanes)==CULLED) {                return;        }                int nCountChilds = 0;                for(int i=0; i&lt;4; ++i) {                if(pNode-&gt;pNodes[i]!=NULL) {                        nCountChilds++;                        testOBBIntersect(pNode-&gt;pNodes[i], pFrustumPlanes, obb, pContactData);                }        }                // This is not a leaf node as it has children        if(nCountChilds&gt;0)                return;         // Test for overlap on the x-z plane        OBB tmpOBB = obb;        tmpOBB.m_vCenter.y = pNode-&gt;aabb.m_vCenter.y;         // Check if OBB is above the terrain node        if(!pNode-&gt;aabb.intersects(tmpOBB))                return;         for(int i=0; i&lt;pNode-&gt;iNumTriangles; ++i) {                if(!pNode-&gt;triangleList[i].m_AABB.intersects(obb))                        continue;                                // Collision with triangle's AABB occurred                break;        }         return;}</code></pre></div><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=9431">c0der</a> — Sun Jan 13, 2013 3:25 am</p><hr />
]]></content>
	</entry>
	</feed>
