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

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2022-03-23T10:51:21+00:00</updated>

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

		<entry>
		<author><name><![CDATA[LukeMurray]]></name></author>
		<updated>2022-03-23T10:51:21+00:00</updated>

		<published>2022-03-23T10:51:21+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43953#p43953</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43953#p43953"/>
		<title type="html"><![CDATA[Re: Placement of Colliders in MultiBody]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43953#p43953"><![CDATA[
Found a simple solution to this is just to use btCompoundShape and add both the shape and the transform as a child shape.<div class="codebox"><p>Code: </p><pre><code>CompoundShape-&gt;addChildShape(transform/*offset*/, CollisionShape);</code></pre></div><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=14290">LukeMurray</a> — Wed Mar 23, 2022 10:51 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[LukeMurray]]></name></author>
		<updated>2022-03-22T14:38:08+00:00</updated>

		<published>2022-03-22T14:38:08+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43949#p43949</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43949#p43949"/>
		<title type="html"><![CDATA[Placement of Colliders in MultiBody]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43949#p43949"><![CDATA[
Hi all,<br><br>I'm creating a MultiBody and I'm having a hard time figuring out whether or not I am actually supposed to have control over where to place the colliders?<br><br>To take the MultiDofDemo example provided, in the code there is the following:<br><div class="codebox"><p>Code: </p><pre><code>for (int i = 0; i &lt; pMultiBody-&gt;getNumLinks(); ++i){[b]btVector3 posr = local_origin[i + 1] + btVector3(30.f, 1.f, 0.f);////float pos[4]={posr.x(),posr.y(),posr.z(),1};btScalar quat[4] = {-world_to_local[i + 1].x(), -world_to_local[i + 1].y(), -world_to_local[i + 1].z(), world_to_local[i + 1].w()};btCollisionShape* box = new btBoxShape(linkHalfExtents);btMultiBodyLinkCollider* col = new btMultiBodyLinkCollider(pMultiBody, i);col-&gt;setCollisionShape(box);btTransform tr;tr.setIdentity();tr.setOrigin(posr);tr.setRotation(btQuaternion(quat[0], quat[1], quat[2], quat[3]));col-&gt;setWorldTransform(tr);col-&gt;setFriction(friction);pWorld-&gt;addCollisionObject(col, 2, 1 + 2);pMultiBody-&gt;getLink(i).m_collider = col;[/b]}</code></pre></div>What I have found though is once the Collider is set: <div class="codebox"><p>Code: </p><pre><code>pMultiBody-&gt;getLink(i).m_collider = col;</code></pre></div>All the transforms added prior are gone! In fact, I have found the below has the exact same effect:<br><div class="codebox"><p>Code: </p><pre><code>for (int i = 0; i &lt; pMultiBody-&gt;getNumLinks(); ++i){btCollisionShape* box = new btBoxShape(linkHalfExtents);btMultiBodyLinkCollider* col = new btMultiBodyLinkCollider(pMultiBody, i);col-&gt;setCollisionShape(box);col-&gt;setFriction(friction);pWorld-&gt;addCollisionObject(col, 2, 1 + 2);pMultiBody-&gt;getLink(i).m_collider = col;}</code></pre></div>This is currently an issue for me since I have everything working on a MultiBody of my own, however since I am wanting to use capsules I can not rotate them to face the correct way. Am I missing something? <br><br>Thanks everyone, any help would be greatly appreciated!<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=14290">LukeMurray</a> — Tue Mar 22, 2022 2:38 pm</p><hr />
]]></content>
	</entry>
	</feed>
