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

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2010-12-30T13:11:41+00:00</updated>

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

		<entry>
		<author><name><![CDATA[Ripgiblet]]></name></author>
		<updated>2010-12-30T13:11:41+00:00</updated>

		<published>2010-12-30T13:11:41+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=21558#p21558</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=21558#p21558"/>
		<title type="html"><![CDATA[Re: Serialization]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=21558#p21558"><![CDATA[
Some questions:<br>1)Does serializeSingleShape work for btHeightfieldTerrainShape?<br>2)How to convert from btHeightfieldTerrainShape to btBvhTriangleMeshShape?<br><br>NOTES:<br>I am having trouble getting btHeightfieldTerrainShape to serialize, I have successfully serialized many other shapes including btBvhTriangleMeshShape. So if I could convert from btHeightfieldTerrainShape to btBvhTriangleMeshShape, or some other object that I can convert to , serialize out, load, then convert back.<br> <img class="smilies" src="https://pybullet.org/Bullet/phpBB3/images/smilies/icon_mrgreen.gif" width="15" height="15" alt=":mrgreen:" title="Mr. Green"><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=7586">Ripgiblet</a> — Thu Dec 30, 2010 1:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Erwin Coumans]]></name></author>
		<updated>2010-12-10T00:40:04+00:00</updated>

		<published>2010-12-10T00:40:04+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=21320#p21320</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=21320#p21320"/>
		<title type="html"><![CDATA[Re: Serialization]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=21320#p21320"><![CDATA[
There is an error in the serialization DNA.<br><br>All 0a seems to be preceded by 0d, did you apply some dos/unix line-feed conversion to that binary file btSerializer.cpp or the .bullet file?<br>Please revert to an unmodified btSerializer.cpp<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> — Fri Dec 10, 2010 12:40 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[WÃ¼mpftlbrÃ¼mpftl]]></name></author>
		<updated>2010-12-07T09:54:36+00:00</updated>

		<published>2010-12-07T09:54:36+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=21244#p21244</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=21244#p21244"/>
		<title type="html"><![CDATA[Re: Serialization]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=21244#p21244"><![CDATA[
I split the collisionshape data from the rest of my file (by droping the last but one line of my saving code) and tried to load this as bullet file with the FileInspector which returned a "Failed to allocate memory!" error.<br>Here is the file as you suggested <img class="smilies" src="https://pybullet.org/Bullet/phpBB3/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><dl class="file"><dt><span class="imageset icon_topic_attach"></span> <a class="postlink" href="https://pybullet.org/Bullet/phpBB3/download/file.php?id=606">Palm.zip</a></dt></dl><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=7482">WÃ¼mpftlbrÃ¼mpftl</a> — Tue Dec 07, 2010 9:54 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Erwin Coumans]]></name></author>
		<updated>2010-12-06T21:37:07+00:00</updated>

		<published>2010-12-06T21:37:07+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=21238#p21238</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=21238#p21238"/>
		<title type="html"><![CDATA[Re: Serialization]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=21238#p21238"><![CDATA[
<blockquote class="uncited"><div>Too bad... my world is splitted into several pages, so this could become quite tricky<br>But thank you for the quick answer <img class="smilies" src="https://pybullet.org/Bullet/phpBB3/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"></div></blockquote>It shouldn't be hard to import just some collision shapes. The code is already in the btBulletWorldImporter.<br>On Windows, you can inspect the contents of a .bullet file using the <a href="http://code.google.com/p/gamekit/downloads/detail?name=FileInspector-Win32-749.zip&amp;can=2&amp;q=" class="postlink">File Inspector</a>. Use File/inspect file.<br><br>Can you attach a (zipped) .bullet file, so we can see if there are actual collision shapes in there?<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 Dec 06, 2010 9:37 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[WÃ¼mpftlbrÃ¼mpftl]]></name></author>
		<updated>2010-12-06T21:26:39+00:00</updated>

		<published>2010-12-06T21:26:39+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=21237#p21237</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=21237#p21237"/>
		<title type="html"><![CDATA[Re: Serialization]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=21237#p21237"><![CDATA[
Too bad... my world is splitted into several pages, so this could become quite tricky<br>But thank you for the quick answer <img class="smilies" src="https://pybullet.org/Bullet/phpBB3/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=7482">WÃ¼mpftlbrÃ¼mpftl</a> — Mon Dec 06, 2010 9:26 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Erwin Coumans]]></name></author>
		<updated>2010-12-06T13:29:40+00:00</updated>

		<published>2010-12-06T13:29:40+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=21223#p21223</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=21223#p21223"/>
		<title type="html"><![CDATA[Re: Serialization]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=21223#p21223"><![CDATA[
The btBulletWorldImporter can only be used in combination with world::serialize.<br><br>If you use manual single object/shape serialization, you will need to write your own custom importer.<br><br>We cannot support all custom work, so please use the world serialize method if you get stuck.<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 Dec 06, 2010 1:29 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[PeterMacGonagan]]></name></author>
		<updated>2010-12-06T09:33:51+00:00</updated>

		<published>2010-12-06T09:33:51+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=21219#p21219</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=21219#p21219"/>
		<title type="html"><![CDATA[Re: Serialization]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=21219#p21219"><![CDATA[
May be this tutorial will help you: <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>Post the answer if you find it, please.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=7481">PeterMacGonagan</a> — Mon Dec 06, 2010 9:33 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[WÃ¼mpftlbrÃ¼mpftl]]></name></author>
		<updated>2010-12-05T22:05:29+00:00</updated>

		<published>2010-12-05T22:05:29+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=21217#p21217</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=21217#p21217"/>
		<title type="html"><![CDATA[Serialization]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=21217#p21217"><![CDATA[
Hi guys,<br><br>I'm currently trying to save and read collisionshape data in/from a file. To do this I tried to serialize the data like Erwin describes <a href="http://bulletphysics.org/Bullet/phpBB3/viewtopic.php?f=9&amp;t=4780" class="postlink">here</a>.<br>The saving process seems to work well, but when I want to recreate the saved collisionshape with btBulletWorldImporter, it tells me that there aren't any collisionshapes. I stepped into the loading methods with the debugger - it seems that there is no parsing. Then I tried first to create a btBulletFile with my data from the file but this time I got an assertion.<br><br>My saving code:<div class="codebox"><p>Code: </p><pre><code>// ...int maxSerializeBufferSize = 1024*1024*5;btDefaultSerializer Serializer(maxSerializeBufferSize);Serializer.startSerialization();if(m_pCollisionShape)     m_pCollisionShape-&gt;serializeSingleShape(&amp;Serializer);else{     btBoxShape BoxShape(btVector3(2,2,2));     BoxShape.serializeSingleShape(&amp;Serializer);}Serializer.finishSerialization();FileOut.CollisionShapeDataSize = Serializer.getCurrentBufferSize();std::ofstream Stream(GetFilename());Stream.write((char*)&amp;FileOut, sizeof(File));Stream.write((char*)Serializer.getBufferPointer(), FileOut.CollisionShapeDataSize);</code></pre></div>The code for the loading<div class="codebox"><p>Code: </p><pre><code>// ...char* pCollisionShapeData = new char[FileIn.CollisionShapeDataSize];Stream.read(pCollisionShapeData, FileIn.CollisionShapeDataSize);btBulletWorldImporter Importer(0);if(Importer.loadFileFromMemory(pCollisionShapeData, FileIn.CollisionShapeDataSize) &amp;&amp; Importer.getNumCollisionShapes()){    btCollisionShape* pShape = Importer.getCollisionShapeByIndex(0);    if(pShape-&gt;getShapeType() == BOX_SHAPE_PROXYTYPE)        m_pCollisionShape = new btBoxShape(*static_cast&lt;btBoxShape*&gt;(pShape));    else if(pShape-&gt;getShapeType() == TRIANGLE_MESH_SHAPE_PROXYTYPE)        m_pCollisionShape = new btBvhTriangleMeshShape(*static_cast&lt;btBvhTriangleMeshShape*&gt;(pShape));}else{    // ...}delete[] pCollisionShapeData;</code></pre></div>Has anyone an idea what I am doing wrong or could try next?<br>Thanks for your answers <img class="smilies" src="https://pybullet.org/Bullet/phpBB3/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=7482">WÃ¼mpftlbrÃ¼mpftl</a> — Sun Dec 05, 2010 10:05 pm</p><hr />
]]></content>
	</entry>
	</feed>
