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

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2020-10-14T13:19:25+00:00</updated>

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

		<entry>
		<author><name><![CDATA[drleviathan]]></name></author>
		<updated>2020-10-14T13:19:25+00:00</updated>

		<published>2020-10-14T13:19:25+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43133#p43133</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43133#p43133"/>
		<title type="html"><![CDATA[Re: collision problem - broadphase pair]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43133#p43133"><![CDATA[
<blockquote class="uncited"><div>So if at at instant Y, after i moved the object and called the <strong class="text-strong">PerformDiscreteCollisionDetection</strong>, I don't receive the expected pair in the <strong class="text-strong">needBroadphaseCollision</strong> it can only means that the bound proxies don't overlap. Is it right?</div></blockquote>I believe that is correct.  The <strong class="text-strong">needBroadphaseCollision</strong> would be called inside <strong class="text-strong">computeOverlappingPairs()</strong> and would be used to keep or discard candidate overlaps.  Once the valid pairs are computed they really are cached: you can "process" them using the dispatcher method.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=11033">drleviathan</a> — Wed Oct 14, 2020 1:19 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Enrico Cappelletto]]></name></author>
		<updated>2020-10-14T08:22:07+00:00</updated>

		<published>2020-10-14T08:22:07+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43132#p43132</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43132#p43132"/>
		<title type="html"><![CDATA[Re: collision problem - broadphase pair]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43132#p43132"><![CDATA[
Thank you very much for the explanation. <br>I am still missing few piece in order to come full circle.<br><br>So, let's say that at the moment <strong class="text-strong">X</strong> when <strong class="text-strong">n+1</strong> is added the bounds proxies don't overlap and that i do not add any other objects in the collisionWorld. In a successive moment Y (with Y &gt; x) the two objects are moved and now they shoud overlap. <br>So when I call PerformDiscreteCollisionDetection <br><div class="codebox"><p>Code: </p><pre><code>updateAabbs();computeOverlappingPairs();btDispatcher* dispatcher = getDispatcher();{BT_PROFILE("dispatchAllCollisionPairs");if (dispatcher)dispatcher-&gt;dispatchAllCollisionPairs(m_broadphasePairCache-&gt;getOverlappingPairCache(), dispatchInfo, m_dispatcher1);}</code></pre></div>this clearly updates the bounding box of all the active objects in the collision world and calls <strong class="text-strong">computeOverlappingPairs</strong>.  This <strong class="text-strong">computeOverlappingPairs </strong> will analyze only the pairs in the pair cache that is has been already computed?<br>If the answer is yes i suppose that the function <strong class="text-strong">needsBroadphaseCollision </strong>will be called when an object is added in the collision world and each time the bounding box is being updated but only for pairs that overlap.<br><br>So if at at instant Y, after i moved the object and called the PerformDiscreteCollisionDetection, I don't receive the expected pair in the <strong class="text-strong">needBroadphaseCollision </strong> it can only means that the bound proxies don't overlap. Is it right?<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=13233">Enrico Cappelletto</a> — Wed Oct 14, 2020 8:22 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[drleviathan]]></name></author>
		<updated>2020-10-13T15:10:34+00:00</updated>

		<published>2020-10-13T15:10:34+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43125#p43125</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43125#p43125"/>
		<title type="html"><![CDATA[Re: collision problem - broadphase pair]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43125#p43125"><![CDATA[
The <strong class="text-strong">btOverlappingPairCache::needsBroadphaseCollision()</strong> implementation looks like this:<div class="codebox"><p>Code: </p><pre><code>        SIMD_FORCE_INLINE bool needsBroadphaseCollision(btBroadphaseProxy * proxy0, btBroadphaseProxy * proxy1) const        {                if (m_overlapFilterCallback)                        return m_overlapFilterCallback-&gt;needBroadphaseCollision(proxy0, proxy1);                bool collides = (proxy0-&gt;m_collisionFilterGroup &amp; proxy1-&gt;m_collisionFilterMask) != 0;                collides = collides &amp;&amp; (proxy1-&gt;m_collisionFilterGroup &amp; proxy0-&gt;m_collisionFilterMask);                return collides;        }</code></pre></div>There are two things to notice:<br><strong class="text-strong">(1)</strong> If <strong class="text-strong">m_overlapFilterCallback</strong> has been supplied then the function defers to it.<br><strong class="text-strong">(2)</strong> Otherwise it only returns true if both <strong class="text-strong">filter0&amp;mask1</strong> and <strong class="text-strong">filter1&amp;mask0</strong> have overlapping bits.<br><br>If you have <strong class="text-strong">n</strong> objects in the broadphase and add the <strong class="text-strong">n+1</strong> object... it does not necessarily call that function <strong class="text-strong">n</strong> times.  Instead it adds the bounding box to a <strong class="text-strong">btDbvt</strong> (dynamic bounding volume tree) of bounds "proxies" and for each fresh overlap (<strong class="text-strong">n</strong> or less) it calls <strong class="text-strong">btOverlappingPairCache::addOverlappingPair()</strong> and the <strong class="text-strong">PairCache</strong> will use <strong class="text-strong">needsBroadphaseCollision()</strong> to decide if it needs to remember that overlap or not.<br><br>If the function is not being called for an expected pair then we must conclude: either <strong class="text-strong">(a)</strong> the bounds proxies don't overlap at the moment when <strong class="text-strong">n+1</strong> is added to the broadphase or <strong class="text-strong">(b)</strong> there is a bug in broadphase logic.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=11033">drleviathan</a> — Tue Oct 13, 2020 3:10 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Enrico Cappelletto]]></name></author>
		<updated>2020-10-12T15:13:47+00:00</updated>

		<published>2020-10-12T15:13:47+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43124#p43124</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43124#p43124"/>
		<title type="html"><![CDATA[collision problem - broadphase pair]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43124#p43124"><![CDATA[
Hi everyone, <br><br>I have a collision world that contains all the parts of a panel bending machine, there are a lot of parts (one houndred and half parts). I divided them in 14 groups and used masks to filter collisions.<br>I have a problem with the collisions detection. In a particolar moment i know that two objects are colliding but the collision is not detected. <br>I think that the problem is in the broadphase, because if i register the filter callback i see that at the beginning the pair of solids that shoud be in collision is not considered. there is no callback for the two objects. Maybe i am misunderstanding something.<br><br>I know that broadphase pairs are only added incrementally when I add a new object in the collision world and I had assumed that when I add a new object <em class="text-italics">needBroadphaseCollision</em> would be invoked n times, one for each solid already present in the world. In this way the pair cache is filled only with the pairs that are compatible with groups/masks.<br>Is it true? is it what shoud i expect?? What can be the problem???<br><br>Thank you in advance for any reply.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=13233">Enrico Cappelletto</a> — Mon Oct 12, 2020 3:13 pm</p><hr />
]]></content>
	</entry>
	</feed>
