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

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2016-08-24T16:03:40+00:00</updated>

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

		<entry>
		<author><name><![CDATA[bone]]></name></author>
		<updated>2016-08-24T16:03:40+00:00</updated>

		<published>2016-08-24T16:03:40+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=38070#p38070</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=38070#p38070"/>
		<title type="html"><![CDATA[Re: How to compute Lateral Friction Direction ?]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=38070#p38070"><![CDATA[
Because friction is modeled as two semi-independent constraints (to model the 2 degrees of freedom on a 2-D surface), it's not really being modeled as a friction circle. More like a friction square or friction diamond. Because of this, you can get artifacts where the overall friction force is not quite opposite of the direction of travel. This makes thing slide in a curve rather than a straight line, and can be quite noticeable.<br><br>In order to improve this behavior, you set the first friction direction as the direction of travel. You'll find that the resulting impulse in that direction is relatively large compared to the impulse in the perpendicular direction (which should be close to zero). This almost completely eliminates the artifact, at least visually.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=1626">bone</a> — Wed Aug 24, 2016 4:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Jack2016]]></name></author>
		<updated>2016-08-24T09:22:20+00:00</updated>

		<published>2016-08-24T09:22:20+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=38069#p38069</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=38069#p38069"/>
		<title type="html"><![CDATA[How to compute Lateral Friction Direction ?]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=38069#p38069"><![CDATA[
After compute the Jacobian of contact point constraint,<br> I compute the Jacobian of friction ,I have to compute the friction Direction Dk whick store in cp.m_lateralFrictionDir1.<br>But it's not clear about why compute this way below<br><div class="codebox"><p>Code: </p><pre><code>btVector3 tbRigidBody::getVelocityInLocalPoint(const btVector3&amp; rel_pos) const{//we also calculate lin/ang velocity for kinematic objectsreturn m_linearVelocity + m_angularVelocity.cross(rel_pos);//for kinematic objects, we could also use use://return (m_worldTransform(rel_pos) - m_interpolationWorldTransform(rel_pos)) / m_kinematicTimeStep;}/////setup the friction constraintsbtVector3 vel1 = rb0 ? rb0-&gt;getVelocityInLocalPoint(rel_pos1) : btVector3(0,0,0);btVector3 vel2 = rb1 ? rb1-&gt;getVelocityInLocalPoint(rel_pos2) : btVector3(0,0,0);vel  = vel1 - vel2;rel_vel = cp.m_normalWorldOnB.dot(vel);{   btVector3 frictionDir1 = vel - cp.m_normalWorldOnB * rel_vel;   btScalar lat_rel_vel = frictionDir1.length2();   if (lat_rel_vel &gt; SIMD_EPSILON)//0.0f)   {      //use projected normal direction as first friction direction and cross product of normal and frictionDir1 as second friction direction      frictionDir1 /= btSqrt(lat_rel_vel);      addFrictionConstraint(frictionDir1,solverBodyIdA,solverBodyIdB,frictionIndex,cp,rel_pos1,rel_pos2,colObj0,colObj1, relaxation);      btVector3 frictionDir2 = frictionDir1.cross(cp.m_normalWorldOnB);      frictionDir2.normalize();      addFrictionConstraint(frictionDir2,solverBodyIdA,solverBodyIdB,frictionIndex,cp,rel_pos1,rel_pos2,colObj0,colObj1, relaxation);   } else   {      //calculate two orthogonal vectors to normal direction      //re-calculate friction direction every frame, todo: check if this is really needed      btVector3   frictionDir1,frictionDir2;      btPlaneSpace1(cp.m_normalWorldOnB,frictionDir1,frictionDir2);      addFrictionConstraint(frictionDir1,solverBodyIdA,solverBodyIdB,frictionIndex,cp,rel_pos1,rel_pos2,colObj0,colObj1, relaxation);      addFrictionConstraint(frictionDir2,solverBodyIdA,solverBodyIdB,frictionIndex,cp,rel_pos1,rel_pos2,colObj0,colObj1, relaxation);   }}</code></pre></div><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=11805">Jack2016</a> — Wed Aug 24, 2016 9:22 am</p><hr />
]]></content>
	</entry>
	</feed>
