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

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2022-05-05T15:13:37+00:00</updated>

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

		<entry>
		<author><name><![CDATA[drleviathan]]></name></author>
		<updated>2022-05-05T15:13:37+00:00</updated>

		<published>2022-05-05T15:13:37+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=44005#p44005</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=44005#p44005"/>
		<title type="html"><![CDATA[Re: How to know if a body is colliding]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=44005#p44005"><![CDATA[
One way to do it is to scan all of the contact manifolds after each step.  So something like this:<div class="codebox"><p>Code: </p><pre><code>void updateContactMap(btCollisionDispatcher* collision_dispatcher) {    int num_manifolds = collision_dispatcher-&gt;getNumManifolds();    for (int i = 0; i &lt; num_manifolds; ++i) {        btPersistentManifold* contact_manifold =  collision_dispatcher-&gt;getManifoldByIndexInternal(i);        // sometimes you get a manifold with zero contacts so filter for that case        if (contact_manifold-&gt;getNumContacts() &gt; 0) {            const btCollisionObject* object_A = contact_manifold-&gt;getBody0();                                       const btCollisionObject* object_B = contact_manifold-&gt;getBody1();                                       // ... do something        }    }}</code></pre></div>Where the <strong class="text-strong">collision_dispatcher</strong> is the one you gave the <strong class="text-strong">btDiscreteDynamicsWorld</strong> when you created it.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=11033">drleviathan</a> — Thu May 05, 2022 3:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[maiklof]]></name></author>
		<updated>2022-05-01T21:16:43+00:00</updated>

		<published>2022-05-01T21:16:43+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=44000#p44000</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=44000#p44000"/>
		<title type="html"><![CDATA[How to know if a body is colliding]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=44000#p44000"><![CDATA[
Hi,<br>I am looking for a way to know if a body with a collision shape is having a collision with another collision shape. Is there any method to get the answer as a boolean (True if it has one or several collisions), or a way to get the total number of collisions points?<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=10570">maiklof</a> — Sun May 01, 2022 9:16 pm</p><hr />
]]></content>
	</entry>
	</feed>
