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

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2010-09-13T12:51:44+00:00</updated>

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

		<entry>
		<author><name><![CDATA[Erwin Coumans]]></name></author>
		<updated>2010-09-13T12:51:44+00:00</updated>

		<published>2010-09-13T12:51:44+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=20131#p20131</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=20131#p20131"/>
		<title type="html"><![CDATA[Re: Serializing Multiple Bullet Objects]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=20131#p20131"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>char* serialName = new char[8];</code></pre></div>The serialName is shared and overwritten for all bodies/shapes. This is not OK because there is no copy made, so during btDynamicsWorld::serialize, all bodies will have the same name.<br><br>Try allocating a name for each body/shape dynamically and don't share the memory.<br><br>Thanks,<br>Erwin<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2">Erwin Coumans</a> — Mon Sep 13, 2010 12:51 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Erwin Coumans]]></name></author>
		<updated>2010-09-13T02:03:53+00:00</updated>

		<published>2010-09-13T02:03:53+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=20128#p20128</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=20128#p20128"/>
		<title type="html"><![CDATA[Re: Serializing Multiple Bullet Objects]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=20128#p20128"><![CDATA[
The serialization support multiple objects and multiple constaints. It is not clear what is going wrong. Serializing using unique names for bodies/shapes should work fine.<br>It is recommended that you don't use the serializeSingleObject but use the btDynamicsWorld::serialize instead:<div class="codebox"><p>Code: </p><pre><code>//create a large enough buffer. There is no method to pre-calculate the buffer size yet.int maxSerializeBufferSize = 1024*1024*5; btDefaultSerializer*serializer = new btDefaultSerializer(maxSerializeBufferSize);dynamicsWorld-&gt;serialize(serializer); FILE* file = fopen("testFile.bullet","wb");fwrite(serializer-&gt;getBufferPointer(),serializer-&gt;getCurrentBufferSize(),1, file);fclose(file);</code></pre></div>See also <a href="http://bulletphysics.org/mediawiki-1.5.8/index.php/Bullet_binary_serialization" class="postlink">http://bulletphysics.org/mediawiki-1.5. ... ialization</a><br><br>Note that while running most of the (unmodified) Bullet demos, you can press '=' key to serialize to a .bullet file, named "test.bullet". It will serialize all objects and constraints in the dynamics world. Some collision shapes are not supported yet (btHeightfieldTerrainShape for example).<br><br>Thanks,<br>Erwin<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=2">Erwin Coumans</a> — Mon Sep 13, 2010 2:03 am</p><hr />
]]></content>
	</entry>
	</feed>
