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

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2014-03-30T22:08:33+00:00</updated>

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

		<entry>
		<author><name><![CDATA[James321]]></name></author>
		<updated>2014-03-30T22:08:33+00:00</updated>

		<published>2014-03-30T22:08:33+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=33239#p33239</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=33239#p33239"/>
		<title type="html"><![CDATA[Problems moving a rigid body with the mouse]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=33239#p33239"><![CDATA[
Hey, (I'm using irrlicht btw)<br><br>I'm making a small side scrolling game for my class, which involves clicking on and moving objects.<br> <br>I have this section of code in my entity's update method which moves it towards the users cursor. This works fine but when it reaches the users cursor it "jitters" past the mouse pointer and then back and so on. <br><div class="codebox"><p>Code: </p><pre><code>core::line3d&lt;f32&gt; ray = game.getDevice()-&gt;getSceneManager()-&gt;getSceneCollisionManager()-&gt;getRayFromScreenCoordinates(inputHandler.getCurrentMouse().Position);vector3df characterPos = getNode()-&gt;getPosition();vector3df targetPos = ray.getClosestPoint(getNode()-&gt;getPosition());vector3df direction = targetPos - characterPos;direction = direction.normalize();direction *= 10;btVector3 dir = btVector3(direction.X,direction.Y,0);getRigidBody()-&gt;activate();getRigidBody()-&gt;setLinearVelocity(dir);_rigidBody-&gt;setLinearFactor(btVector3(1,1,0));_rigidBody-&gt;setAngularFactor(btVector3(0,0,1));</code></pre></div>I would appreciate an help/examples which could fix my problem <br><br>Also suggestions of a better way to do it are welcome<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=10814">James321</a> — Sun Mar 30, 2014 10:08 pm</p><hr />
]]></content>
	</entry>
	</feed>
