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

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2022-03-31T08:16:52+00:00</updated>

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

		<entry>
		<author><name><![CDATA[bennicus]]></name></author>
		<updated>2022-03-31T08:16:52+00:00</updated>

		<published>2022-03-31T08:16:52+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43968#p43968</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43968#p43968"/>
		<title type="html"><![CDATA[Re: Best way to detect contact points / manifolds of overlapping kinematic bodies?]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43968#p43968"><![CDATA[
I thought that initally, it's limited to 4 iterations per frame (see btKinematicCharacterController::preStep) so it will correct about 2/3rd of the error in a single frame. But if you are applying movement to your character every frame (e.g. walking into a wall) the error will be back again straight away and it'll never get corrected. Why not just correct the entire interpenetration in a single frame? (This is what I'm doing but I still get jittery motion because the reported contact point shifts a little every frame)<br><br>edit: I guess it could be a fudge to handle the case where the character has multiple contacts in a single frame. I'd prefer if it was a bit less magical and weighted the corrections by the amount of interpenetration of each, for example  <img class="smilies" src="https://pybullet.org/Bullet/phpBB3/images/smilies/icon_lol.gif" width="15" height="15" alt=":lol:" title="Laughing"><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=14297">bennicus</a> — Thu Mar 31, 2022 8:16 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[drleviathan]]></name></author>
		<updated>2022-03-30T16:56:05+00:00</updated>

		<published>2022-03-30T16:56:05+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43967#p43967</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43967#p43967"/>
		<title type="html"><![CDATA[Re: Best way to detect contact points / manifolds of overlapping kinematic bodies?]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43967#p43967"><![CDATA[
I would guess the 0.2 is a tuned magic number that allows the btKinematicCharacterController to extract itself from penetration over several substeps rather than in one.  It moves out 20% every substep and if your simulation is running at 60 substeps per second then the character could reduce penetration to less than 1% after 21 substeps (so about 1/3 of a second), which is probably fast enough for human experience.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=11033">drleviathan</a> — Wed Mar 30, 2022 4:56 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[bennicus]]></name></author>
		<updated>2022-03-30T15:24:01+00:00</updated>

		<published>2022-03-30T15:24:01+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43966#p43966</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43966#p43966"/>
		<title type="html"><![CDATA[Re: Best way to detect contact points / manifolds of overlapping kinematic bodies?]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43966#p43966"><![CDATA[
I noticed that btKinematicCharacterController::recoverFromPenetration is actually doing something very similar to what I'm doing with my kinematic objects. However, when it applies the correction I don't understand why it multiplies the correction distance by 0.2?<div class="codebox"><p>Code: </p><pre><code>m_currentPosition += pt.m_normalWorldOnB * directionSign * dist * btScalar(0.2);penetration = true;</code></pre></div><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=14297">bennicus</a> — Wed Mar 30, 2022 3:24 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[bennicus]]></name></author>
		<updated>2022-03-30T10:27:29+00:00</updated>

		<published>2022-03-30T10:27:29+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43965#p43965</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43965#p43965"/>
		<title type="html"><![CDATA[Best way to detect contact points / manifolds of overlapping kinematic bodies?]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43965#p43965"><![CDATA[
I have a world with multiple kinematic bodies and I want to be able to find all contact points between them. If I do something like:<div class="codebox"><p>Code: </p><pre><code>m_dynamicsWorld-&gt;stepSimulation(dt);int numManifolds = m_dynamicsWorld-&gt;getDispatcher()-&gt;getNumManifolds();for (int i = 0; i &lt; numManifolds; i++) {    btPersistentManifold* manifold = m_dynamicsWorld-&gt;getDispatcher()-&gt;getManifoldByIndexInternal(i);...</code></pre></div>I do get sensible looking manifolds and contact points, but the contact points shift slightly every frame. So for example, if I have a capsule intersecting the floor, I find the contact point and use it to "correct" the capsule location and move it up so that its sitting on top of the floor. On the next frame I move the capsule down again with some fake gravity and get another contact, but the contact point on the floor is slightly different so moving the capsule back to this position results in noticeable jittering.<br><br>I tried doing a capsule sweep instead, and get consistent results each time - I can set the capsule position to the sweep contact point and it's stable. Is there something different about how a sweep works, should I not be using the dispatcher manifolds in this way?<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=14297">bennicus</a> — Wed Mar 30, 2022 10:27 am</p><hr />
]]></content>
	</entry>
	</feed>
