<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Maratis forum - when are physics shapes and objects deleted?]]></title>
	<link rel="self" href="http://forum.maratis3d.com/extern.php?action=feed&amp;tid=823&amp;type=atom"/>
	<updated>2013-10-15T10:31:19Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.maratis3d.com/viewtopic.php?id=823</id>
		<entry>
			<title type="html"><![CDATA[Re: when are physics shapes and objects deleted?]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=5541#p5541"/>
			<content type="html"><![CDATA[<p>Still, I consider this not the expected behavior.<br />If you do a lua function &quot;deleteEntity()&quot; I&#039;m sure you will delete all the associated physics objects, so the same should be with C++.<br />You can make MScene do this, while the MOEntity code shouldn&#039;t need to be touched. I think this would keep a good design/structure.</p>]]></content>
			<author>
				<name><![CDATA[255]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2540</uri>
			</author>
			<updated>2013-10-15T10:31:19Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=5541#p5541</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: when are physics shapes and objects deleted?]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=5471#p5471"/>
			<content type="html"><![CDATA[<p>Yes, in this case you will need to destroy or at least deactivate the physics object manually just before :</p><p>MPhysicsProperties * phyProps = plane-&gt;getPhysicsProperties();<br />if(phyProps)<br />&nbsp; &nbsp; physics-&gt;deactivateObject(phyProps-&gt;getCollisionObjectId());</p>]]></content>
			<author>
				<name><![CDATA[anael]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2</uri>
			</author>
			<updated>2013-10-12T08:52:58Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=5471#p5471</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: when are physics shapes and objects deleted?]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=5463#p5463"/>
			<content type="html"><![CDATA[<p>This is &quot;preparing&quot;, &quot;initializing&quot;, but I&#039;m talking about deleting an entity or its physics properties. The actual physics objects and shapes are NOT deleted.<br />I was just guessing, reading the source code, but now I&#039;ve done a test and it&#039;s actually a real bug.</p><p>Create a project, create a falling box and a plane with mass 0.00 to stop the falling box.<br />In your game plugin do<br /></p><div class="codebox"><pre><code>MOEntity* plane = scene-&gt;getEntityByName(&quot;Plane&quot;);
scene-&gt;deleteObject(plane);</code></pre></div><p>Run the game, the box will fall and it will soon be stopped by the invisible physics object left by the plane entity.</p>]]></content>
			<author>
				<name><![CDATA[255]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2540</uri>
			</author>
			<updated>2013-10-12T00:49:44Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=5463#p5463</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: when are physics shapes and objects deleted?]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=5461#p5461"/>
			<content type="html"><![CDATA[<p>shapes and objects are automatically deleted by the physics context clear() function<br />MBulletContext::clear(void)</p><p>clear is called by MBulletContext::init, itself called by MScene::preparePhysics</p>]]></content>
			<author>
				<name><![CDATA[anael]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2</uri>
			</author>
			<updated>2013-10-11T22:33:49Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=5461#p5461</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[when are physics shapes and objects deleted?]]></title>
			<link rel="alternate" href="http://forum.maratis3d.com/viewtopic.php?pid=5458#p5458"/>
			<content type="html"><![CDATA[<p>I see that MPhysicsContext has deleteShape() and deleteObject() method but I don&#039;t see them used anywhere.<br />If I do<br /></p><div class="codebox"><pre><code>entity-&gt;createPhysicsProperties();</code></pre></div><p>physics properties and constraint are SAFE_DELETEd which means<br /></p><div class="codebox"><pre><code>delete pointer;
pointer = NULL;</code></pre></div><p>but the physics shape and object are not deleted.<br />I then call<br /></p><div class="codebox"><pre><code>scene-&gt;prepareCollisionShape(entity);
scene-&gt;prepareCollisionObject(entity);</code></pre></div><p>but in these functions there is no deleting of the previous object neither.</p>]]></content>
			<author>
				<name><![CDATA[255]]></name>
				<uri>http://forum.maratis3d.com/profile.php?id=2540</uri>
			</author>
			<updated>2013-10-11T19:33:20Z</updated>
			<id>http://forum.maratis3d.com/viewtopic.php?pid=5458#p5458</id>
		</entry>
</feed>
