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

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2006-11-18T16:53:56+00:00</updated>

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

		<entry>
		<author><name><![CDATA[Erwin Coumans]]></name></author>
		<updated>2006-11-18T16:53:56+00:00</updated>

		<published>2006-11-18T16:53:56+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2514#p2514</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2514#p2514"/>
		<title type="html"><![CDATA[Re: Removing a rigid body]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2514#p2514"><![CDATA[
<blockquote class="uncited"><div><blockquote class="uncited"><div><br>Please check out the BasicDemo for the right order to remove things:<br></div></blockquote>What about the btDefaultMotionState pointer (created in DemoApplication::localCreateRigidBody()  )?<br>Shouldn't this also be explicitly deleted? <br>Thanks.</div></blockquote>Indeed, that needs to be explicitly deleted indeed. If you already have a graphics object, its destructor would be a good place to delete the motionstate. In the simple Bullet demos, there are no graphics 'objects'.<br>I'll add some cleanup code in DemoApplication.<br><br>Thanks for the feedback,<br>Erwin<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2">Erwin Coumans</a> — Sat Nov 18, 2006 4:53 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nomad]]></name></author>
		<updated>2006-11-18T16:38:19+00:00</updated>

		<published>2006-11-18T16:38:19+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2513#p2513</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2513#p2513"/>
		<title type="html"><![CDATA[Re: Removing a rigid body]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2513#p2513"><![CDATA[
<blockquote class="uncited"><div><br>Please check out the BasicDemo for the right order to remove things:<br></div></blockquote>What about the btDefaultMotionState pointer (created in DemoApplication::localCreateRigidBody()  )?<br>Shouldn't this also be explicitly deleted? <br>Thanks.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=600">nomad</a> — Sat Nov 18, 2006 4:38 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nomad]]></name></author>
		<updated>2006-11-13T19:29:55+00:00</updated>

		<published>2006-11-13T19:29:55+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2427#p2427</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2427#p2427"/>
		<title type="html"><![CDATA[Removing a rigid body]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2427#p2427"><![CDATA[
Thanks for that ... removeRigidBody() isn't referenced in the docs, and I didn't think to search all the source for removeRigidBody <img class="smilies" src="https://pybullet.org/Bullet/phpBB3/images/smilies/icon_redface.gif" width="15" height="15" alt=":oops:" title="Embarassed"><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=600">nomad</a> — Mon Nov 13, 2006 7:29 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Erwin Coumans]]></name></author>
		<updated>2006-11-13T18:58:57+00:00</updated>

		<published>2006-11-13T18:58:57+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2426#p2426</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2426#p2426"/>
		<title type="html"><![CDATA[Re: Removing a rigid body]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2426#p2426"><![CDATA[
<blockquote class="uncited"><div>What is the correct way to remove a rigid body from btDynamicsWorld? Unless I am missing something simple, there is nothing like a btDynamicsWorld::removeRigidBody() function.<br>Just deleting the rigid body causes btDynamicsWorld::stepSimulation() to crash.<br>Thanks.</div></blockquote>Pressing 'END' key should remove objects in most Bullet demos. Which version of Bullet are you using? There should be<br>virtual void    removeRigidBody(btRigidBody* body);<br><br>Please check out the BasicDemo for the right order to remove things:<div class="codebox"><p>Code: </p><pre><code>void    BasicDemo::exitPhysics(){        //cleanup in the reverse order of creation/initialization        //remove the rigidbodies from the dynamics world and delete them        int i;        for (i=m_dynamicsWorld-&gt;getNumCollisionObjects()-1; i&gt;=0 ;i--)        {                btCollisionObject* obj = m_dynamicsWorld-&gt;getCollisionObjectArray()[i];                m_dynamicsWorld-&gt;removeCollisionObject( obj );                delete obj;        }        //delete collision shapes        for (unsigned int j=0;j&lt;m_collisionShapes.size();j++)        {                btCollisionShape* shape = m_collisionShapes[j];                delete shape;        }        //delete dynamics world        delete m_dynamicsWorld;        //delete collision algorithms creation functions        delete m_sphereSphereCF;        delete m_sphereBoxCF;        delete m_boxSphereCF;        //delete solver        delete m_solver;        //delete broadphase        delete m_overlappingPairCache;        //delete dispatcher        delete m_dispatcher;}</code></pre></div>There might be functionaly missing for objects with constraints involved, I have to check that out. Notice that collision shapes can be re-used among several rigidbodies.<br><br>This should be really in the Bullet User Manual.<br><br>Thanks for the feedback,<br>Erwin<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2">Erwin Coumans</a> — Mon Nov 13, 2006 6:58 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nomad]]></name></author>
		<updated>2006-11-13T18:43:17+00:00</updated>

		<published>2006-11-13T18:43:17+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2425#p2425</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2425#p2425"/>
		<title type="html"><![CDATA[Removing a rigid body]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=2425#p2425"><![CDATA[
What is the correct way to remove a rigid body from btDynamicsWorld? Unless I am missing something simple, there is nothing like a btDynamicsWorld::removeRigidBody() function.<br>Just deleting the rigid body causes btDynamicsWorld::stepSimulation() to crash.<br>Thanks.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=600">nomad</a> — Mon Nov 13, 2006 6:43 pm</p><hr />
]]></content>
	</entry>
	</feed>
