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

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2006-11-23T23:48:04+00:00</updated>

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

		<entry>
		<author><name><![CDATA[detox]]></name></author>
		<updated>2006-11-23T23:48:04+00:00</updated>

		<published>2006-11-23T23:48:04+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2555#p2555</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2555#p2555"/>
		<title type="html"><![CDATA[very simple Bullet library integration question]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2555#p2555"><![CDATA[
Yes that helped, thank you.<br><br>I now have Bullet up and running in Ogre3D.  Thankfully it appears that Ogre and Bullet use the same conventions for quaternions.  btQuanternion.getW() works fine with Ogre anyway.  I'll probably modify it later to just copy the matrix elements over, but for now it works well enough for demos and testing.<br><br>Now I just do something like this in the init loop to setup the Bullet physics and collision world (with default values) -<br>bulletworld = new coreBullet( scenemgr );<br>...<br>Then add a box like this -<br>bulletworld-&gt;addBox( my_ogrescenenode, Vector3( 2, 2, 2 ), 10 );<br><br>...and then add this to an Ogre frame listener:<br>bulletworld-&gt;processNodeList( evt.timeSinceLastFrame );<br><br>... and it all just works!<br><br>Anway I'm pretty happy, I'll post a demo or screenshots to the proper forum area maybe later.<br><br>Thanks again Erwin, great code.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=1256">detox</a> — Thu Nov 23, 2006 11:48 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Erwin Coumans]]></name></author>
		<updated>2006-11-22T19:29:45+00:00</updated>

		<published>2006-11-22T19:29:45+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2546#p2546</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2546#p2546"/>
		<title type="html"><![CDATA[Re: very simple Bullet library integration question]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2546#p2546"><![CDATA[
Yes, it is a good idea to derive your own version of btMotionState. Then you can just use getOrigin to retrieve the world position from the btTransform. To get the orientation you can use either quaternions (using getOrientation()) or a 3x3 matrix (using getBasis())<br><br>It depends what your graphics subsystem 'setOrientation' accepts. Note that not all libraries use the same quaternion convention ('w' component has opposite sign, order is different etc).<br><br>Hope this helps,<br>Erwin<br><br><blockquote class="uncited"><div>Hi,<br><br>I have a very simple question about integrating Bullet into my software.  I have inhereted the btMotionState class and added my necessary data.  My question is, what is the best way to translate Bullet's position and orientation data into my graphics sub-system?<br><br>I noticed that the btTransform class (m_graphicsWorldTrans in the btMotionState class) has a getOpenGLMatrix() function, which is nice, but doesn't help me as I am not using OpenGL directly for gfx rendering.  Can I simply use m_graphicsWorldTrans.getRotation() and m_graphicsWorldTrans.getOrigin()?<br><br>Will something like this work?<div class="codebox"><p>Code: </p><pre><code>    btVector3 origin = m_graphicsWorldTrans.getOrigin();    btQuaternion rot = m_graphicsWorldTrans.getRotation();    node-&gt;setPosition( origin.x(), origin.y(), origin.z() );    node-&gt;setOrientation( rot.w(), rot.x(), rot.y(), rot.z() );</code></pre></div>Great physics library BTW, thanks!</div></blockquote><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2">Erwin Coumans</a> — Wed Nov 22, 2006 7:29 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[detox]]></name></author>
		<updated>2006-11-22T19:03:26+00:00</updated>

		<published>2006-11-22T19:03:26+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2545#p2545</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2545#p2545"/>
		<title type="html"><![CDATA[very simple Bullet library integration question]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2545#p2545"><![CDATA[
Hi,<br><br>I have a very simple question about integrating Bullet into my software.  I have inhereted the btMotionState class and added my necessary data.  My question is, what is the best way to translate Bullet's position and orientation data into my graphics sub-system?<br><br>I noticed that the btTransform class (m_graphicsWorldTrans in the btMotionState class) has a getOpenGLMatrix() function, which is nice, but doesn't help me as I am not using OpenGL directly for gfx rendering.  Can I simply use m_graphicsWorldTrans.getRotation() and m_graphicsWorldTrans.getOrigin()?<br><br>Will something like this work?<div class="codebox"><p>Code: </p><pre><code>    btVector3 origin = m_graphicsWorldTrans.getOrigin();    btQuaternion rot = m_graphicsWorldTrans.getRotation();    node-&gt;setPosition( origin.x(), origin.y(), origin.z() );    node-&gt;setOrientation( rot.w(), rot.x(), rot.y(), rot.z() );</code></pre></div>Great physics library BTW, thanks!<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=1256">detox</a> — Wed Nov 22, 2006 7:03 pm</p><hr />
]]></content>
	</entry>
	</feed>
