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

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2018-10-23T15:26:10+00:00</updated>

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

		<entry>
		<author><name><![CDATA[h4tt3n]]></name></author>
		<updated>2018-10-23T15:26:10+00:00</updated>

		<published>2018-10-23T15:26:10+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=41530#p41530</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=41530#p41530"/>
		<title type="html"><![CDATA[Constrain point on rigid body to line or line segment]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=41530#p41530"><![CDATA[
Hello folks,<br><br>I am implementing a number of rigid body constraints for a small proof-of-concept 2D game demo, and now I'm working on a constraint that limits a point on one rigid body to only move along a line or line segment mapped onto another rigid body. I have a working prototype, but I'd like to be sure I'm doing everything right.<br><br>I've been looking at the really nice tutorials by the author of the <a href="http://www.dyn4j.org/2010/12/line-constraint/" class="postlink">dyn4j engine</a>. <br><br>Basically, I am applying an impulse that is proportional to the displacement perpendicular to the unit vector of the line. This works fine, however, I am not sure how to calculate the right mass matrix. Since I am only constraining motion along one axis, it should be 1x1 ie. a scalar.<br><br>Is this right: M = 1/ma + 1/Ia * ( ra x t )^2 + 1/mb + 1/Ib * ( ( rb + u ) x t )^2<br><br>where ma and mb are masses, Ia and Ib are moments of inertia, ra and rb are point vectors, u is unt vector and t tangent vector.<br><br>Cheers, Mike<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2317">h4tt3n</a> — Tue Oct 23, 2018 3:26 pm</p><hr />
]]></content>
	</entry>
	</feed>
