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

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

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

		<entry>
		<author><name><![CDATA[teolazza]]></name></author>
		<updated>2021-04-28T15:25:37+00:00</updated>

		<published>2021-04-28T15:25:37+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43420#p43420</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43420#p43420"/>
		<title type="html"><![CDATA[SOLVER_DISABLE_VELOCITY_DEPENDENT_FRICTION_DIRECTION if setting friction directions in gContactAddedCallback]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=43420#p43420"><![CDATA[
In my gContactAddedCallback I always set m_lateralFrictionDir1 and m_lateralFrictionDir2.<br>Should I set the flag SOLVER_DISABLE_VELOCITY_DEPENDENT_FRICTION_DIRECTION<div class="codebox"><p>Code: </p><pre><code>pWorld-&gt;getSolverInfo().m_solverMode |= SOLVER_DISABLE_VELOCITY_DEPENDENT_FRICTION_DIRECTION ;</code></pre></div>?<br><br>Would setting it give me advantages?<br><br>This is part of my contactAddedCallback<div class="codebox"><p>Code: </p><pre><code>auto[direction, desired_speed] = ...// In case it helps, note that soft body friction is controlled via the softBody-&gt;m_cfg.kDF parameter (0 = no friction, 1 = max):// http://bulletphysics.org/Bullet/phpBB3/viewtopic.php?t=6730// m_lateralFrictionDir1 is in local coordinatesauto proposed_lateral_friction_dir1 = beltBody.getWorldTransform().getBasis() * direction;auto proposed_lateral_friction_dir2 = proposed_lateral_friction_dir1.cross(cp.m_normalWorldOnB);// we should normalize dir2, but only if possiblebtScalar l2 = proposed_lateral_friction_dir2.length2();if (l2 &gt;= SIMD_EPSILON * SIMD_EPSILON){// yes: this is now normalized!proposed_lateral_friction_dir2 /= btSqrt(l2);cp.m_lateralFrictionDir1 = std::move(proposed_lateral_friction_dir1);cp.m_contactMotion1 = desired_speed;// This is needed together with SOLVER_USE_2_FRICTION_DIRECTIONS// m_lateralFrictionDir2 should always be perpendicular to m_lateralFrictionDir1cp.m_lateralFrictionDir2 = std::move(proposed_lateral_friction_dir2);cp.m_combinedFriction = ...if (not body.isActive())body.activate();cp.m_contactPointFlags |= BT_CONTACT_FLAG_LATERAL_FRICTION_INITIALIZED;}</code></pre></div>Thanks<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=12317">teolazza</a> — Wed Apr 28, 2021 3:25 pm</p><hr />
]]></content>
	</entry>
	</feed>
