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

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2006-11-24T13:00:02+00:00</updated>

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

		<entry>
		<author><name><![CDATA[Erwin Coumans]]></name></author>
		<updated>2006-11-24T13:00:02+00:00</updated>

		<published>2006-11-24T13:00:02+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2559#p2559</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2559#p2559"/>
		<title type="html"><![CDATA[Re: how to make 2 boxes do not collision]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2559#p2559"><![CDATA[
<blockquote class="uncited"><div>for example, there are 2 boxes in a room,<br>i only want to the box can collision with the room's wall,<br>i do not want to the collision between the boxes,<br>how can i do it ?<br>thanks!</div></blockquote>There are a few ways. The easiest is to assign different collision groups, and collision filter flags to the boxes.<br><br>By default, once you add a rigidbody to the dynamics world, it gets automatically assigned collision filter flags: this prevents collision between static versus static objects. In code this is:<div class="codebox"><p>Code: </p><pre><code>          short collisionFilterGroup = isDynamic? btBroadphaseProxy::DefaultFilter : btBroadphaseProxy::StaticFilter;          short collisionFilterMask = isDynamic?  btBroadphaseProxy::AllFilter :  btBroadphaseProxy::AllFilter ^ btBroadphaseProxy::StaticFilter;rigidbody-&gt;getBroadphaseProxy()-&gt;m_collisionFilterGroup = collisionFilterGroup;rigidbody-&gt;getBroadphaseProxy()-&gt;m_collisionFilterMask = collisionFilterMask;</code></pre></div>Remember to re-assign a new collisionFilterGroup and collisionFilterMask AFTER you added the rigidbody to the world. Otherwise the rigidbody won't have a broadphase proxy yet.<br><br>The collisionFilterMask determines (filters) the collision objects belonging to certain collisionFilterGroups to collision with. The group/mask is stored as short integer,so this gives 16 different groups of objects. Some default groups are defined:<div class="codebox"><p>Code: </p><pre><code> ///optional filtering to cull potential collisions       enum CollisionFilterGroups        {                DefaultFilter = 1,                StaticFilter = 2,                KinematicFilter = 4,                DebrisFilter = 8,                AllFilter = DefaultFilter | StaticFilter | KinematicFilter | DebrisFilter,};</code></pre></div>I will add some Bullet Demo that demonstrates its use.<br>Thanks,<br>Erwin<br><br>PS: If you need more fine grain control, you can override the 'needsCollision' by deriving your own version of the btCollisionDispatcher. This is tricky, so I might just add some callback that you can register for to prevent collisions between certain objects.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2">Erwin Coumans</a> — Fri Nov 24, 2006 1:00 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[sssa2000]]></name></author>
		<updated>2006-11-20T09:08:25+00:00</updated>

		<published>2006-11-20T09:08:25+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2524#p2524</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2524#p2524"/>
		<title type="html"><![CDATA[how to make 2 boxes do not collision]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2524#p2524"><![CDATA[
for example, there are 2 boxes in a room,<br>i only want to the box can collision with the room's wall,<br>i do not want to the collision between the boxes,<br>how can i do it ?<br>thanks!<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=1095">sssa2000</a> — Mon Nov 20, 2006 9:08 am</p><hr />
]]></content>
	</entry>
	</feed>
